diff --git a/README.rst b/README.rst index 063b8fc4ffa9..34b1cfaafe1f 100644 --- a/README.rst +++ b/README.rst @@ -63,7 +63,7 @@ The following client libraries have **GA** support: .. _Natural Language Documentation: https://googleapis.dev/python/language/latest .. _Google Cloud Pub/Sub: https://pypi.org/project/google-cloud-pubsub/ -.. _Pub/Sub README: https://github.com/googleapis/google-cloud-python/tree/master/pubsub +.. _Pub/Sub README: https://github.com/googleapis/python-pubsub .. _Pub/Sub Documentation: https://googleapis.dev/python/pubsub/latest .. _Google Cloud Spanner: https://pypi.org/project/google-cloud-spanner @@ -71,7 +71,7 @@ The following client libraries have **GA** support: .. _Spanner Documentation: https://googleapis.dev/python/spanner/latest .. _Google Cloud Speech to Text: https://pypi.org/project/google-cloud-speech/ -.. _Speech to Text README: https://github.com/googleapis/google-cloud-python/tree/master/speech +.. _Speech to Text README: https://github.com/googleapis/python-speech .. _Speech to Text Documentation: https://googleapis.dev/python/speech/latest .. _Google Cloud Storage: https://pypi.org/project/google-cloud-storage/ @@ -116,7 +116,7 @@ The following client libraries have **beta** support: .. _Asset Documentation: https://googleapis.dev/python/cloudasset/latest .. _Google Cloud Billing Budgets: https://pypi.org/project/google-cloud-billing-budgets/ -.. _Billing Budgets README: https://github.com/googleapis/google-cloud-python/tree/master/billingbudgets +.. _Billing Budgets README: https://github.com/googleapis/python-billingbudgets .. _Billing Budgets Documentation: https://googleapis.dev/python/billingbudgets/latest .. _Google Cloud Data Catalog: https://pypi.org/project/google-cloud-datacatalog/ @@ -132,11 +132,11 @@ The following client libraries have **beta** support: .. _Firestore Documentation: https://googleapis.dev/python/firestore/latest .. _Google Cloud Video Intelligence: https://pypi.org/project/google-cloud-videointelligence -.. _Video Intelligence README: https://github.com/googleapis/google-cloud-python/tree/master/videointelligence +.. _Video Intelligence README: https://github.com/googleapis/python-videointelligence .. _Video Intelligence Documentation: https://googleapis.dev/python/videointelligence/latest .. _Google Cloud Vision: https://pypi.org/project/google-cloud-vision/ -.. _Vision README: https://github.com/googleapis/google-cloud-python/tree/master/vision +.. _Vision README: https://github.com/googleapis/python-vision .. _Vision Documentation: https://googleapis.dev/python/vision/latest @@ -158,12 +158,14 @@ The following client libraries have **alpha** support: - `Google Cloud Dataproc`_ (`Dataproc README`_, `Dataproc Documentation`_) - `Google Cloud DLP`_ (`DLP README`_, `DLP Documentation`_) - `Google Cloud DNS`_ (`DNS README`_, `DNS Documentation`_) +- `Google Cloud IAM`_ (`IAM README`_, `IAM Documentation`_) - `Google Cloud IoT`_ (`IoT README`_, `IoT Documentation`_) - `Google Cloud Memorystore for Redis`_ (`Redis README`_, `Redis Documentation`_) - `Google Cloud Recommender`_ (`Recommender README`_, `Recommender Documentation`_) - `Google Cloud Resource Manager`_ (`Resource Manager README`_, `Resource Manager Documentation`_) - `Google Cloud Runtime Configuration`_ (`Runtime Config README`_, `Runtime Config Documentation`_) - `Google Cloud Security Scanner`_ (`Security Scanner README`_ , `Security Scanner Documentation`_) +- `Google Cloud Talent`_ (`Talent README`_, `Talent Documentation`_) - `Google Cloud Trace`_ (`Trace README`_, `Trace Documentation`_) - `Google Cloud Text-to-Speech`_ (`Text-to-Speech README`_, `Text-to-Speech Documentation`_) - `Grafeas`_ (`Grafeas README`_, `Grafeas Documentation`_) @@ -207,12 +209,16 @@ The following client libraries have **alpha** support: .. _DNS README: https://github.com/googleapis/python-dns#python-client-for-google-cloud-dns .. _DNS Documentation: https://googleapis.dev/python/dns/latest +.. _Google Cloud IAM: https://pypi.org/project/google-cloud-IAM/ +.. _IAM README: https://github.com/googleapis/python-iam +.. _IAM Documentation: https://googleapis.dev/python/iamcredentials/latest + .. _Google Cloud IoT: https://pypi.org/project/google-cloud-iot/ .. _IoT README: https://github.com/googleapis/google-cloud-python/tree/master/iot .. _IoT Documentation: https://googleapis.dev/python/cloudiot/latest .. _Google Cloud Memorystore for Redis: https://pypi.org/project/google-cloud-redis/ -.. _Redis README: https://github.com/googleapis/google-cloud-python/tree/master/redis +.. _Redis README: https://github.com/googleapis/python-redis .. _Redis Documentation: https://googleapis.dev/python/redis/latest .. _Google Cloud Recommender: https://pypi.org/project/google-cloud-recommender/ @@ -231,12 +237,16 @@ The following client libraries have **alpha** support: .. _Security Scanner README: https://github.com/googleapis/google-cloud-python/blob/master/websecurityscanner .. _Security Scanner Documentation: https://googleapis.dev/python/websecurityscanner/latest +.. _Google Cloud Talent: https://pypi.org/project/google-cloud-talent/ +.. _Talent README: https://github.com/googleapis/python-talent +.. _Talent Documentation: https://googleapis.dev/python/talent/latest + .. _Google Cloud Text-to-Speech: https://pypi.org/project/google-cloud-texttospeech/ .. _Text-to-Speech README: https://github.com/googleapis/python-texttospeech#python-client-for-cloud-text-to-speech-api .. _Text-to-Speech Documentation: https://googleapis.dev/python/texttospeech/latest .. _Google Cloud Trace: https://pypi.org/project/google-cloud-trace/ -.. _Trace README: https://github.com/googleapis/google-cloud-python/tree/master/trace +.. _Trace README: https://github.com/googleapis/python-trace .. _Trace Documentation: https://googleapis.dev/python/cloudtrace/latest .. _Grafeas: https://pypi.org/project/grafeas/ diff --git a/billingbudgets/.coveragerc b/billingbudgets/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/billingbudgets/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/billingbudgets/.flake8 b/billingbudgets/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/billingbudgets/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/billingbudgets/.repo-metadata.json b/billingbudgets/.repo-metadata.json deleted file mode 100644 index 40fd90f82168..000000000000 --- a/billingbudgets/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "billingbudgets", - "name_pretty": "Cloud Billing Budget", - "product_documentation": "https://cloud.google.com/billing/docs/how-to/budget-api-overview", - "client_documentation": "https://googleapis.dev/python/billingbudgets/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559770", - "release_level": "beta", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-billing-budgets", - "api_id": "billingbudgets.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/billingbudgets/CHANGELOG.md b/billingbudgets/CHANGELOG.md deleted file mode 100644 index 12330bc55ae9..000000000000 --- a/billingbudgets/CHANGELOG.md +++ /dev/null @@ -1,24 +0,0 @@ -# Changelog -## 0.2.0 - -12-12-2019 12:36 PST - - -### New Features -- Deprecate resource name helper methods (via synth). ([#9830](https://github.com/googleapis/google-cloud-python/pull/9830)) - -### Internal / Testing Changes -- Add 3.8 unit tests (via synth). ([#9933](https://github.com/googleapis/google-cloud-python/pull/9933)) -- Remove TODOs in proto comments (via synth). ([#9912](https://github.com/googleapis/google-cloud-python/pull/9912)) -- Add comments to proto files (via synth). ([#9854](https://github.com/googleapis/google-cloud-python/pull/9854)) - -## 0.1.0 - -11-15-2019 10:34 PST - -### New Features -- Initial generation of billing budget. ([#9622](https://github.com/googleapis/google-cloud-python/pull/9622)) - -### Documentation -- Add Python 2 sunset banner (via synth). ([#9813](https://github.com/googleapis/google-cloud-python/pull/9813)) - diff --git a/billingbudgets/LICENSE b/billingbudgets/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/billingbudgets/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/billingbudgets/MANIFEST.in b/billingbudgets/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/billingbudgets/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/billingbudgets/README.rst b/billingbudgets/README.rst deleted file mode 100644 index 344135705e20..000000000000 --- a/billingbudgets/README.rst +++ /dev/null @@ -1,77 +0,0 @@ -Python Client for Cloud Billing Budget API (`Alpha`_) -===================================================== - -`Cloud Billing Budget API`_: The Cloud Billing Budget API stores Cloud Billing budgets, which define a -budget plan and the rules to execute as spend is tracked against that -plan. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _Cloud Billing Budget API: https://cloud.google.com/billing/docs/how-to/budget-api-overview -.. _Client Library Documentation: https://googleapis.dev/python/billingbudgets/latest -.. _Product Documentation: https://cloud.google.com/billing/docs/how-to/budget-api-overview - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Billing Budget API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Billing Budget API.: https://cloud.google.com/billing/docs/how-to/budget-api-overview -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-billing-budgets - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-billing-budgets - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Billing Budget API - API to see other available methods on the client. -- Read the `Cloud Billing Budget API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Cloud Billing Budget API Product documentation: https://cloud.google.com/billing/docs/how-to/budget-api-overview -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst \ No newline at end of file diff --git a/billingbudgets/docs/README.rst b/billingbudgets/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/billingbudgets/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/billingbudgets/docs/_static/custom.css b/billingbudgets/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/billingbudgets/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/billingbudgets/docs/_templates/layout.html b/billingbudgets/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/billingbudgets/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/billingbudgets/docs/changelog.md b/billingbudgets/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/billingbudgets/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/billingbudgets/docs/conf.py b/billingbudgets/docs/conf.py deleted file mode 100644 index a3933c50cbc5..000000000000 --- a/billingbudgets/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-billing-budgets documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-billing-budgets" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-billing-budgets-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-billing-budgets.tex", - u"google-cloud-billing-budgets Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-billing-budgets", - u"google-cloud-billing-budgets Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-billing-budgets", - u"google-cloud-billing-budgets Documentation", - author, - "google-cloud-billing-budgets", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/billingbudgets/docs/gapic/v1beta1/api.rst b/billingbudgets/docs/gapic/v1beta1/api.rst deleted file mode 100644 index b1f9f07ec077..000000000000 --- a/billingbudgets/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Billing Budget API -=================================== - -.. automodule:: google.cloud.billing_budgets_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/billingbudgets/docs/gapic/v1beta1/types.rst b/billingbudgets/docs/gapic/v1beta1/types.rst deleted file mode 100644 index d25d7a205bc1..000000000000 --- a/billingbudgets/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Billing Budget API Client -========================================= - -.. automodule:: google.cloud.billing_budgets_v1beta1.types - :members: \ No newline at end of file diff --git a/billingbudgets/docs/index.rst b/billingbudgets/docs/index.rst deleted file mode 100644 index 813764f98353..000000000000 --- a/billingbudgets/docs/index.rst +++ /dev/null @@ -1,19 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1beta1/api - gapic/v1beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-billing-budgets`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/billingbudgets/google/__init__.py b/billingbudgets/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/billingbudgets/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/billingbudgets/google/cloud/__init__.py b/billingbudgets/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/billingbudgets/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/billingbudgets/google/cloud/billing_budgets.py b/billingbudgets/google/cloud/billing_budgets.py deleted file mode 100644 index 602f2e80266f..000000000000 --- a/billingbudgets/google/cloud/billing_budgets.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.billing_budgets_v1beta1 import BudgetServiceClient -from google.cloud.billing_budgets_v1beta1 import enums -from google.cloud.billing_budgets_v1beta1 import types - - -__all__ = ("enums", "types", "BudgetServiceClient") diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/__init__.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/__init__.py deleted file mode 100644 index 79ad050672d1..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.billing_budgets_v1beta1 import types -from google.cloud.billing_budgets_v1beta1.gapic import budget_service_client -from google.cloud.billing_budgets_v1beta1.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class BudgetServiceClient(budget_service_client.BudgetServiceClient): - __doc__ = budget_service_client.BudgetServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "BudgetServiceClient") diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/__init__.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py deleted file mode 100644 index 10c13615c805..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py +++ /dev/null @@ -1,618 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.billing.budgets.v1beta1 BudgetService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.billing_budgets_v1beta1.gapic import budget_service_client_config -from google.cloud.billing_budgets_v1beta1.gapic import enums -from google.cloud.billing_budgets_v1beta1.gapic.transports import ( - budget_service_grpc_transport, -) -from google.cloud.billing_budgets_v1beta1.proto import budget_model_pb2 -from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2 -from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-billing-budgets" -).version - - -class BudgetServiceClient(object): - """ - BudgetService stores Cloud Billing budgets, which define a - budget plan and rules to execute as we track spend against that plan. - """ - - SERVICE_ADDRESS = "billingbudgets.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.billing.budgets.v1beta1.BudgetService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - BudgetServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def billing_account_path(cls, billing_account): - """Return a fully-qualified billing_account string.""" - return google.api_core.path_template.expand( - "billingAccounts/{billing_account}", billing_account=billing_account - ) - - @classmethod - def budget_path(cls, billing_account, budget): - """Return a fully-qualified budget string.""" - return google.api_core.path_template.expand( - "billingAccounts/{billing_account}/budgets/{budget}", - billing_account=billing_account, - budget=budget, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.BudgetServiceGrpcTransport, - Callable[[~.Credentials, type], ~.BudgetServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = budget_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=budget_service_grpc_transport.BudgetServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = budget_service_grpc_transport.BudgetServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_budget( - self, - parent, - budget, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new budget. See - Quotas and limits - for more information on the limits of the number of budgets you can create. - - Example: - >>> from google.cloud import billing_budgets_v1beta1 - >>> - >>> client = billing_budgets_v1beta1.BudgetServiceClient() - >>> - >>> parent = client.billing_account_path('[BILLING_ACCOUNT]') - >>> - >>> # TODO: Initialize `budget`: - >>> budget = {} - >>> - >>> response = client.create_budget(parent, budget) - - Args: - parent (str): Required. The name of the billing account to create the budget in. - Values are of the form ``billingAccounts/{billingAccountId}``. - budget (Union[dict, ~google.cloud.billing_budgets_v1beta1.types.Budget]): Required. Budget to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_budget" not in self._inner_api_calls: - self._inner_api_calls[ - "create_budget" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_budget, - default_retry=self._method_configs["CreateBudget"].retry, - default_timeout=self._method_configs["CreateBudget"].timeout, - client_info=self._client_info, - ) - - request = budget_service_pb2.CreateBudgetRequest(parent=parent, budget=budget) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_budget"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_budget( - self, - budget, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates a budget and returns the updated budget. - - Example: - >>> from google.cloud import billing_budgets_v1beta1 - >>> - >>> client = billing_budgets_v1beta1.BudgetServiceClient() - >>> - >>> # TODO: Initialize `budget`: - >>> budget = {} - >>> - >>> response = client.update_budget(budget) - - Args: - budget (Union[dict, ~google.cloud.billing_budgets_v1beta1.types.Budget]): Required. The updated budget object. - The budget to update is specified by the budget name in the budget. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` - update_mask (Union[dict, ~google.cloud.billing_budgets_v1beta1.types.FieldMask]): Optional. Indicates which fields in the provided budget to update. - Read-only fields (such as ``name``) cannot be changed. If this is not - provided, then only fields with non-default values from the request are - updated. See - https://developers.google.com/protocol-buffers/docs/proto3#default for - more details about default values. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.billing_budgets_v1beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_budget" not in self._inner_api_calls: - self._inner_api_calls[ - "update_budget" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_budget, - default_retry=self._method_configs["UpdateBudget"].retry, - default_timeout=self._method_configs["UpdateBudget"].timeout, - client_info=self._client_info, - ) - - request = budget_service_pb2.UpdateBudgetRequest( - budget=budget, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("budget.name", budget.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_budget"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_budget( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a budget. - - Example: - >>> from google.cloud import billing_budgets_v1beta1 - >>> - >>> client = billing_budgets_v1beta1.BudgetServiceClient() - >>> - >>> name = client.budget_path('[BILLING_ACCOUNT]', '[BUDGET]') - >>> - >>> response = client.get_budget(name) - - Args: - name (str): Required. Name of budget to get. Values are of the form - ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_budget" not in self._inner_api_calls: - self._inner_api_calls[ - "get_budget" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_budget, - default_retry=self._method_configs["GetBudget"].retry, - default_timeout=self._method_configs["GetBudget"].timeout, - client_info=self._client_info, - ) - - request = budget_service_pb2.GetBudgetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_budget"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_budgets( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns a list of budgets for a billing account. - - Example: - >>> from google.cloud import billing_budgets_v1beta1 - >>> - >>> client = billing_budgets_v1beta1.BudgetServiceClient() - >>> - >>> parent = client.billing_account_path('[BILLING_ACCOUNT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_budgets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_budgets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Name of billing account to list budgets under. Values are of - the form ``billingAccounts/{billingAccountId}``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.billing_budgets_v1beta1.types.Budget` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_budgets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_budgets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_budgets, - default_retry=self._method_configs["ListBudgets"].retry, - default_timeout=self._method_configs["ListBudgets"].timeout, - client_info=self._client_info, - ) - - request = budget_service_pb2.ListBudgetsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_budgets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="budgets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_budget( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a budget. Returns successfully if already deleted. - - Example: - >>> from google.cloud import billing_budgets_v1beta1 - >>> - >>> client = billing_budgets_v1beta1.BudgetServiceClient() - >>> - >>> name = client.budget_path('[BILLING_ACCOUNT]', '[BUDGET]') - >>> - >>> client.delete_budget(name) - - Args: - name (str): Required. Name of the budget to delete. Values are of the form - ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_budget" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_budget" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_budget, - default_retry=self._method_configs["DeleteBudget"].retry, - default_timeout=self._method_configs["DeleteBudget"].timeout, - client_info=self._client_info, - ) - - request = budget_service_pb2.DeleteBudgetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_budget"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client_config.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client_config.py deleted file mode 100644 index 1987acdea387..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/budget_service_client_config.py +++ /dev/null @@ -1,48 +0,0 @@ -config = { - "interfaces": { - "google.cloud.billing.budgets.v1beta1.BudgetService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateBudget": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateBudget": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetBudget": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListBudgets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteBudget": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/enums.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/enums.py deleted file mode 100644 index 39ead59afc74..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/enums.py +++ /dev/null @@ -1,55 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Filter(object): - class CreditTypesTreatment(enum.IntEnum): - """ - Specifies how credits should be treated when determining spend for - threshold calculations. - - Attributes: - CREDIT_TYPES_TREATMENT_UNSPECIFIED (int) - INCLUDE_ALL_CREDITS (int): All types of credit are subtracted from the gross cost to determine the - spend for threshold calculations. - EXCLUDE_ALL_CREDITS (int): All types of credit are added to the net cost to determine the spend for - threshold calculations. - """ - - CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0 - INCLUDE_ALL_CREDITS = 1 - EXCLUDE_ALL_CREDITS = 2 - - -class ThresholdRule(object): - class Basis(enum.IntEnum): - """ - The type of basis used to determine if spend has passed the threshold. - - Attributes: - BASIS_UNSPECIFIED (int): Unspecified threshold basis. - CURRENT_SPEND (int): Use current spend as the basis for comparison against the threshold. - FORECASTED_SPEND (int): Use forecasted spend for the period as the basis for comparison against - the threshold. - """ - - BASIS_UNSPECIFIED = 0 - CURRENT_SPEND = 1 - FORECASTED_SPEND = 2 diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/transports/__init__.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py deleted file mode 100644 index bf49a4d2339f..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py +++ /dev/null @@ -1,178 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2_grpc - - -class BudgetServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.billing.budgets.v1beta1 BudgetService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="billingbudgets.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "budget_service_stub": budget_service_pb2_grpc.BudgetServiceStub(channel) - } - - @classmethod - def create_channel( - cls, address="billingbudgets.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_budget(self): - """Return the gRPC stub for :meth:`BudgetServiceClient.create_budget`. - - Creates a new budget. See - Quotas and limits - for more information on the limits of the number of budgets you can create. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["budget_service_stub"].CreateBudget - - @property - def update_budget(self): - """Return the gRPC stub for :meth:`BudgetServiceClient.update_budget`. - - Updates a budget and returns the updated budget. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["budget_service_stub"].UpdateBudget - - @property - def get_budget(self): - """Return the gRPC stub for :meth:`BudgetServiceClient.get_budget`. - - Returns a budget. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["budget_service_stub"].GetBudget - - @property - def list_budgets(self): - """Return the gRPC stub for :meth:`BudgetServiceClient.list_budgets`. - - Returns a list of budgets for a billing account. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["budget_service_stub"].ListBudgets - - @property - def delete_budget(self): - """Return the gRPC stub for :meth:`BudgetServiceClient.delete_budget`. - - Deletes a budget. Returns successfully if already deleted. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["budget_service_stub"].DeleteBudget diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/__init__.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto deleted file mode 100644 index 89e96bea21c4..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model.proto +++ /dev/null @@ -1,180 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.billing.budgets.v1beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/type/money.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets"; -option java_multiple_files = true; -option java_package = "com.google.cloud.billing.budgets.v1beta1"; - -// A budget is a plan that describes what you expect to spend on Cloud -// projects, plus the rules to execute as spend is tracked against that plan, -// (for example, send an alert when 90% of the target spend is met). -// Currently all plans are monthly budgets so the usage period(s) tracked are -// implied (calendar months of usage back-to-back). -message Budget { - option (google.api.resource) = { - type: "billingbudgets.googleapis.com/Budget" - pattern: "billingAccounts/{billing_account}/budgets/{budget}" - }; - - // Output only. Resource name of the budget. - // The resource name implies the scope of a budget. Values are of the form - // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // User data for display name in UI. - // Validation: <= 60 chars. - string display_name = 2; - - // Optional. Filters that define which resources are used to compute - // the actual spend against the budget. - Filter budget_filter = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Budgeted amount. - BudgetAmount amount = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. Rules that trigger alerts (notifications of thresholds - // being crossed) when spend exceeds the specified percentages of the budget. - repeated ThresholdRule threshold_rules = 5 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Rules to apply to all updates to the actual spend, regardless - // of the thresholds set in `threshold_rules`. - AllUpdatesRule all_updates_rule = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Etag to validate that the object is unchanged for a - // read-modify-write operation. - // An empty etag will cause an update to overwrite other changes. - string etag = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// The budgeted amount for each usage period. -message BudgetAmount { - // Specification for what amount to use as the budget. - oneof budget_amount { - // A specified amount to use as the budget. - // `currency_code` is optional. If specified, it must match the - // currency of the billing account. The `currency_code` is provided on - // output. - google.type.Money specified_amount = 1; - - // Use the last period's actual spend as the budget for the present period. - LastPeriodAmount last_period_amount = 2; - } -} - -// Describes a budget amount targeted to last period's spend. -// At this time, the amount is automatically 100% of last period's spend; -// that is, there are no other options yet. -// Future configuration will be described here (for example, configuring a -// percentage of last period's spend). -message LastPeriodAmount { - -} - -// ThresholdRule contains a definition of a threshold which triggers -// an alert (a notification of a threshold being crossed) to be sent when -// spend goes above the specified amount. -// Alerts are automatically e-mailed to users with the Billing Account -// Administrator role or the Billing Account User role. -// The thresholds here have no effect on notifications sent to anything -// configured under `Budget.all_updates_rule`. -message ThresholdRule { - // The type of basis used to determine if spend has passed the threshold. - enum Basis { - // Unspecified threshold basis. - BASIS_UNSPECIFIED = 0; - - // Use current spend as the basis for comparison against the threshold. - CURRENT_SPEND = 1; - - // Use forecasted spend for the period as the basis for comparison against - // the threshold. - FORECASTED_SPEND = 2; - } - - // Required. Send an alert when this threshold is exceeded. - // This is a 1.0-based percentage, so 0.5 = 50%. - // Validation: non-negative number. - double threshold_percent = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The type of basis used to determine if spend has passed the - // threshold. Behavior defaults to CURRENT_SPEND if not set. - Basis spend_basis = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// AllUpdatesRule defines notifications that are sent on every update to the -// billing account's spend, regardless of the thresholds defined using -// threshold rules. -message AllUpdatesRule { - // Required. The name of the Cloud Pub/Sub topic where budget related messages will be - // published, in the form `projects/{project_id}/topics/{topic_id}`. Updates - // are sent at regular intervals to the topic. - // The topic needs to be created before the budget is created; see - // https://cloud.google.com/billing/docs/how-to/budgets#manage-notifications - // for more details. - // Caller is expected to have - // `pubsub.topics.setIamPolicy` permission on the topic when it's set for a - // budget, otherwise, the API call will fail with PERMISSION_DENIED. See - // https://cloud.google.com/pubsub/docs/access-control for more details on - // Pub/Sub roles and permissions. - string pubsub_topic = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The schema version of the notification. - // Only "1.0" is accepted. It represents the JSON schema as defined in - // https://cloud.google.com/billing/docs/how-to/budgets#notification_format - string schema_version = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// A filter for a budget, limiting the scope of the cost to calculate. -message Filter { - // Specifies how credits should be treated when determining spend for - // threshold calculations. - enum CreditTypesTreatment { - CREDIT_TYPES_TREATMENT_UNSPECIFIED = 0; - - // All types of credit are subtracted from the gross cost to determine the - // spend for threshold calculations. - INCLUDE_ALL_CREDITS = 1; - - // All types of credit are added to the net cost to determine the spend for - // threshold calculations. - EXCLUDE_ALL_CREDITS = 2; - } - - // Optional. A set of projects of the form `projects/{project_id}`, - // specifying that usage from only this set of projects should be - // included in the budget. If omitted, the report will include all usage for - // the billing account, regardless of which project the usage occurred on. - // Only zero or one project can be specified currently. - repeated string projects = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If not set, default behavior is `INCLUDE_ALL_CREDITS`. - CreditTypesTreatment credit_types_treatment = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of services of the form `services/{service_id}`, - // specifying that usage from only this set of services should be - // included in the budget. If omitted, the report will include usage for - // all the services. - // The service names are available through the Catalog API: - // https://cloud.google.com/billing/v1/how-tos/catalog-api. - repeated string services = 3 [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py deleted file mode 100644 index cac9ce2b0342..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py +++ /dev/null @@ -1,765 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/billing/budgets_v1beta1/proto/budget_model.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.type import money_pb2 as google_dot_type_dot_money__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/billing/budgets_v1beta1/proto/budget_model.proto", - package="google.cloud.billing.budgets.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets" - ), - serialized_pb=_b( - '\n=google/cloud/billing/budgets_v1beta1/proto/budget_model.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x17google/type/money.proto"\xde\x03\n\x06\x42udget\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12H\n\rbudget_filter\x18\x03 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.FilterB\x03\xe0\x41\x01\x12G\n\x06\x61mount\x18\x04 \x01(\x0b\x32\x32.google.cloud.billing.budgets.v1beta1.BudgetAmountB\x03\xe0\x41\x02\x12Q\n\x0fthreshold_rules\x18\x05 \x03(\x0b\x32\x33.google.cloud.billing.budgets.v1beta1.ThresholdRuleB\x03\xe0\x41\x02\x12S\n\x10\x61ll_updates_rule\x18\x06 \x01(\x0b\x32\x34.google.cloud.billing.budgets.v1beta1.AllUpdatesRuleB\x03\xe0\x41\x01\x12\x11\n\x04\x65tag\x18\x07 \x01(\tB\x03\xe0\x41\x01:]\xea\x41Z\n$billingbudgets.googleapis.com/Budget\x12\x32\x62illingAccounts/{billing_account}/budgets/{budget}"\xa5\x01\n\x0c\x42udgetAmount\x12.\n\x10specified_amount\x18\x01 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12T\n\x12last_period_amount\x18\x02 \x01(\x0b\x32\x36.google.cloud.billing.budgets.v1beta1.LastPeriodAmountH\x00\x42\x0f\n\rbudget_amount"\x12\n\x10LastPeriodAmount"\xcd\x01\n\rThresholdRule\x12\x1e\n\x11threshold_percent\x18\x01 \x01(\x01\x42\x03\xe0\x41\x02\x12S\n\x0bspend_basis\x18\x02 \x01(\x0e\x32\x39.google.cloud.billing.budgets.v1beta1.ThresholdRule.BasisB\x03\xe0\x41\x01"G\n\x05\x42\x61sis\x12\x15\n\x11\x42\x41SIS_UNSPECIFIED\x10\x00\x12\x11\n\rCURRENT_SPEND\x10\x01\x12\x14\n\x10\x46ORECASTED_SPEND\x10\x02"H\n\x0e\x41llUpdatesRule\x12\x19\n\x0cpubsub_topic\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1b\n\x0eschema_version\x18\x02 \x01(\tB\x03\xe0\x41\x02"\x90\x02\n\x06\x46ilter\x12\x15\n\x08projects\x18\x01 \x03(\tB\x03\xe0\x41\x01\x12\x66\n\x16\x63redit_types_treatment\x18\x04 \x01(\x0e\x32\x41.google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatmentB\x03\xe0\x41\x01\x12\x15\n\x08services\x18\x03 \x03(\tB\x03\xe0\x41\x01"p\n\x14\x43reditTypesTreatment\x12&\n"CREDIT_TYPES_TREATMENT_UNSPECIFIED\x10\x00\x12\x17\n\x13INCLUDE_ALL_CREDITS\x10\x01\x12\x17\n\x13\x45XCLUDE_ALL_CREDITS\x10\x02\x42y\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_type_dot_money__pb2.DESCRIPTOR, - ], -) - - -_THRESHOLDRULE_BASIS = _descriptor.EnumDescriptor( - name="Basis", - full_name="google.cloud.billing.budgets.v1beta1.ThresholdRule.Basis", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="BASIS_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CURRENT_SPEND", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FORECASTED_SPEND", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=992, - serialized_end=1063, -) -_sym_db.RegisterEnumDescriptor(_THRESHOLDRULE_BASIS) - -_FILTER_CREDITTYPESTREATMENT = _descriptor.EnumDescriptor( - name="CreditTypesTreatment", - full_name="google.cloud.billing.budgets.v1beta1.Filter.CreditTypesTreatment", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CREDIT_TYPES_TREATMENT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INCLUDE_ALL_CREDITS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXCLUDE_ALL_CREDITS", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1300, - serialized_end=1412, -) -_sym_db.RegisterEnumDescriptor(_FILTER_CREDITTYPESTREATMENT) - - -_BUDGET = _descriptor.Descriptor( - name="Budget", - full_name="google.cloud.billing.budgets.v1beta1.Budget", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.billing.budgets.v1beta1.Budget.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.billing.budgets.v1beta1.Budget.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="budget_filter", - full_name="google.cloud.billing.budgets.v1beta1.Budget.budget_filter", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="google.cloud.billing.budgets.v1beta1.Budget.amount", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="threshold_rules", - full_name="google.cloud.billing.budgets.v1beta1.Budget.threshold_rules", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="all_updates_rule", - full_name="google.cloud.billing.budgets.v1beta1.Budget.all_updates_rule", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="etag", - full_name="google.cloud.billing.budgets.v1beta1.Budget.etag", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352AZ\n$billingbudgets.googleapis.com/Budget\0222billingAccounts/{billing_account}/budgets/{budget}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=189, - serialized_end=667, -) - - -_BUDGETAMOUNT = _descriptor.Descriptor( - name="BudgetAmount", - full_name="google.cloud.billing.budgets.v1beta1.BudgetAmount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="specified_amount", - full_name="google.cloud.billing.budgets.v1beta1.BudgetAmount.specified_amount", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="last_period_amount", - full_name="google.cloud.billing.budgets.v1beta1.BudgetAmount.last_period_amount", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="budget_amount", - full_name="google.cloud.billing.budgets.v1beta1.BudgetAmount.budget_amount", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=670, - serialized_end=835, -) - - -_LASTPERIODAMOUNT = _descriptor.Descriptor( - name="LastPeriodAmount", - full_name="google.cloud.billing.budgets.v1beta1.LastPeriodAmount", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=837, - serialized_end=855, -) - - -_THRESHOLDRULE = _descriptor.Descriptor( - name="ThresholdRule", - full_name="google.cloud.billing.budgets.v1beta1.ThresholdRule", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="threshold_percent", - full_name="google.cloud.billing.budgets.v1beta1.ThresholdRule.threshold_percent", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spend_basis", - full_name="google.cloud.billing.budgets.v1beta1.ThresholdRule.spend_basis", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_THRESHOLDRULE_BASIS], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=858, - serialized_end=1063, -) - - -_ALLUPDATESRULE = _descriptor.Descriptor( - name="AllUpdatesRule", - full_name="google.cloud.billing.budgets.v1beta1.AllUpdatesRule", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pubsub_topic", - full_name="google.cloud.billing.budgets.v1beta1.AllUpdatesRule.pubsub_topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="schema_version", - full_name="google.cloud.billing.budgets.v1beta1.AllUpdatesRule.schema_version", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1065, - serialized_end=1137, -) - - -_FILTER = _descriptor.Descriptor( - name="Filter", - full_name="google.cloud.billing.budgets.v1beta1.Filter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="projects", - full_name="google.cloud.billing.budgets.v1beta1.Filter.projects", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="credit_types_treatment", - full_name="google.cloud.billing.budgets.v1beta1.Filter.credit_types_treatment", - index=1, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="services", - full_name="google.cloud.billing.budgets.v1beta1.Filter.services", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FILTER_CREDITTYPESTREATMENT], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1140, - serialized_end=1412, -) - -_BUDGET.fields_by_name["budget_filter"].message_type = _FILTER -_BUDGET.fields_by_name["amount"].message_type = _BUDGETAMOUNT -_BUDGET.fields_by_name["threshold_rules"].message_type = _THRESHOLDRULE -_BUDGET.fields_by_name["all_updates_rule"].message_type = _ALLUPDATESRULE -_BUDGETAMOUNT.fields_by_name[ - "specified_amount" -].message_type = google_dot_type_dot_money__pb2._MONEY -_BUDGETAMOUNT.fields_by_name["last_period_amount"].message_type = _LASTPERIODAMOUNT -_BUDGETAMOUNT.oneofs_by_name["budget_amount"].fields.append( - _BUDGETAMOUNT.fields_by_name["specified_amount"] -) -_BUDGETAMOUNT.fields_by_name[ - "specified_amount" -].containing_oneof = _BUDGETAMOUNT.oneofs_by_name["budget_amount"] -_BUDGETAMOUNT.oneofs_by_name["budget_amount"].fields.append( - _BUDGETAMOUNT.fields_by_name["last_period_amount"] -) -_BUDGETAMOUNT.fields_by_name[ - "last_period_amount" -].containing_oneof = _BUDGETAMOUNT.oneofs_by_name["budget_amount"] -_THRESHOLDRULE.fields_by_name["spend_basis"].enum_type = _THRESHOLDRULE_BASIS -_THRESHOLDRULE_BASIS.containing_type = _THRESHOLDRULE -_FILTER.fields_by_name[ - "credit_types_treatment" -].enum_type = _FILTER_CREDITTYPESTREATMENT -_FILTER_CREDITTYPESTREATMENT.containing_type = _FILTER -DESCRIPTOR.message_types_by_name["Budget"] = _BUDGET -DESCRIPTOR.message_types_by_name["BudgetAmount"] = _BUDGETAMOUNT -DESCRIPTOR.message_types_by_name["LastPeriodAmount"] = _LASTPERIODAMOUNT -DESCRIPTOR.message_types_by_name["ThresholdRule"] = _THRESHOLDRULE -DESCRIPTOR.message_types_by_name["AllUpdatesRule"] = _ALLUPDATESRULE -DESCRIPTOR.message_types_by_name["Filter"] = _FILTER -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Budget = _reflection.GeneratedProtocolMessageType( - "Budget", - (_message.Message,), - dict( - DESCRIPTOR=_BUDGET, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""A budget is a plan that describes what you expect to spend - on Cloud projects, plus the rules to execute as spend is tracked against - that plan, (for example, send an alert when 90% of the target spend is - met). Currently all plans are monthly budgets so the usage period(s) - tracked are implied (calendar months of usage back-to-back). - - - Attributes: - name: - Output only. Resource name of the budget. The resource name - implies the scope of a budget. Values are of the form - ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. - display_name: - User data for display name in UI. Validation: <= 60 chars. - budget_filter: - Optional. Filters that define which resources are used to - compute the actual spend against the budget. - amount: - Required. Budgeted amount. - threshold_rules: - Required. Rules that trigger alerts (notifications of - thresholds being crossed) when spend exceeds the specified - percentages of the budget. - all_updates_rule: - Optional. Rules to apply to all updates to the actual spend, - regardless of the thresholds set in ``threshold_rules``. - etag: - Optional. Etag to validate that the object is unchanged for a - read-modify-write operation. An empty etag will cause an - update to overwrite other changes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.Budget) - ), -) -_sym_db.RegisterMessage(Budget) - -BudgetAmount = _reflection.GeneratedProtocolMessageType( - "BudgetAmount", - (_message.Message,), - dict( - DESCRIPTOR=_BUDGETAMOUNT, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""The budgeted amount for each usage period. - - - Attributes: - budget_amount: - Specification for what amount to use as the budget. - specified_amount: - A specified amount to use as the budget. ``currency_code`` is - optional. If specified, it must match the currency of the - billing account. The ``currency_code`` is provided on output. - last_period_amount: - Use the last period's actual spend as the budget for the - present period. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.BudgetAmount) - ), -) -_sym_db.RegisterMessage(BudgetAmount) - -LastPeriodAmount = _reflection.GeneratedProtocolMessageType( - "LastPeriodAmount", - (_message.Message,), - dict( - DESCRIPTOR=_LASTPERIODAMOUNT, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""Describes a budget amount targeted to last period's spend. - At this time, the amount is automatically 100% of last period's spend; - that is, there are no other options yet. Future configuration will be - described here (for example, configuring a percentage of last period's - spend). - - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.LastPeriodAmount) - ), -) -_sym_db.RegisterMessage(LastPeriodAmount) - -ThresholdRule = _reflection.GeneratedProtocolMessageType( - "ThresholdRule", - (_message.Message,), - dict( - DESCRIPTOR=_THRESHOLDRULE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""ThresholdRule contains a definition of a threshold which - triggers an alert (a notification of a threshold being crossed) to be - sent when spend goes above the specified amount. Alerts are - automatically e-mailed to users with the Billing Account Administrator - role or the Billing Account User role. The thresholds here have no - effect on notifications sent to anything configured under - ``Budget.all_updates_rule``. - - - Attributes: - threshold_percent: - Required. Send an alert when this threshold is exceeded. This - is a 1.0-based percentage, so 0.5 = 50%. Validation: non- - negative number. - spend_basis: - Optional. The type of basis used to determine if spend has - passed the threshold. Behavior defaults to CURRENT\_SPEND if - not set. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ThresholdRule) - ), -) -_sym_db.RegisterMessage(ThresholdRule) - -AllUpdatesRule = _reflection.GeneratedProtocolMessageType( - "AllUpdatesRule", - (_message.Message,), - dict( - DESCRIPTOR=_ALLUPDATESRULE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""AllUpdatesRule defines notifications that are sent on every update to - the billing account's spend, regardless of the thresholds defined using - threshold rules. - - - Attributes: - pubsub_topic: - Required. The name of the Cloud Pub/Sub topic where budget - related messages will be published, in the form - ``projects/{project_id}/topics/{topic_id}``. Updates are sent - at regular intervals to the topic. The topic needs to be - created before the budget is created; see - https://cloud.google.com/billing/docs/how-to/budgets#manage- - notifications for more details. Caller is expected to have - ``pubsub.topics.setIamPolicy`` permission on the topic when - it's set for a budget, otherwise, the API call will fail with - PERMISSION\_DENIED. See - https://cloud.google.com/pubsub/docs/access-control for more - details on Pub/Sub roles and permissions. - schema_version: - Required. The schema version of the notification. Only "1.0" - is accepted. It represents the JSON schema as defined in - https://cloud.google.com/billing/docs/how- - to/budgets#notification\_format - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.AllUpdatesRule) - ), -) -_sym_db.RegisterMessage(AllUpdatesRule) - -Filter = _reflection.GeneratedProtocolMessageType( - "Filter", - (_message.Message,), - dict( - DESCRIPTOR=_FILTER, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_model_pb2", - __doc__="""A filter for a budget, limiting the scope of the cost to - calculate. - - - Attributes: - projects: - Optional. A set of projects of the form - ``projects/{project_id}``, specifying that usage from only - this set of projects should be included in the budget. If - omitted, the report will include all usage for the billing - account, regardless of which project the usage occurred on. - Only zero or one project can be specified currently. - credit_types_treatment: - Optional. If not set, default behavior is - ``INCLUDE_ALL_CREDITS``. - services: - Optional. A set of services of the form - ``services/{service_id}``, specifying that usage from only - this set of services should be included in the budget. If - omitted, the report will include usage for all the services. - The service names are available through the Catalog API: - https://cloud.google.com/billing/v1/how-tos/catalog-api. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.Filter) - ), -) -_sym_db.RegisterMessage(Filter) - - -DESCRIPTOR._options = None -_BUDGET.fields_by_name["name"]._options = None -_BUDGET.fields_by_name["budget_filter"]._options = None -_BUDGET.fields_by_name["amount"]._options = None -_BUDGET.fields_by_name["threshold_rules"]._options = None -_BUDGET.fields_by_name["all_updates_rule"]._options = None -_BUDGET.fields_by_name["etag"]._options = None -_BUDGET._options = None -_THRESHOLDRULE.fields_by_name["threshold_percent"]._options = None -_THRESHOLDRULE.fields_by_name["spend_basis"]._options = None -_ALLUPDATESRULE.fields_by_name["pubsub_topic"]._options = None -_ALLUPDATESRULE.fields_by_name["schema_version"]._options = None -_FILTER.fields_by_name["projects"]._options = None -_FILTER.fields_by_name["credit_types_treatment"]._options = None -_FILTER.fields_by_name["services"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2_grpc.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto deleted file mode 100644 index d5e0f4bc9a5a..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service.proto +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.billing.budgets.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/billing/budgets/v1beta1/budget_model.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets"; -option java_multiple_files = true; -option java_package = "com.google.cloud.billing.budgets.v1beta1"; - -// BudgetService stores Cloud Billing budgets, which define a -// budget plan and rules to execute as we track spend against that plan. -service BudgetService { - option (google.api.default_host) = "billingbudgets.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Creates a new budget. See - // Quotas and limits - // for more information on the limits of the number of budgets you can create. - rpc CreateBudget(CreateBudgetRequest) returns (Budget) { - option (google.api.http) = { - post: "/v1beta1/{parent=billingAccounts/*}/budgets" - body: "*" - }; - } - - // Updates a budget and returns the updated budget. - rpc UpdateBudget(UpdateBudgetRequest) returns (Budget) { - option (google.api.http) = { - patch: "/v1beta1/{budget.name=billingAccounts/*/budgets/*}" - body: "*" - }; - } - - // Returns a budget. - rpc GetBudget(GetBudgetRequest) returns (Budget) { - option (google.api.http) = { - get: "/v1beta1/{name=billingAccounts/*/budgets/*}" - }; - } - - // Returns a list of budgets for a billing account. - rpc ListBudgets(ListBudgetsRequest) returns (ListBudgetsResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=billingAccounts/*}/budgets" - }; - } - - // Deletes a budget. Returns successfully if already deleted. - rpc DeleteBudget(DeleteBudgetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1beta1/{name=billingAccounts/*/budgets/*}" - }; - } -} - -// Request for CreateBudget -message CreateBudgetRequest { - // Required. The name of the billing account to create the budget in. Values - // are of the form `billingAccounts/{billingAccountId}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "billingbudgets.googleapis.com/Budget" - } - ]; - - // Required. Budget to create. - Budget budget = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for UpdateBudget -message UpdateBudgetRequest { - // Required. The updated budget object. - // The budget to update is specified by the budget name in the budget. - Budget budget = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Indicates which fields in the provided budget to update. - // Read-only fields (such as `name`) cannot be changed. If this is not - // provided, then only fields with non-default values from the request are - // updated. See - // https://developers.google.com/protocol-buffers/docs/proto3#default for more - // details about default values. - google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request for GetBudget -message GetBudgetRequest { - // Required. Name of budget to get. Values are of the form - // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "billingbudgets.googleapis.com/Budget" - } - ]; -} - -// Request for ListBudgets -message ListBudgetsRequest { - // Required. Name of billing account to list budgets under. Values - // are of the form `billingAccounts/{billingAccountId}`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "billingbudgets.googleapis.com/Budget" - } - ]; - - // Optional. The maximum number of budgets to return per page. - // The default and maximum value are 100. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value returned by the last `ListBudgetsResponse` which - // indicates that this is a continuation of a prior `ListBudgets` call, - // and that the system should return the next page of data. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for ListBudgets -message ListBudgetsResponse { - // List of the budgets owned by the requested billing account. - repeated Budget budgets = 1; - - // If not empty, indicates that there may be more budgets that match the - // request; this value should be passed in a new `ListBudgetsRequest`. - string next_page_token = 2; -} - -// Request for DeleteBudget -message DeleteBudgetRequest { - // Required. Name of the budget to delete. Values are of the form - // `billingAccounts/{billingAccountId}/budgets/{budgetId}`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "billingbudgets.googleapis.com/Budget" - } - ]; -} diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py deleted file mode 100644 index 37b30941031a..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py +++ /dev/null @@ -1,628 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/billing/budgets_v1beta1/proto/budget_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.billing_budgets_v1beta1.proto import ( - budget_model_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/billing/budgets_v1beta1/proto/budget_service.proto", - package="google.cloud.billing.budgets.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n(com.google.cloud.billing.budgets.v1beta1P\001ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgets" - ), - serialized_pb=_b( - '\n?google/cloud/billing/budgets_v1beta1/proto/budget_service.proto\x12$google.cloud.billing.budgets.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a=google/cloud/billing/budgets_v1beta1/proto/budget_model.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x96\x01\n\x13\x43reateBudgetRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x41\n\x06\x62udget\x18\x02 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02"\x8e\x01\n\x13UpdateBudgetRequest\x12\x41\n\x06\x62udget\x18\x01 \x01(\x0b\x32,.google.cloud.billing.budgets.v1beta1.BudgetB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x01"N\n\x10GetBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget"\x83\x01\n\x12ListBudgetsRequest\x12<\n\x06parent\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\x12$billingbudgets.googleapis.com/Budget\x12\x16\n\tpage_size\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x17\n\npage_token\x18\x03 \x01(\tB\x03\xe0\x41\x01"m\n\x13ListBudgetsResponse\x12=\n\x07\x62udgets\x18\x01 \x03(\x0b\x32,.google.cloud.billing.budgets.v1beta1.Budget\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x13\x44\x65leteBudgetRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$billingbudgets.googleapis.com/Budget2\xc9\x07\n\rBudgetService\x12\xaf\x01\n\x0c\x43reateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.CreateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"6\x82\xd3\xe4\x93\x02\x30"+/v1beta1/{parent=billingAccounts/*}/budgets:\x01*\x12\xb6\x01\n\x0cUpdateBudget\x12\x39.google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"=\x82\xd3\xe4\x93\x02\x37\x32\x32/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\x01*\x12\xa6\x01\n\tGetBudget\x12\x36.google.cloud.billing.budgets.v1beta1.GetBudgetRequest\x1a,.google.cloud.billing.budgets.v1beta1.Budget"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{name=billingAccounts/*/budgets/*}\x12\xb7\x01\n\x0bListBudgets\x12\x38.google.cloud.billing.budgets.v1beta1.ListBudgetsRequest\x1a\x39.google.cloud.billing.budgets.v1beta1.ListBudgetsResponse"3\x82\xd3\xe4\x93\x02-\x12+/v1beta1/{parent=billingAccounts/*}/budgets\x12\x96\x01\n\x0c\x44\x65leteBudget\x12\x39.google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest\x1a\x16.google.protobuf.Empty"3\x82\xd3\xe4\x93\x02-*+/v1beta1/{name=billingAccounts/*/budgets/*}\x1aQ\xca\x41\x1d\x62illingbudgets.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBy\n(com.google.cloud.billing.budgets.v1beta1P\x01ZKgoogle.golang.org/genproto/googleapis/cloud/billing/budgets/v1beta1;budgetsb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATEBUDGETREQUEST = _descriptor.Descriptor( - name="CreateBudgetRequest", - full_name="google.cloud.billing.budgets.v1beta1.CreateBudgetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.billing.budgets.v1beta1.CreateBudgetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\022$billingbudgets.googleapis.com/Budget" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="budget", - full_name="google.cloud.billing.budgets.v1beta1.CreateBudgetRequest.budget", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=347, - serialized_end=497, -) - - -_UPDATEBUDGETREQUEST = _descriptor.Descriptor( - name="UpdateBudgetRequest", - full_name="google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="budget", - full_name="google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest.budget", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=500, - serialized_end=642, -) - - -_GETBUDGETREQUEST = _descriptor.Descriptor( - name="GetBudgetRequest", - full_name="google.cloud.billing.budgets.v1beta1.GetBudgetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.billing.budgets.v1beta1.GetBudgetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$billingbudgets.googleapis.com/Budget" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=644, - serialized_end=722, -) - - -_LISTBUDGETSREQUEST = _descriptor.Descriptor( - name="ListBudgetsRequest", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\022$billingbudgets.googleapis.com/Budget" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=725, - serialized_end=856, -) - - -_LISTBUDGETSRESPONSE = _descriptor.Descriptor( - name="ListBudgetsResponse", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="budgets", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsResponse.budgets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.billing.budgets.v1beta1.ListBudgetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=858, - serialized_end=967, -) - - -_DELETEBUDGETREQUEST = _descriptor.Descriptor( - name="DeleteBudgetRequest", - full_name="google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$billingbudgets.googleapis.com/Budget" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=969, - serialized_end=1050, -) - -_CREATEBUDGETREQUEST.fields_by_name[ - "budget" -].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET -) -_UPDATEBUDGETREQUEST.fields_by_name[ - "budget" -].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET -) -_UPDATEBUDGETREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTBUDGETSRESPONSE.fields_by_name[ - "budgets" -].message_type = ( - google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET -) -DESCRIPTOR.message_types_by_name["CreateBudgetRequest"] = _CREATEBUDGETREQUEST -DESCRIPTOR.message_types_by_name["UpdateBudgetRequest"] = _UPDATEBUDGETREQUEST -DESCRIPTOR.message_types_by_name["GetBudgetRequest"] = _GETBUDGETREQUEST -DESCRIPTOR.message_types_by_name["ListBudgetsRequest"] = _LISTBUDGETSREQUEST -DESCRIPTOR.message_types_by_name["ListBudgetsResponse"] = _LISTBUDGETSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteBudgetRequest"] = _DELETEBUDGETREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateBudgetRequest = _reflection.GeneratedProtocolMessageType( - "CreateBudgetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for CreateBudget - - - Attributes: - parent: - Required. The name of the billing account to create the budget - in. Values are of the form - ``billingAccounts/{billingAccountId}``. - budget: - Required. Budget to create. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.CreateBudgetRequest) - ), -) -_sym_db.RegisterMessage(CreateBudgetRequest) - -UpdateBudgetRequest = _reflection.GeneratedProtocolMessageType( - "UpdateBudgetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for UpdateBudget - - - Attributes: - budget: - Required. The updated budget object. The budget to update is - specified by the budget name in the budget. - update_mask: - Optional. Indicates which fields in the provided budget to - update. Read-only fields (such as ``name``) cannot be changed. - If this is not provided, then only fields with non-default - values from the request are updated. See - https://developers.google.com/protocol- - buffers/docs/proto3#default for more details about default - values. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.UpdateBudgetRequest) - ), -) -_sym_db.RegisterMessage(UpdateBudgetRequest) - -GetBudgetRequest = _reflection.GeneratedProtocolMessageType( - "GetBudgetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for GetBudget - - - Attributes: - name: - Required. Name of budget to get. Values are of the form - ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.GetBudgetRequest) - ), -) -_sym_db.RegisterMessage(GetBudgetRequest) - -ListBudgetsRequest = _reflection.GeneratedProtocolMessageType( - "ListBudgetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUDGETSREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for ListBudgets - - - Attributes: - parent: - Required. Name of billing account to list budgets under. - Values are of the form ``billingAccounts/{billingAccountId}``. - page_size: - Optional. The maximum number of budgets to return per page. - The default and maximum value are 100. - page_token: - Optional. The value returned by the last - ``ListBudgetsResponse`` which indicates that this is a - continuation of a prior ``ListBudgets`` call, and that the - system should return the next page of data. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ListBudgetsRequest) - ), -) -_sym_db.RegisterMessage(ListBudgetsRequest) - -ListBudgetsResponse = _reflection.GeneratedProtocolMessageType( - "ListBudgetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTBUDGETSRESPONSE, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Response for ListBudgets - - - Attributes: - budgets: - List of the budgets owned by the requested billing account. - next_page_token: - If not empty, indicates that there may be more budgets that - match the request; this value should be passed in a new - ``ListBudgetsRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.ListBudgetsResponse) - ), -) -_sym_db.RegisterMessage(ListBudgetsResponse) - -DeleteBudgetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteBudgetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEBUDGETREQUEST, - __module__="google.cloud.billing.budgets_v1beta1.proto.budget_service_pb2", - __doc__="""Request for DeleteBudget - - - Attributes: - name: - Required. Name of the budget to delete. Values are of the form - ``billingAccounts/{billingAccountId}/budgets/{budgetId}``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.billing.budgets.v1beta1.DeleteBudgetRequest) - ), -) -_sym_db.RegisterMessage(DeleteBudgetRequest) - - -DESCRIPTOR._options = None -_CREATEBUDGETREQUEST.fields_by_name["parent"]._options = None -_CREATEBUDGETREQUEST.fields_by_name["budget"]._options = None -_UPDATEBUDGETREQUEST.fields_by_name["budget"]._options = None -_UPDATEBUDGETREQUEST.fields_by_name["update_mask"]._options = None -_GETBUDGETREQUEST.fields_by_name["name"]._options = None -_LISTBUDGETSREQUEST.fields_by_name["parent"]._options = None -_LISTBUDGETSREQUEST.fields_by_name["page_size"]._options = None -_LISTBUDGETSREQUEST.fields_by_name["page_token"]._options = None -_DELETEBUDGETREQUEST.fields_by_name["name"]._options = None - -_BUDGETSERVICE = _descriptor.ServiceDescriptor( - name="BudgetService", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\035billingbudgets.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=1053, - serialized_end=2022, - methods=[ - _descriptor.MethodDescriptor( - name="CreateBudget", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService.CreateBudget", - index=0, - containing_service=None, - input_type=_CREATEBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - '\202\323\344\223\0020"+/v1beta1/{parent=billingAccounts/*}/budgets:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateBudget", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService.UpdateBudget", - index=1, - containing_service=None, - input_type=_UPDATEBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - "\202\323\344\223\002722/v1beta1/{budget.name=billingAccounts/*/budgets/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="GetBudget", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService.GetBudget", - index=2, - containing_service=None, - input_type=_GETBUDGETREQUEST, - output_type=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2._BUDGET, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{name=billingAccounts/*/budgets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListBudgets", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService.ListBudgets", - index=3, - containing_service=None, - input_type=_LISTBUDGETSREQUEST, - output_type=_LISTBUDGETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1beta1/{parent=billingAccounts/*}/budgets" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteBudget", - full_name="google.cloud.billing.budgets.v1beta1.BudgetService.DeleteBudget", - index=4, - containing_service=None, - input_type=_DELETEBUDGETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002-*+/v1beta1/{name=billingAccounts/*/budgets/*}" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_BUDGETSERVICE) - -DESCRIPTOR.services_by_name["BudgetService"] = _BUDGETSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py deleted file mode 100644 index 3cddb5843873..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py +++ /dev/null @@ -1,125 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.billing_budgets_v1beta1.proto import ( - budget_model_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2, -) -from google.cloud.billing_budgets_v1beta1.proto import ( - budget_service_pb2 as google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class BudgetServiceStub(object): - """BudgetService stores Cloud Billing budgets, which define a - budget plan and rules to execute as we track spend against that plan. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateBudget = channel.unary_unary( - "/google.cloud.billing.budgets.v1beta1.BudgetService/CreateBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, - ) - self.UpdateBudget = channel.unary_unary( - "/google.cloud.billing.budgets.v1beta1.BudgetService/UpdateBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, - ) - self.GetBudget = channel.unary_unary( - "/google.cloud.billing.budgets.v1beta1.BudgetService/GetBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.FromString, - ) - self.ListBudgets = channel.unary_unary( - "/google.cloud.billing.budgets.v1beta1.BudgetService/ListBudgets", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.FromString, - ) - self.DeleteBudget = channel.unary_unary( - "/google.cloud.billing.budgets.v1beta1.BudgetService/DeleteBudget", - request_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - - -class BudgetServiceServicer(object): - """BudgetService stores Cloud Billing budgets, which define a - budget plan and rules to execute as we track spend against that plan. - """ - - def CreateBudget(self, request, context): - """Creates a new budget. See - Quotas and limits - for more information on the limits of the number of budgets you can create. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateBudget(self, request, context): - """Updates a budget and returns the updated budget. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetBudget(self, request, context): - """Returns a budget. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListBudgets(self, request, context): - """Returns a list of budgets for a billing account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteBudget(self, request, context): - """Deletes a budget. Returns successfully if already deleted. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_BudgetServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateBudget": grpc.unary_unary_rpc_method_handler( - servicer.CreateBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.CreateBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, - ), - "UpdateBudget": grpc.unary_unary_rpc_method_handler( - servicer.UpdateBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.UpdateBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, - ), - "GetBudget": grpc.unary_unary_rpc_method_handler( - servicer.GetBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.GetBudgetRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__model__pb2.Budget.SerializeToString, - ), - "ListBudgets": grpc.unary_unary_rpc_method_handler( - servicer.ListBudgets, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsRequest.FromString, - response_serializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.ListBudgetsResponse.SerializeToString, - ), - "DeleteBudget": grpc.unary_unary_rpc_method_handler( - servicer.DeleteBudget, - request_deserializer=google_dot_cloud_dot_billing_dot_budgets__v1beta1_dot_proto_dot_budget__service__pb2.DeleteBudgetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.billing.budgets.v1beta1.BudgetService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/billingbudgets/google/cloud/billing_budgets_v1beta1/types.py b/billingbudgets/google/cloud/billing_budgets_v1beta1/types.py deleted file mode 100644 index 6496b805c829..000000000000 --- a/billingbudgets/google/cloud/billing_budgets_v1beta1/types.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.billing_budgets_v1beta1.proto import budget_model_pb2 -from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.type import money_pb2 - - -_shared_modules = [empty_pb2, field_mask_pb2, money_pb2] - -_local_modules = [budget_model_pb2, budget_service_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.billing_budgets_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/billingbudgets/noxfile.py b/billingbudgets/noxfile.py deleted file mode 100644 index 74dba69dbeeb..000000000000 --- a/billingbudgets/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=72") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/billingbudgets/setup.cfg b/billingbudgets/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/billingbudgets/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/billingbudgets/setup.py b/billingbudgets/setup.py deleted file mode 100644 index ec56b4976016..000000000000 --- a/billingbudgets/setup.py +++ /dev/null @@ -1,75 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -import io -import os - -import setuptools - - -name = "google-cloud-billing-budgets" -description = "Cloud Billing Budget API API client library" -version = "0.2.0" -release_status = "Development Status :: 3 - Beta" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/googleapis/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.4", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - include_package_data=True, - zip_safe=False, -) diff --git a/billingbudgets/synth.metadata b/billingbudgets/synth.metadata deleted file mode 100644 index 98bbfd8447b1..000000000000 --- a/billingbudgets/synth.metadata +++ /dev/null @@ -1,159 +0,0 @@ -{ - "updateTime": "2020-01-29T13:18:37.536635Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cf3b61102ed5f36b827bc82ec39be09525f018c8", - "internalRef": "292034635", - "log": "cf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n08b488e0660c59842a7dee0e3e2b65d9e3a514a9\nExposing cloud_catalog.proto (This API is already available through REST)\n\nPiperOrigin-RevId: 288625007\n\na613482977e11ac09fa47687a5d1b5a01efcf794\nUpdate the OS Login v1beta API description to render better in the UI.\n\nPiperOrigin-RevId: 288547940\n\n5e182b8d9943f1b17008d69d4c7e865dc83641a7\nUpdate the OS Login API description to render better in the UI.\n\nPiperOrigin-RevId: 288546443\n\ncb79155f596e0396dd900da93872be7066f6340d\nFix: Add a resource annotation for Agent\nFix: Correct the service name in annotations for Intent and SessionEntityType\n\nPiperOrigin-RevId: 288441307\n\nf7f6e9daec3315fd47cb638789bd8415bf4a27cc\nAdded cloud asset api v1p1beta1\n\nPiperOrigin-RevId: 288427239\n\nf2880f5b342c6345f3dcaad24fcb3c6ca9483654\nBilling account API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 288351810\n\ndc250ffe071729f8f8bef9d6fd0fbbeb0254c666\nFix: Remove incorrect resource annotations in requests\n\nPiperOrigin-RevId: 288321208\n\n91ef2d9dd69807b0b79555f22566fb2d81e49ff9\nAdd GAPIC annotations to Cloud KMS (but do not migrate the GAPIC config yet).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 287999179\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "billingbudgets", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/billing/budgets/artman_billingbudgets_v1beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/billing_budgets.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/__init__.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/budget_service_client.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/budget_service_client_config.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/gapic/transports/budget_service_grpc_transport.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_model.proto" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_model_pb2_grpc.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_service.proto" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/proto/budget_service_pb2_grpc.py" - }, - { - "path": "google/cloud/billing_budgets_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_budget_service_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/billingbudgets/synth.py b/billingbudgets/synth.py deleted file mode 100644 index 751501cd8543..000000000000 --- a/billingbudgets/synth.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2019 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import logging - -logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate billing budgets GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - "billingbudgets", - "v1beta1", - config_path="/google/cloud/billing/budgets/artman_billingbudgets_v1beta1.yaml", - include_protos=True, -) - -excludes = [ - "nox.py", - "setup.py", - "README.rst", - library / "docs/index.rst", - library - / "google/cloud/billingbudgets_v1beta1/proto", # proto files are copied to the wrong place -] - -s.move(library, excludes=excludes) -s.move( - library / "google/cloud/billingbudgets_v1beta1/proto/*.proto", - "google/cloud/billing_budgets_v1beta1/proto", -) - -# Fix namespace -s.replace( - "**/*.py", - "from google\.cloud\.billing\.budgets_v1beta1", - "from google.cloud.billing_budgets_v1beta1", -) - -# Fix package name -s.replace( - ["**/*.rst", "setup.py", "*/**/*.py"], - "google-cloud-billingbudgets", - "google-cloud-billing-budgets", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=72, cov_level=72) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/billingbudgets/tests/unit/gapic/v1beta1/test_budget_service_client_v1beta1.py b/billingbudgets/tests/unit/gapic/v1beta1/test_budget_service_client_v1beta1.py deleted file mode 100644 index 8fa8bc5fcd1d..000000000000 --- a/billingbudgets/tests/unit/gapic/v1beta1/test_budget_service_client_v1beta1.py +++ /dev/null @@ -1,261 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import billing_budgets_v1beta1 -from google.cloud.billing_budgets_v1beta1.proto import budget_model_pb2 -from google.cloud.billing_budgets_v1beta1.proto import budget_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestBudgetServiceClient(object): - def test_create_budget(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - etag = "etag3123477" - expected_response = {"name": name, "display_name": display_name, "etag": etag} - expected_response = budget_model_pb2.Budget(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup Request - parent = client.billing_account_path("[BILLING_ACCOUNT]") - budget = {} - - response = client.create_budget(parent, budget) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = budget_service_pb2.CreateBudgetRequest( - parent=parent, budget=budget - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_budget_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup request - parent = client.billing_account_path("[BILLING_ACCOUNT]") - budget = {} - - with pytest.raises(CustomException): - client.create_budget(parent, budget) - - def test_update_budget(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - etag = "etag3123477" - expected_response = {"name": name, "display_name": display_name, "etag": etag} - expected_response = budget_model_pb2.Budget(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup Request - budget = {} - - response = client.update_budget(budget) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = budget_service_pb2.UpdateBudgetRequest(budget=budget) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_budget_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup request - budget = {} - - with pytest.raises(CustomException): - client.update_budget(budget) - - def test_get_budget(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - etag = "etag3123477" - expected_response = {"name": name_2, "display_name": display_name, "etag": etag} - expected_response = budget_model_pb2.Budget(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup Request - name = client.budget_path("[BILLING_ACCOUNT]", "[BUDGET]") - - response = client.get_budget(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = budget_service_pb2.GetBudgetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_budget_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup request - name = client.budget_path("[BILLING_ACCOUNT]", "[BUDGET]") - - with pytest.raises(CustomException): - client.get_budget(name) - - def test_list_budgets(self): - # Setup Expected Response - next_page_token = "" - budgets_element = {} - budgets = [budgets_element] - expected_response = {"next_page_token": next_page_token, "budgets": budgets} - expected_response = budget_service_pb2.ListBudgetsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup Request - parent = client.billing_account_path("[BILLING_ACCOUNT]") - - paged_list_response = client.list_budgets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.budgets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = budget_service_pb2.ListBudgetsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_budgets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup request - parent = client.billing_account_path("[BILLING_ACCOUNT]") - - paged_list_response = client.list_budgets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_budget(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup Request - name = client.budget_path("[BILLING_ACCOUNT]", "[BUDGET]") - - client.delete_budget(name) - - assert len(channel.requests) == 1 - expected_request = budget_service_pb2.DeleteBudgetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_budget_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = billing_budgets_v1beta1.BudgetServiceClient() - - # Setup request - name = client.budget_path("[BILLING_ACCOUNT]", "[BUDGET]") - - with pytest.raises(CustomException): - client.delete_budget(name) diff --git a/iam/.coveragerc b/iam/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/iam/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/iam/.flake8 b/iam/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/iam/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/iam/.repo-metadata.json b/iam/.repo-metadata.json deleted file mode 100644 index 158d56068de5..000000000000 --- a/iam/.repo-metadata.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "iamcredentials", - "name_pretty": "Cloud Identity and Access Management", - "product_documentation": "https://cloud.google.com/iam/docs/", - "client_documentation": "https://googleapis.dev/python/iamcredentials/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559761", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-iam", - "api_id": "iamcredentials.googleapis.com" -} \ No newline at end of file diff --git a/iam/CHANGELOG.md b/iam/CHANGELOG.md deleted file mode 100644 index a8ec84203fcc..000000000000 --- a/iam/CHANGELOG.md +++ /dev/null @@ -1,73 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-iam/#history - -## 0.2.1 - -08-23-2019 10:10 PDT - -### Implementation Changes -- Remove send/recv msg size limit (via synth). ([#8936](https://github.com/googleapis/google-cloud-python/pull/8936)) - -### Documentation -- Fix documentation links for iam and error-reporting. ([#9073](https://github.com/googleapis/google-cloud-python/pull/9073)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.2.0 - -07-24-2019 16:22 PDT - - -### Implementation Changes -- Remove generate_identity_binding_access_token (via synth). ([#8486](https://github.com/googleapis/google-cloud-python/pull/8486)) -- Allow kwargs to be passed to create_channel (via synth). ([#8392](https://github.com/googleapis/google-cloud-python/pull/8392)) -- Add routing header to method metadata, format docstrings, update docs configuration (via synth). ([#7595](https://github.com/googleapis/google-cloud-python/pull/7595)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Remove unused message exports. ([#7268](https://github.com/googleapis/google-cloud-python/pull/7268)) -- Protoc-generated serialization update. ([#7084](https://github.com/googleapis/google-cloud-python/pull/7084)) -- Protoc-generated serialization update. ([#7052](https://github.com/googleapis/google-cloud-python/pull/7052)) -- Pick up stub docstring fix in GAPIC generator. ([#6972](https://github.com/googleapis/google-cloud-python/pull/6972)) - -### New Features -- Add 'client_options' support (via synth). ([#8511](https://github.com/googleapis/google-cloud-python/pull/8511)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Fix client lib docs link in README. ([#7813](https://github.com/googleapis/google-cloud-python/pull/7813)) -- Update copyright: 2018 -> 2019. ([#7146](https://github.com/googleapis/google-cloud-python/pull/7146)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8584](https://github.com/googleapis/google-cloud-python/pull/8584)) -- Add nox session 'docs' to remaining manual clients. ([#8478](https://github.com/googleapis/google-cloud-python/pull/8478)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). [#8353](https://github.com/googleapis/google-cloud-python/pull/8353)) -- Add disclaimer to auto-generated template files (via synth). ([#8315](https://github.com/googleapis/google-cloud-python/pull/8315)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8242](https://github.com/googleapis/google-cloud-python/pull/8242)) -- Fix coverage in 'types.py' (via synth). ([#8154](https://github.com/googleapis/google-cloud-python/pull/8154)) -- Blacken noxfile.py, setup.py (via synth). ([#8124](https://github.com/googleapis/google-cloud-python/pull/8124)) -- Add empty lines (via synth). ([#8059](https://github.com/googleapis/google-cloud-python/pull/8059)) -- Add nox session `docs` (via synth). ([#7772](https://github.com/googleapis/google-cloud-python/pull/7772)) -- Copy lintified proto files (via synth). ([#7467](https://github.com/googleapis/google-cloud-python/pull/7467)) -- Add clarifying comment to blacken nox target. ([#7393](https://github.com/googleapis/google-cloud-python/pull/7393)) -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.1.0 - -12-13-2018 10:55 PST - - -### New Features -- Add Client Library for IAM ([#6905](https://github.com/googleapis/google-cloud-python/pull/6905)) - -### Documentation -- Fix docs build ([#6913](https://github.com/googleapis/google-cloud-python/pull/6913)) - -### Internal / Testing Changes -- trove classifier fix ([#6922](https://github.com/googleapis/google-cloud-python/pull/6922)) diff --git a/iam/LICENSE b/iam/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/iam/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/iam/MANIFEST.in b/iam/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/iam/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/iam/README.rst b/iam/README.rst deleted file mode 100644 index 6f439c39a1f2..000000000000 --- a/iam/README.rst +++ /dev/null @@ -1,85 +0,0 @@ -Python Client for IAM API (`Alpha`_) -================================================================ - - - -`IAM API`_: IAM API - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/googleapis/google-cloud-python/blob/master/README.rst -.. _IAM API: https://cloud.google.com/iam -.. _Client Library Documentation: https://googleapis.dev/python/iamcredentials/latest -.. _Product Documentation: https://cloud.google.com/iam - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the IAM API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the IAM API.: https://console.cloud.google.com/flows/enableapi?apiid=iam -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-iam - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-iam - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for IAM API - API to see other available methods on the client. -- Read the `IAM API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _IAM API Product documentation: https://cloud.google.com/iam -.. _repository’s main README: https://github.com/googleapis/google-cloud-python/blob/master/README.rst diff --git a/iam/docs/README.rst b/iam/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/iam/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/iam/docs/_static/custom.css b/iam/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/iam/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/iam/docs/_templates/layout.html b/iam/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/iam/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/iam/docs/changelog.md b/iam/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/iam/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/iam/docs/conf.py b/iam/docs/conf.py deleted file mode 100644 index 92b55f389033..000000000000 --- a/iam/docs/conf.py +++ /dev/null @@ -1,357 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-iam documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-iam" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-iam-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-iam.tex", - u"google-cloud-iam Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "google-cloud-iam", u"google-cloud-iam Documentation", [author], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-iam", - u"google-cloud-iam Documentation", - author, - "google-cloud-iam", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/iam/docs/gapic/v1/api.rst b/iam/docs/gapic/v1/api.rst deleted file mode 100644 index 898390081ea9..000000000000 --- a/iam/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for IAM Service Account Credentials API -============================================== - -.. automodule:: google.cloud.iam_credentials_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/iam/docs/gapic/v1/types.rst b/iam/docs/gapic/v1/types.rst deleted file mode 100644 index a80cc353174d..000000000000 --- a/iam/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for IAM Service Account Credentials API Client -==================================================== - -.. automodule:: google.cloud.iam_credentials_v1.types - :members: \ No newline at end of file diff --git a/iam/docs/index.rst b/iam/docs/index.rst deleted file mode 100644 index 882915fa7d73..000000000000 --- a/iam/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: README.rst - -API Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - - -Changelog ---------- - -For a list of all ``google-cloud-iam`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/iam/google/__init__.py b/iam/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/iam/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/iam/google/cloud/__init__.py b/iam/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/iam/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/iam/google/cloud/iam_credentials.py b/iam/google/cloud/iam_credentials.py deleted file mode 100644 index ac6ae35a9642..000000000000 --- a/iam/google/cloud/iam_credentials.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.iam_credentials_v1 import IAMCredentialsClient -from google.cloud.iam_credentials_v1 import types - - -__all__ = ("types", "IAMCredentialsClient") diff --git a/iam/google/cloud/iam_credentials_v1/__init__.py b/iam/google/cloud/iam_credentials_v1/__init__.py deleted file mode 100644 index ba52c484a5bc..000000000000 --- a/iam/google/cloud/iam_credentials_v1/__init__.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.iam_credentials_v1 import types -from google.cloud.iam_credentials_v1.gapic import iam_credentials_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class IAMCredentialsClient(iam_credentials_client.IAMCredentialsClient): - __doc__ = iam_credentials_client.IAMCredentialsClient.__doc__ - - -__all__ = ("types", "IAMCredentialsClient") diff --git a/iam/google/cloud/iam_credentials_v1/gapic/__init__.py b/iam/google/cloud/iam_credentials_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py b/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py deleted file mode 100644 index 858118592970..000000000000 --- a/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py +++ /dev/null @@ -1,590 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.iam.credentials.v1 IAMCredentials API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.path_template -import grpc - -from google.cloud.iam_credentials_v1.gapic import iam_credentials_client_config -from google.cloud.iam_credentials_v1.gapic.transports import ( - iam_credentials_grpc_transport, -) -from google.cloud.iam_credentials_v1.proto import common_pb2 -from google.cloud.iam_credentials_v1.proto import iamcredentials_pb2_grpc -from google.protobuf import duration_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-iam").version - - -class IAMCredentialsClient(object): - """ - A service account is a special type of Google account that belongs to your - application or a virtual machine (VM), instead of to an individual end user. - Your application assumes the identity of the service account to call Google - APIs, so that the users aren't directly involved. - - Service account credentials are used to temporarily assume the identity - of the service account. Supported credential types include OAuth 2.0 access - tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - more. - """ - - SERVICE_ADDRESS = "iamcredentials.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.iam.credentials.v1.IAMCredentials" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - IAMCredentialsClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def service_account_path(cls, project, service_account): - """Return a fully-qualified service_account string.""" - return google.api_core.path_template.expand( - "projects/{project}/serviceAccounts/{service_account}", - project=project, - service_account=service_account, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.IamCredentialsGrpcTransport, - Callable[[~.Credentials, type], ~.IamCredentialsGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = iam_credentials_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=iam_credentials_grpc_transport.IamCredentialsGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = iam_credentials_grpc_transport.IamCredentialsGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def generate_access_token( - self, - name, - scope, - delegates=None, - lifetime=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Generates an OAuth 2.0 access token for a service account. - - Example: - >>> from google.cloud import iam_credentials_v1 - >>> - >>> client = iam_credentials_v1.IAMCredentialsClient() - >>> - >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]') - >>> - >>> # TODO: Initialize `scope`: - >>> scope = [] - >>> - >>> response = client.generate_access_token(name, scope) - - Args: - name (str): Required. The resource name of the service account for which the - credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - scope (list[str]): Required. Code to identify the scopes to be included in the OAuth 2.0 access token. - See https://developers.google.com/identity/protocols/googlescopes for more - information. - At least one value required. - delegates (list[str]): The sequence of service accounts in a delegation chain. Each service - account must be granted the ``roles/iam.serviceAccountTokenCreator`` - role on its next service account in the chain. The last service account - in the chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service account - that is specified in the ``name`` field of the request. - - The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - lifetime (Union[dict, ~google.cloud.iam_credentials_v1.types.Duration]): The desired lifetime duration of the access token in seconds. - Must be set to a value less than or equal to 3600 (1 hour). If a value is - not specified, the token's lifetime will be set to a default value of one - hour. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.iam_credentials_v1.types.Duration` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iam_credentials_v1.types.GenerateAccessTokenResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "generate_access_token" not in self._inner_api_calls: - self._inner_api_calls[ - "generate_access_token" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.generate_access_token, - default_retry=self._method_configs["GenerateAccessToken"].retry, - default_timeout=self._method_configs["GenerateAccessToken"].timeout, - client_info=self._client_info, - ) - - request = common_pb2.GenerateAccessTokenRequest( - name=name, scope=scope, delegates=delegates, lifetime=lifetime - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["generate_access_token"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def generate_id_token( - self, - name, - audience, - delegates=None, - include_email=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Generates an OpenID Connect ID token for a service account. - - Example: - >>> from google.cloud import iam_credentials_v1 - >>> - >>> client = iam_credentials_v1.IAMCredentialsClient() - >>> - >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]') - >>> - >>> # TODO: Initialize `audience`: - >>> audience = '' - >>> - >>> response = client.generate_id_token(name, audience) - - Args: - name (str): Required. The resource name of the service account for which the - credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - audience (str): Required. The audience for the token, such as the API or account that this token - grants access to. - delegates (list[str]): The sequence of service accounts in a delegation chain. Each service - account must be granted the ``roles/iam.serviceAccountTokenCreator`` - role on its next service account in the chain. The last service account - in the chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service account - that is specified in the ``name`` field of the request. - - The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - include_email (bool): Include the service account email in the token. If set to ``true``, the - token will contain ``email`` and ``email_verified`` claims. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iam_credentials_v1.types.GenerateIdTokenResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "generate_id_token" not in self._inner_api_calls: - self._inner_api_calls[ - "generate_id_token" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.generate_id_token, - default_retry=self._method_configs["GenerateIdToken"].retry, - default_timeout=self._method_configs["GenerateIdToken"].timeout, - client_info=self._client_info, - ) - - request = common_pb2.GenerateIdTokenRequest( - name=name, - audience=audience, - delegates=delegates, - include_email=include_email, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["generate_id_token"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def sign_blob( - self, - name, - payload, - delegates=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Signs a blob using a service account's system-managed private key. - - Example: - >>> from google.cloud import iam_credentials_v1 - >>> - >>> client = iam_credentials_v1.IAMCredentialsClient() - >>> - >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]') - >>> - >>> # TODO: Initialize `payload`: - >>> payload = b'' - >>> - >>> response = client.sign_blob(name, payload) - - Args: - name (str): Required. The resource name of the service account for which the - credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - payload (bytes): Required. The bytes to sign. - delegates (list[str]): The sequence of service accounts in a delegation chain. Each service - account must be granted the ``roles/iam.serviceAccountTokenCreator`` - role on its next service account in the chain. The last service account - in the chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service account - that is specified in the ``name`` field of the request. - - The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iam_credentials_v1.types.SignBlobResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "sign_blob" not in self._inner_api_calls: - self._inner_api_calls[ - "sign_blob" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.sign_blob, - default_retry=self._method_configs["SignBlob"].retry, - default_timeout=self._method_configs["SignBlob"].timeout, - client_info=self._client_info, - ) - - request = common_pb2.SignBlobRequest( - name=name, payload=payload, delegates=delegates - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["sign_blob"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def sign_jwt( - self, - name, - payload, - delegates=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Signs a JWT using a service account's system-managed private key. - - Example: - >>> from google.cloud import iam_credentials_v1 - >>> - >>> client = iam_credentials_v1.IAMCredentialsClient() - >>> - >>> name = client.service_account_path('[PROJECT]', '[SERVICE_ACCOUNT]') - >>> - >>> # TODO: Initialize `payload`: - >>> payload = '' - >>> - >>> response = client.sign_jwt(name, payload) - - Args: - name (str): Required. The resource name of the service account for which the - credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - payload (str): Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. - delegates (list[str]): The sequence of service accounts in a delegation chain. Each service - account must be granted the ``roles/iam.serviceAccountTokenCreator`` - role on its next service account in the chain. The last service account - in the chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service account - that is specified in the ``name`` field of the request. - - The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. The ``-`` - wildcard character is required; replacing it with a project ID is - invalid. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iam_credentials_v1.types.SignJwtResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "sign_jwt" not in self._inner_api_calls: - self._inner_api_calls[ - "sign_jwt" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.sign_jwt, - default_retry=self._method_configs["SignJwt"].retry, - default_timeout=self._method_configs["SignJwt"].timeout, - client_info=self._client_info, - ) - - request = common_pb2.SignJwtRequest( - name=name, payload=payload, delegates=delegates - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["sign_jwt"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client_config.py b/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client_config.py deleted file mode 100644 index 35c007ca367f..000000000000 --- a/iam/google/cloud/iam_credentials_v1/gapic/iam_credentials_client_config.py +++ /dev/null @@ -1,43 +0,0 @@ -config = { - "interfaces": { - "google.iam.credentials.v1.IAMCredentials": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "GenerateAccessToken": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GenerateIdToken": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SignBlob": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SignJwt": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/iam/google/cloud/iam_credentials_v1/gapic/transports/__init__.py b/iam/google/cloud/iam_credentials_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/iam/google/cloud/iam_credentials_v1/gapic/transports/iam_credentials_grpc_transport.py b/iam/google/cloud/iam_credentials_v1/gapic/transports/iam_credentials_grpc_transport.py deleted file mode 100644 index 39be27f30619..000000000000 --- a/iam/google/cloud/iam_credentials_v1/gapic/transports/iam_credentials_grpc_transport.py +++ /dev/null @@ -1,163 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.iam_credentials_v1.proto import iamcredentials_pb2_grpc - - -class IamCredentialsGrpcTransport(object): - """gRPC transport class providing stubs for - google.iam.credentials.v1 IAMCredentials API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="iamcredentials.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "iam_credentials_stub": iamcredentials_pb2_grpc.IAMCredentialsStub(channel) - } - - @classmethod - def create_channel( - cls, address="iamcredentials.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def generate_access_token(self): - """Return the gRPC stub for :meth:`IAMCredentialsClient.generate_access_token`. - - Generates an OAuth 2.0 access token for a service account. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_credentials_stub"].GenerateAccessToken - - @property - def generate_id_token(self): - """Return the gRPC stub for :meth:`IAMCredentialsClient.generate_id_token`. - - Generates an OpenID Connect ID token for a service account. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_credentials_stub"].GenerateIdToken - - @property - def sign_blob(self): - """Return the gRPC stub for :meth:`IAMCredentialsClient.sign_blob`. - - Signs a blob using a service account's system-managed private key. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_credentials_stub"].SignBlob - - @property - def sign_jwt(self): - """Return the gRPC stub for :meth:`IAMCredentialsClient.sign_jwt`. - - Signs a JWT using a service account's system-managed private key. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_credentials_stub"].SignJwt diff --git a/iam/google/cloud/iam_credentials_v1/proto/__init__.py b/iam/google/cloud/iam_credentials_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/iam/google/cloud/iam_credentials_v1/proto/common.proto b/iam/google/cloud/iam_credentials_v1/proto/common.proto deleted file mode 100644 index 361f2e90caf8..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/common.proto +++ /dev/null @@ -1,189 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.iam.credentials.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials"; -option java_multiple_files = true; -option java_outer_classname = "IAMCredentialsCommonProto"; -option java_package = "com.google.cloud.iam.credentials.v1"; -option (google.api.resource_definition) = { - type: "iam.googleapis.com/ServiceAccount" - pattern: "projects/{project}/serviceAccounts/{service_account}" -}; - -message GenerateAccessTokenRequest { - // Required. The resource name of the service account for which the credentials - // are requested, in the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/ServiceAccount" - } - ]; - - // The sequence of service accounts in a delegation chain. Each service - // account must be granted the `roles/iam.serviceAccountTokenCreator` role - // on its next service account in the chain. The last service account in the - // chain must be granted the `roles/iam.serviceAccountTokenCreator` role - // on the service account that is specified in the `name` field of the - // request. - // - // The delegates must have the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - repeated string delegates = 2; - - // Required. Code to identify the scopes to be included in the OAuth 2.0 access token. - // See https://developers.google.com/identity/protocols/googlescopes for more - // information. - // At least one value required. - repeated string scope = 4 [(google.api.field_behavior) = REQUIRED]; - - // The desired lifetime duration of the access token in seconds. - // Must be set to a value less than or equal to 3600 (1 hour). If a value is - // not specified, the token's lifetime will be set to a default value of one - // hour. - google.protobuf.Duration lifetime = 7; -} - -message GenerateAccessTokenResponse { - // The OAuth 2.0 access token. - string access_token = 1; - - // Token expiration time. - // The expiration time is always set. - google.protobuf.Timestamp expire_time = 3; -} - -message SignBlobRequest { - // Required. The resource name of the service account for which the credentials - // are requested, in the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/ServiceAccount" - } - ]; - - // The sequence of service accounts in a delegation chain. Each service - // account must be granted the `roles/iam.serviceAccountTokenCreator` role - // on its next service account in the chain. The last service account in the - // chain must be granted the `roles/iam.serviceAccountTokenCreator` role - // on the service account that is specified in the `name` field of the - // request. - // - // The delegates must have the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - repeated string delegates = 3; - - // Required. The bytes to sign. - bytes payload = 5 [(google.api.field_behavior) = REQUIRED]; -} - -message SignBlobResponse { - // The ID of the key used to sign the blob. - string key_id = 1; - - // The signed blob. - bytes signed_blob = 4; -} - -message SignJwtRequest { - // Required. The resource name of the service account for which the credentials - // are requested, in the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/ServiceAccount" - } - ]; - - // The sequence of service accounts in a delegation chain. Each service - // account must be granted the `roles/iam.serviceAccountTokenCreator` role - // on its next service account in the chain. The last service account in the - // chain must be granted the `roles/iam.serviceAccountTokenCreator` role - // on the service account that is specified in the `name` field of the - // request. - // - // The delegates must have the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - repeated string delegates = 3; - - // Required. The JWT payload to sign: a JSON object that contains a JWT Claims Set. - string payload = 5 [(google.api.field_behavior) = REQUIRED]; -} - -message SignJwtResponse { - // The ID of the key used to sign the JWT. - string key_id = 1; - - // The signed JWT. - string signed_jwt = 2; -} - -message GenerateIdTokenRequest { - // Required. The resource name of the service account for which the credentials - // are requested, in the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "iam.googleapis.com/ServiceAccount" - } - ]; - - // The sequence of service accounts in a delegation chain. Each service - // account must be granted the `roles/iam.serviceAccountTokenCreator` role - // on its next service account in the chain. The last service account in the - // chain must be granted the `roles/iam.serviceAccountTokenCreator` role - // on the service account that is specified in the `name` field of the - // request. - // - // The delegates must have the following format: - // `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard - // character is required; replacing it with a project ID is invalid. - repeated string delegates = 2; - - // Required. The audience for the token, such as the API or account that this token - // grants access to. - string audience = 3 [(google.api.field_behavior) = REQUIRED]; - - // Include the service account email in the token. If set to `true`, the - // token will contain `email` and `email_verified` claims. - bool include_email = 4; -} - -message GenerateIdTokenResponse { - // The OpenId Connect ID token. - string token = 1; -} diff --git a/iam/google/cloud/iam_credentials_v1/proto/common_pb2.py b/iam/google/cloud/iam_credentials_v1/proto/common_pb2.py deleted file mode 100644 index 08438614650e..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/common_pb2.py +++ /dev/null @@ -1,846 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/credentials/v1/common.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/iam/credentials/v1/common.proto", - package="google.iam.credentials.v1", - syntax="proto3", - serialized_options=_b( - "\n#com.google.cloud.iam.credentials.v1B\031IAMCredentialsCommonProtoP\001ZDgoogle.golang.org/genproto/googleapis/iam/credentials/v1;credentials\370\001\001\352AY\n!iam.googleapis.com/ServiceAccount\0224projects/{project}/serviceAccounts/{service_account}" - ), - serialized_pb=_b( - '\n&google/iam/credentials/v1/common.proto\x12\x19google.iam.credentials.v1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xa9\x01\n\x1aGenerateAccessTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x12\n\x05scope\x18\x04 \x03(\tB\x03\xe0\x41\x02\x12+\n\x08lifetime\x18\x07 \x01(\x0b\x32\x19.google.protobuf.Duration"d\n\x1bGenerateAccessTokenResponse\x12\x14\n\x0c\x61\x63\x63\x65ss_token\x18\x01 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"s\n\x0fSignBlobRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\x0c\x42\x03\xe0\x41\x02"7\n\x10SignBlobResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x13\n\x0bsigned_blob\x18\x04 \x01(\x0c"r\n\x0eSignJwtRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x03 \x03(\t\x12\x14\n\x07payload\x18\x05 \x01(\tB\x03\xe0\x41\x02"5\n\x0fSignJwtResponse\x12\x0e\n\x06key_id\x18\x01 \x01(\t\x12\x12\n\nsigned_jwt\x18\x02 \x01(\t"\x92\x01\n\x16GenerateIdTokenRequest\x12\x37\n\x04name\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!iam.googleapis.com/ServiceAccount\x12\x11\n\tdelegates\x18\x02 \x03(\t\x12\x15\n\x08\x61udience\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\rinclude_email\x18\x04 \x01(\x08"(\n\x17GenerateIdTokenResponse\x12\r\n\x05token\x18\x01 \x01(\tB\xe7\x01\n#com.google.cloud.iam.credentials.v1B\x19IAMCredentialsCommonProtoP\x01ZDgoogle.golang.org/genproto/googleapis/iam/credentials/v1;credentials\xf8\x01\x01\xea\x41Y\n!iam.googleapis.com/ServiceAccount\x12\x34projects/{project}/serviceAccounts/{service_account}b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_GENERATEACCESSTOKENREQUEST = _descriptor.Descriptor( - name="GenerateAccessTokenRequest", - full_name="google.iam.credentials.v1.GenerateAccessTokenRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.iam.credentials.v1.GenerateAccessTokenRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!iam.googleapis.com/ServiceAccount" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delegates", - full_name="google.iam.credentials.v1.GenerateAccessTokenRequest.delegates", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="scope", - full_name="google.iam.credentials.v1.GenerateAccessTokenRequest.scope", - index=2, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="lifetime", - full_name="google.iam.credentials.v1.GenerateAccessTokenRequest.lifetime", - index=3, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=195, - serialized_end=364, -) - - -_GENERATEACCESSTOKENRESPONSE = _descriptor.Descriptor( - name="GenerateAccessTokenResponse", - full_name="google.iam.credentials.v1.GenerateAccessTokenResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="access_token", - full_name="google.iam.credentials.v1.GenerateAccessTokenResponse.access_token", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.iam.credentials.v1.GenerateAccessTokenResponse.expire_time", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=366, - serialized_end=466, -) - - -_SIGNBLOBREQUEST = _descriptor.Descriptor( - name="SignBlobRequest", - full_name="google.iam.credentials.v1.SignBlobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.iam.credentials.v1.SignBlobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!iam.googleapis.com/ServiceAccount" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delegates", - full_name="google.iam.credentials.v1.SignBlobRequest.delegates", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="payload", - full_name="google.iam.credentials.v1.SignBlobRequest.payload", - index=2, - number=5, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=468, - serialized_end=583, -) - - -_SIGNBLOBRESPONSE = _descriptor.Descriptor( - name="SignBlobResponse", - full_name="google.iam.credentials.v1.SignBlobResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key_id", - full_name="google.iam.credentials.v1.SignBlobResponse.key_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="signed_blob", - full_name="google.iam.credentials.v1.SignBlobResponse.signed_blob", - index=1, - number=4, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=585, - serialized_end=640, -) - - -_SIGNJWTREQUEST = _descriptor.Descriptor( - name="SignJwtRequest", - full_name="google.iam.credentials.v1.SignJwtRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.iam.credentials.v1.SignJwtRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!iam.googleapis.com/ServiceAccount" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delegates", - full_name="google.iam.credentials.v1.SignJwtRequest.delegates", - index=1, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="payload", - full_name="google.iam.credentials.v1.SignJwtRequest.payload", - index=2, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=642, - serialized_end=756, -) - - -_SIGNJWTRESPONSE = _descriptor.Descriptor( - name="SignJwtResponse", - full_name="google.iam.credentials.v1.SignJwtResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key_id", - full_name="google.iam.credentials.v1.SignJwtResponse.key_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="signed_jwt", - full_name="google.iam.credentials.v1.SignJwtResponse.signed_jwt", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=758, - serialized_end=811, -) - - -_GENERATEIDTOKENREQUEST = _descriptor.Descriptor( - name="GenerateIdTokenRequest", - full_name="google.iam.credentials.v1.GenerateIdTokenRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.iam.credentials.v1.GenerateIdTokenRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!iam.googleapis.com/ServiceAccount" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delegates", - full_name="google.iam.credentials.v1.GenerateIdTokenRequest.delegates", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audience", - full_name="google.iam.credentials.v1.GenerateIdTokenRequest.audience", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_email", - full_name="google.iam.credentials.v1.GenerateIdTokenRequest.include_email", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=814, - serialized_end=960, -) - - -_GENERATEIDTOKENRESPONSE = _descriptor.Descriptor( - name="GenerateIdTokenResponse", - full_name="google.iam.credentials.v1.GenerateIdTokenResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="token", - full_name="google.iam.credentials.v1.GenerateIdTokenResponse.token", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=962, - serialized_end=1002, -) - -_GENERATEACCESSTOKENREQUEST.fields_by_name[ - "lifetime" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_GENERATEACCESSTOKENRESPONSE.fields_by_name[ - "expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -DESCRIPTOR.message_types_by_name[ - "GenerateAccessTokenRequest" -] = _GENERATEACCESSTOKENREQUEST -DESCRIPTOR.message_types_by_name[ - "GenerateAccessTokenResponse" -] = _GENERATEACCESSTOKENRESPONSE -DESCRIPTOR.message_types_by_name["SignBlobRequest"] = _SIGNBLOBREQUEST -DESCRIPTOR.message_types_by_name["SignBlobResponse"] = _SIGNBLOBRESPONSE -DESCRIPTOR.message_types_by_name["SignJwtRequest"] = _SIGNJWTREQUEST -DESCRIPTOR.message_types_by_name["SignJwtResponse"] = _SIGNJWTRESPONSE -DESCRIPTOR.message_types_by_name["GenerateIdTokenRequest"] = _GENERATEIDTOKENREQUEST -DESCRIPTOR.message_types_by_name["GenerateIdTokenResponse"] = _GENERATEIDTOKENRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -GenerateAccessTokenRequest = _reflection.GeneratedProtocolMessageType( - "GenerateAccessTokenRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GENERATEACCESSTOKENREQUEST, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - name: - Required. The resource name of the service account for which - the credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - delegates: - The sequence of service accounts in a delegation chain. Each - service account must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on its next - service account in the chain. The last service account in the - chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service - account that is specified in the ``name`` field of the - request. The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - scope: - Required. Code to identify the scopes to be included in the - OAuth 2.0 access token. See - https://developers.google.com/identity/protocols/googlescopes - for more information. At least one value required. - lifetime: - The desired lifetime duration of the access token in seconds. - Must be set to a value less than or equal to 3600 (1 hour). If - a value is not specified, the token's lifetime will be set to - a default value of one hour. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateAccessTokenRequest) - ), -) -_sym_db.RegisterMessage(GenerateAccessTokenRequest) - -GenerateAccessTokenResponse = _reflection.GeneratedProtocolMessageType( - "GenerateAccessTokenResponse", - (_message.Message,), - dict( - DESCRIPTOR=_GENERATEACCESSTOKENRESPONSE, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - access_token: - The OAuth 2.0 access token. - expire_time: - Token expiration time. The expiration time is always set. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateAccessTokenResponse) - ), -) -_sym_db.RegisterMessage(GenerateAccessTokenResponse) - -SignBlobRequest = _reflection.GeneratedProtocolMessageType( - "SignBlobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SIGNBLOBREQUEST, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - name: - Required. The resource name of the service account for which - the credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - delegates: - The sequence of service accounts in a delegation chain. Each - service account must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on its next - service account in the chain. The last service account in the - chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service - account that is specified in the ``name`` field of the - request. The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - payload: - Required. The bytes to sign. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignBlobRequest) - ), -) -_sym_db.RegisterMessage(SignBlobRequest) - -SignBlobResponse = _reflection.GeneratedProtocolMessageType( - "SignBlobResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SIGNBLOBRESPONSE, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - key_id: - The ID of the key used to sign the blob. - signed_blob: - The signed blob. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignBlobResponse) - ), -) -_sym_db.RegisterMessage(SignBlobResponse) - -SignJwtRequest = _reflection.GeneratedProtocolMessageType( - "SignJwtRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SIGNJWTREQUEST, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - name: - Required. The resource name of the service account for which - the credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - delegates: - The sequence of service accounts in a delegation chain. Each - service account must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on its next - service account in the chain. The last service account in the - chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service - account that is specified in the ``name`` field of the - request. The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - payload: - Required. The JWT payload to sign: a JSON object that contains - a JWT Claims Set. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignJwtRequest) - ), -) -_sym_db.RegisterMessage(SignJwtRequest) - -SignJwtResponse = _reflection.GeneratedProtocolMessageType( - "SignJwtResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SIGNJWTRESPONSE, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - key_id: - The ID of the key used to sign the JWT. - signed_jwt: - The signed JWT. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.SignJwtResponse) - ), -) -_sym_db.RegisterMessage(SignJwtResponse) - -GenerateIdTokenRequest = _reflection.GeneratedProtocolMessageType( - "GenerateIdTokenRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GENERATEIDTOKENREQUEST, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - name: - Required. The resource name of the service account for which - the credentials are requested, in the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - delegates: - The sequence of service accounts in a delegation chain. Each - service account must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on its next - service account in the chain. The last service account in the - chain must be granted the - ``roles/iam.serviceAccountTokenCreator`` role on the service - account that is specified in the ``name`` field of the - request. The delegates must have the following format: - ``projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}``. - The ``-`` wildcard character is required; replacing it with a - project ID is invalid. - audience: - Required. The audience for the token, such as the API or - account that this token grants access to. - include_email: - Include the service account email in the token. If set to - ``true``, the token will contain ``email`` and - ``email_verified`` claims. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdTokenRequest) - ), -) -_sym_db.RegisterMessage(GenerateIdTokenRequest) - -GenerateIdTokenResponse = _reflection.GeneratedProtocolMessageType( - "GenerateIdTokenResponse", - (_message.Message,), - dict( - DESCRIPTOR=_GENERATEIDTOKENRESPONSE, - __module__="google.iam.credentials.v1.common_pb2", - __doc__=""" -Attributes: - token: - The OpenId Connect ID token. - """, - # @@protoc_insertion_point(class_scope:google.iam.credentials.v1.GenerateIdTokenResponse) - ), -) -_sym_db.RegisterMessage(GenerateIdTokenResponse) - - -DESCRIPTOR._options = None -_GENERATEACCESSTOKENREQUEST.fields_by_name["name"]._options = None -_GENERATEACCESSTOKENREQUEST.fields_by_name["scope"]._options = None -_SIGNBLOBREQUEST.fields_by_name["name"]._options = None -_SIGNBLOBREQUEST.fields_by_name["payload"]._options = None -_SIGNJWTREQUEST.fields_by_name["name"]._options = None -_SIGNJWTREQUEST.fields_by_name["payload"]._options = None -_GENERATEIDTOKENREQUEST.fields_by_name["name"]._options = None -_GENERATEIDTOKENREQUEST.fields_by_name["audience"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/iam/google/cloud/iam_credentials_v1/proto/common_pb2_grpc.py b/iam/google/cloud/iam_credentials_v1/proto/common_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/common_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials.proto b/iam/google/cloud/iam_credentials_v1/proto/iamcredentials.proto deleted file mode 100644 index 29554c567db1..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials.proto +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.iam.credentials.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/iam/credentials/v1/common.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/iam/credentials/v1;credentials"; -option java_multiple_files = true; -option java_outer_classname = "IAMCredentialsProto"; -option java_package = "com.google.cloud.iam.credentials.v1"; - -// A service account is a special type of Google account that belongs to your -// application or a virtual machine (VM), instead of to an individual end user. -// Your application assumes the identity of the service account to call Google -// APIs, so that the users aren't directly involved. -// -// Service account credentials are used to temporarily assume the identity -// of the service account. Supported credential types include OAuth 2.0 access -// tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and -// more. -service IAMCredentials { - option (google.api.default_host) = "iamcredentials.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Generates an OAuth 2.0 access token for a service account. - rpc GenerateAccessToken(GenerateAccessTokenRequest) returns (GenerateAccessTokenResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken" - body: "*" - }; - option (google.api.method_signature) = "name,delegates,scope,lifetime"; - } - - // Generates an OpenID Connect ID token for a service account. - rpc GenerateIdToken(GenerateIdTokenRequest) returns (GenerateIdTokenResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/serviceAccounts/*}:generateIdToken" - body: "*" - }; - option (google.api.method_signature) = "name,delegates,audience,include_email"; - } - - // Signs a blob using a service account's system-managed private key. - rpc SignBlob(SignBlobRequest) returns (SignBlobResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/serviceAccounts/*}:signBlob" - body: "*" - }; - option (google.api.method_signature) = "name,delegates,payload"; - } - - // Signs a JWT using a service account's system-managed private key. - rpc SignJwt(SignJwtRequest) returns (SignJwtResponse) { - option (google.api.http) = { - post: "/v1/{name=projects/*/serviceAccounts/*}:signJwt" - body: "*" - }; - option (google.api.method_signature) = "name,delegates,payload"; - } -} diff --git a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2.py b/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2.py deleted file mode 100644 index 9269e5f6bec4..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2.py +++ /dev/null @@ -1,109 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/iam/credentials/v1/iamcredentials.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.cloud.iam_credentials_v1.proto import ( - common_pb2 as google_dot_iam_dot_credentials_dot_v1_dot_common__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/iam/credentials/v1/iamcredentials.proto", - package="google.iam.credentials.v1", - syntax="proto3", - serialized_options=_b( - "\n#com.google.cloud.iam.credentials.v1B\023IAMCredentialsProtoP\001ZDgoogle.golang.org/genproto/googleapis/iam/credentials/v1;credentials\370\001\001" - ), - serialized_pb=_b( - '\n.google/iam/credentials/v1/iamcredentials.proto\x12\x19google.iam.credentials.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a&google/iam/credentials/v1/common.proto2\xad\x07\n\x0eIAMCredentials\x12\xec\x01\n\x13GenerateAccessToken\x12\x35.google.iam.credentials.v1.GenerateAccessTokenRequest\x1a\x36.google.iam.credentials.v1.GenerateAccessTokenResponse"f\x82\xd3\xe4\x93\x02@";/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken:\x01*\xda\x41\x1dname,delegates,scope,lifetime\x12\xe4\x01\n\x0fGenerateIdToken\x12\x31.google.iam.credentials.v1.GenerateIdTokenRequest\x1a\x32.google.iam.credentials.v1.GenerateIdTokenResponse"j\x82\xd3\xe4\x93\x02<"7/v1/{name=projects/*/serviceAccounts/*}:generateIdToken:\x01*\xda\x41%name,delegates,audience,include_email\x12\xb9\x01\n\x08SignBlob\x12*.google.iam.credentials.v1.SignBlobRequest\x1a+.google.iam.credentials.v1.SignBlobResponse"T\x82\xd3\xe4\x93\x02\x35"0/v1/{name=projects/*/serviceAccounts/*}:signBlob:\x01*\xda\x41\x16name,delegates,payload\x12\xb5\x01\n\x07SignJwt\x12).google.iam.credentials.v1.SignJwtRequest\x1a*.google.iam.credentials.v1.SignJwtResponse"S\x82\xd3\xe4\x93\x02\x34"//v1/{name=projects/*/serviceAccounts/*}:signJwt:\x01*\xda\x41\x16name,delegates,payload\x1aQ\xca\x41\x1diamcredentials.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x85\x01\n#com.google.cloud.iam.credentials.v1B\x13IAMCredentialsProtoP\x01ZDgoogle.golang.org/genproto/googleapis/iam/credentials/v1;credentials\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.DESCRIPTOR, - ], -) - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -DESCRIPTOR._options = None - -_IAMCREDENTIALS = _descriptor.ServiceDescriptor( - name="IAMCredentials", - full_name="google.iam.credentials.v1.IAMCredentials", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\035iamcredentials.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=173, - serialized_end=1114, - methods=[ - _descriptor.MethodDescriptor( - name="GenerateAccessToken", - full_name="google.iam.credentials.v1.IAMCredentials.GenerateAccessToken", - index=0, - containing_service=None, - input_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._GENERATEACCESSTOKENREQUEST, - output_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._GENERATEACCESSTOKENRESPONSE, - serialized_options=_b( - '\202\323\344\223\002@";/v1/{name=projects/*/serviceAccounts/*}:generateAccessToken:\001*\332A\035name,delegates,scope,lifetime' - ), - ), - _descriptor.MethodDescriptor( - name="GenerateIdToken", - full_name="google.iam.credentials.v1.IAMCredentials.GenerateIdToken", - index=1, - containing_service=None, - input_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._GENERATEIDTOKENREQUEST, - output_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._GENERATEIDTOKENRESPONSE, - serialized_options=_b( - '\202\323\344\223\002<"7/v1/{name=projects/*/serviceAccounts/*}:generateIdToken:\001*\332A%name,delegates,audience,include_email' - ), - ), - _descriptor.MethodDescriptor( - name="SignBlob", - full_name="google.iam.credentials.v1.IAMCredentials.SignBlob", - index=2, - containing_service=None, - input_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._SIGNBLOBREQUEST, - output_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._SIGNBLOBRESPONSE, - serialized_options=_b( - '\202\323\344\223\0025"0/v1/{name=projects/*/serviceAccounts/*}:signBlob:\001*\332A\026name,delegates,payload' - ), - ), - _descriptor.MethodDescriptor( - name="SignJwt", - full_name="google.iam.credentials.v1.IAMCredentials.SignJwt", - index=3, - containing_service=None, - input_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._SIGNJWTREQUEST, - output_type=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2._SIGNJWTRESPONSE, - serialized_options=_b( - '\202\323\344\223\0024"//v1/{name=projects/*/serviceAccounts/*}:signJwt:\001*\332A\026name,delegates,payload' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_IAMCREDENTIALS) - -DESCRIPTOR.services_by_name["IAMCredentials"] = _IAMCREDENTIALS - -# @@protoc_insertion_point(module_scope) diff --git a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2_grpc.py b/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2_grpc.py deleted file mode 100644 index 277e7249eef8..000000000000 --- a/iam/google/cloud/iam_credentials_v1/proto/iamcredentials_pb2_grpc.py +++ /dev/null @@ -1,116 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.iam_credentials_v1.proto import ( - common_pb2 as google_dot_iam_dot_credentials_dot_v1_dot_common__pb2, -) - - -class IAMCredentialsStub(object): - """A service account is a special type of Google account that belongs to your - application or a virtual machine (VM), instead of to an individual end user. - Your application assumes the identity of the service account to call Google - APIs, so that the users aren't directly involved. - - Service account credentials are used to temporarily assume the identity - of the service account. Supported credential types include OAuth 2.0 access - tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - more. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.GenerateAccessToken = channel.unary_unary( - "/google.iam.credentials.v1.IAMCredentials/GenerateAccessToken", - request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenResponse.FromString, - ) - self.GenerateIdToken = channel.unary_unary( - "/google.iam.credentials.v1.IAMCredentials/GenerateIdToken", - request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenResponse.FromString, - ) - self.SignBlob = channel.unary_unary( - "/google.iam.credentials.v1.IAMCredentials/SignBlob", - request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobResponse.FromString, - ) - self.SignJwt = channel.unary_unary( - "/google.iam.credentials.v1.IAMCredentials/SignJwt", - request_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtRequest.SerializeToString, - response_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtResponse.FromString, - ) - - -class IAMCredentialsServicer(object): - """A service account is a special type of Google account that belongs to your - application or a virtual machine (VM), instead of to an individual end user. - Your application assumes the identity of the service account to call Google - APIs, so that the users aren't directly involved. - - Service account credentials are used to temporarily assume the identity - of the service account. Supported credential types include OAuth 2.0 access - tokens, OpenID Connect ID tokens, self-signed JSON Web Tokens (JWTs), and - more. - """ - - def GenerateAccessToken(self, request, context): - """Generates an OAuth 2.0 access token for a service account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GenerateIdToken(self, request, context): - """Generates an OpenID Connect ID token for a service account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SignBlob(self, request, context): - """Signs a blob using a service account's system-managed private key. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SignJwt(self, request, context): - """Signs a JWT using a service account's system-managed private key. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_IAMCredentialsServicer_to_server(servicer, server): - rpc_method_handlers = { - "GenerateAccessToken": grpc.unary_unary_rpc_method_handler( - servicer.GenerateAccessToken, - request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenRequest.FromString, - response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateAccessTokenResponse.SerializeToString, - ), - "GenerateIdToken": grpc.unary_unary_rpc_method_handler( - servicer.GenerateIdToken, - request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenRequest.FromString, - response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.GenerateIdTokenResponse.SerializeToString, - ), - "SignBlob": grpc.unary_unary_rpc_method_handler( - servicer.SignBlob, - request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobRequest.FromString, - response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignBlobResponse.SerializeToString, - ), - "SignJwt": grpc.unary_unary_rpc_method_handler( - servicer.SignJwt, - request_deserializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtRequest.FromString, - response_serializer=google_dot_iam_dot_credentials_dot_v1_dot_common__pb2.SignJwtResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.iam.credentials.v1.IAMCredentials", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/iam/google/cloud/iam_credentials_v1/types.py b/iam/google/cloud/iam_credentials_v1/types.py deleted file mode 100644 index 0e1eb556f250..000000000000 --- a/iam/google/cloud/iam_credentials_v1/types.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.iam_credentials_v1.proto import common_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 - - -_shared_modules = [duration_pb2, timestamp_pb2] - -_local_modules = [common_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.iam_credentials_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/iam/noxfile.py b/iam/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/iam/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/iam/setup.cfg b/iam/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/iam/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/iam/setup.py b/iam/setup.py deleted file mode 100644 index a74b425fd7a1..000000000000 --- a/iam/setup.py +++ /dev/null @@ -1,79 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -import io -import os - -import setuptools - -name = "google-cloud-iam" -description = "IAM Service Account Credentials API client library" -version = "0.2.1" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/iam/synth.metadata b/iam/synth.metadata deleted file mode 100644 index 806c27a78ac5..000000000000 --- a/iam/synth.metadata +++ /dev/null @@ -1,156 +0,0 @@ -{ - "updateTime": "2020-01-29T13:21:38.098637Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cf3b61102ed5f36b827bc82ec39be09525f018c8", - "internalRef": "292034635", - "log": "cf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n08b488e0660c59842a7dee0e3e2b65d9e3a514a9\nExposing cloud_catalog.proto (This API is already available through REST)\n\nPiperOrigin-RevId: 288625007\n\na613482977e11ac09fa47687a5d1b5a01efcf794\nUpdate the OS Login v1beta API description to render better in the UI.\n\nPiperOrigin-RevId: 288547940\n\n5e182b8d9943f1b17008d69d4c7e865dc83641a7\nUpdate the OS Login API description to render better in the UI.\n\nPiperOrigin-RevId: 288546443\n\ncb79155f596e0396dd900da93872be7066f6340d\nFix: Add a resource annotation for Agent\nFix: Correct the service name in annotations for Intent and SessionEntityType\n\nPiperOrigin-RevId: 288441307\n\nf7f6e9daec3315fd47cb638789bd8415bf4a27cc\nAdded cloud asset api v1p1beta1\n\nPiperOrigin-RevId: 288427239\n\nf2880f5b342c6345f3dcaad24fcb3c6ca9483654\nBilling account API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 288351810\n\ndc250ffe071729f8f8bef9d6fd0fbbeb0254c666\nFix: Remove incorrect resource annotations in requests\n\nPiperOrigin-RevId: 288321208\n\n91ef2d9dd69807b0b79555f22566fb2d81e49ff9\nAdd GAPIC annotations to Cloud KMS (but do not migrate the GAPIC config yet).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 287999179\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "iam_credentials", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/iam/credentials/artman_iamcredentials_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/iam_credentials.py" - }, - { - "path": "google/cloud/iam_credentials_v1/__init__.py" - }, - { - "path": "google/cloud/iam_credentials_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/iam_credentials_v1/gapic/iam_credentials_client.py" - }, - { - "path": "google/cloud/iam_credentials_v1/gapic/iam_credentials_client_config.py" - }, - { - "path": "google/cloud/iam_credentials_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/iam_credentials_v1/gapic/transports/iam_credentials_grpc_transport.py" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/__init__.py" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/common.proto" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/common_pb2.py" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/common_pb2_grpc.py" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/iamcredentials.proto" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/iamcredentials_pb2.py" - }, - { - "path": "google/cloud/iam_credentials_v1/proto/iamcredentials_pb2_grpc.py" - }, - { - "path": "google/cloud/iam_credentials_v1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1/test_iam_credentials_client_v1.py" - } - ] -} \ No newline at end of file diff --git a/iam/synth.py b/iam/synth.py deleted file mode 100644 index 8c486fa26a0d..000000000000 --- a/iam/synth.py +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate automl GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - "iam_credentials", - "v1", - config_path="/google/iam/credentials/artman_iamcredentials_v1.yaml", - artman_output_name="iamcredentials-v1", - include_protos=True, -) - -excludes = [ - "README.rst", - "setup.py", - "docs/index.rst", - "nox.py", -] -s.copy(library, excludes=excludes) - -s.replace( - "google/**/*.py", - "google-cloud-iamcredentials", - "google-cloud-iam" -) -s.replace( - "docs/**/*.py", - "google-cloud-iamcredentials", - "google-cloud-iam" -) - -s.replace( - "**/*.py", - "from google\.iam\.credentials\.v1 import common_pb2", - "from google.cloud.iam_credentials_v1.proto import common_pb2" -) -s.replace( - "**/*.py", - "from google\.iam\.credentials\.v1 import iamcredentials_pb2_grpc", - "from google.cloud.iam_credentials_v1.proto import iamcredentials_pb2_grpc" -) - -s.replace( - "google/cloud/iam_credentials_v1/proto/common_pb2.py", - "\"\"\"Attributes:\n", - "\"\"\"\nAttributes:\n" -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/iam/tests/unit/gapic/v1/test_iam_credentials_client_v1.py b/iam/tests/unit/gapic/v1/test_iam_credentials_client_v1.py deleted file mode 100644 index b90f179a3394..000000000000 --- a/iam/tests/unit/gapic/v1/test_iam_credentials_client_v1.py +++ /dev/null @@ -1,225 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import iam_credentials_v1 -from google.cloud.iam_credentials_v1.proto import common_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestIAMCredentialsClient(object): - def test_generate_access_token(self): - # Setup Expected Response - access_token = "accessToken-1938933922" - expected_response = {"access_token": access_token} - expected_response = common_pb2.GenerateAccessTokenResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup Request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - scope = [] - - response = client.generate_access_token(name, scope) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = common_pb2.GenerateAccessTokenRequest(name=name, scope=scope) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_generate_access_token_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - scope = [] - - with pytest.raises(CustomException): - client.generate_access_token(name, scope) - - def test_generate_id_token(self): - # Setup Expected Response - token = "token110541305" - expected_response = {"token": token} - expected_response = common_pb2.GenerateIdTokenResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup Request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - audience = "audience975628804" - - response = client.generate_id_token(name, audience) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = common_pb2.GenerateIdTokenRequest( - name=name, audience=audience - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_generate_id_token_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - audience = "audience975628804" - - with pytest.raises(CustomException): - client.generate_id_token(name, audience) - - def test_sign_blob(self): - # Setup Expected Response - key_id = "keyId-1134673157" - signed_blob = b"-32" - expected_response = {"key_id": key_id, "signed_blob": signed_blob} - expected_response = common_pb2.SignBlobResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup Request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - payload = b"-114" - - response = client.sign_blob(name, payload) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = common_pb2.SignBlobRequest(name=name, payload=payload) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_sign_blob_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - payload = b"-114" - - with pytest.raises(CustomException): - client.sign_blob(name, payload) - - def test_sign_jwt(self): - # Setup Expected Response - key_id = "keyId-1134673157" - signed_jwt = "signedJwt-979546844" - expected_response = {"key_id": key_id, "signed_jwt": signed_jwt} - expected_response = common_pb2.SignJwtResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup Request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - payload = "-114" - - response = client.sign_jwt(name, payload) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = common_pb2.SignJwtRequest(name=name, payload=payload) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_sign_jwt_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iam_credentials_v1.IAMCredentialsClient() - - # Setup request - name = client.service_account_path("[PROJECT]", "[SERVICE_ACCOUNT]") - payload = "-114" - - with pytest.raises(CustomException): - client.sign_jwt(name, payload) diff --git a/pubsub/.coveragerc b/pubsub/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/pubsub/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/pubsub/.flake8 b/pubsub/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/pubsub/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/pubsub/.repo-metadata.json b/pubsub/.repo-metadata.json deleted file mode 100644 index e14db4392f0a..000000000000 --- a/pubsub/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "pubsub", - "name_pretty": "Google Cloud Pub/Sub", - "product_documentation": "https://cloud.google.com/pubsub/docs/", - "client_documentation": "https://googleapis.dev/python/pubsub/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559741", - "release_level": "ga", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-pubsub", - "api_id": "pubsub.googleapis.com", - "requires_billing": true -} diff --git a/pubsub/CHANGELOG.md b/pubsub/CHANGELOG.md deleted file mode 100644 index ddca773a09a7..000000000000 --- a/pubsub/CHANGELOG.md +++ /dev/null @@ -1,610 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-pubsub/#history - -## 1.1.0 - -12-09-2019 18:51 PST - -### Implementation Changes -- Update client configurations (via synth). ([#9784](https://github.com/googleapis/google-cloud-python/pull/9784)) -- Include request overhead when computing publish batch size overflow. ([#9911](https://github.com/googleapis/google-cloud-python/pull/9911)) -- Split large (mod)ACK requests into smaller ones. ([#9594](https://github.com/googleapis/google-cloud-python/pull/9594)) -- Fix messages delivered multiple times despite a long ACK deadline. ([#9525](https://github.com/googleapis/google-cloud-python/pull/9525)) -- Update batching and flow control parameters to be same as the other client libraries. ([#9597](https://github.com/googleapis/google-cloud-python/pull/9597)) -- Add `StreamingPullManager._should_terminate`. ([#9335](https://github.com/googleapis/google-cloud-python/pull/9335)) - -### New Features -- Add stop method. ([#9365](https://github.com/googleapis/google-cloud-python/pull/9365)) - -### Dependencies -- Add Python 2 sunset banner to documentation. ([#9036](https://github.com/googleapis/google-cloud-python/pull/9036)) - -### Documentation -- Change spacing in docs templates (via synth). ([#9759](https://github.com/googleapis/google-cloud-python/pull/9759)) - -### Internal / Testing Changes -- Refactor fake leaser test helper. ([#9632](https://github.com/googleapis/google-cloud-python/pull/9632)) -- Add subscriber role test for streaming. ([#9507](https://github.com/googleapis/google-cloud-python/pull/9507)) - -## 1.0.2 - -09-30-2019 11:57 PDT - - -### Implementation Changes - -- Streaming pull shouldn't need `subscriptions.get` permission ([#9360](https://github.com/googleapis/google-cloud-python/pull/9360)). - -## 1.0.1 - -09-27-2019 07:01 PDT - - -### Implementation Changes -- Set default stream ACK deadline to subscriptions'. ([#9268](https://github.com/googleapis/google-cloud-python/pull/9268)) - -### Documentation -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Link to correct TimeoutError in futures docs. ([#9216](https://github.com/googleapis/google-cloud-python/pull/9216)) - -### Internal / Testing Changes -- Adjust messaging RPC timeout settings (via synth). [#9279](https://github.com/googleapis/google-cloud-python/pull/9279) - -## 1.0.0 - -08-29-2019 09:27 PDT - -### Implementation Changes -- Add 'ReceivedMessage.delivery_attempt' field (via synth). ([#9098](https://github.com/googleapis/google-cloud-python/pull/9098)) -- Remove send/recv msg size limit, update docstrings (via synth). ([#8964](https://github.com/googleapis/google-cloud-python/pull/8964)) - -### Documentation -- Update docstrings for client kwargs and fix return types uris ([#9037](https://github.com/googleapis/google-cloud-python/pull/9037)) -- Remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) - -### Internal / Testing Changes -- Add dead-letter-policy field in preparation for its implementation (via synth) ([#9078](https://github.com/googleapis/google-cloud-python/pull/9078)) - -## 0.45.0 - -07-31-2019 02:03 PDT - - -### Implementation Changes - -- Remove deprecated methods and settings ([#8836](https://github.com/googleapis/google-cloud-python/pull/8836)) - - -### Documentation - -- Use double backticks for ReST correctness. ([#8829](https://github.com/googleapis/google-cloud-python/pull/8829)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.44.0 - -07-29-2019 04:28 PDT - - -### Implementation Changes - -- PubSub: Deprecate several FlowControl settings and things in Message class ([#8796](https://github.com/googleapis/google-cloud-python/pull/8796)) - -### Documentation - -- Pub/Sub: document regional endpoint ([#8789](https://github.com/googleapis/google-cloud-python/pull/8789)) - -## 0.43.0 - -07-24-2019 17:13 PDT - - -### Implementation Changes -- Accomodate new location of 'IAMPolicyStub' (via synth). ([#8680](https://github.com/googleapis/google-cloud-python/pull/8680)) -- Use kwargs in test_subscriber_client ([#8414](https://github.com/googleapis/google-cloud-python/pull/8414)) - -### New Features -- Add 'options_' argument to clients' 'get_iam_policy'; pin black version (via synth). ([#8657](https://github.com/googleapis/google-cloud-python/pull/8657)) -- Add 'client_options' support, update list method docstrings (via synth). ([#8518](https://github.com/googleapis/google-cloud-python/pull/8518)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) -- Update pin for 'grpc-google-iam-v1' to 0.12.3+. ([#8647](https://github.com/googleapis/google-cloud-python/pull/8647)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Fix typo in publisher index. ([#8619](https://github.com/googleapis/google-cloud-python/pull/8619)) -- Document how to choose the PubSub auth method ([#8429](https://github.com/googleapis/google-cloud-python/pull/8429)) -- Document different PuSub received message types ([#8468](https://github.com/googleapis/google-cloud-python/pull/8468)) -- PubSub: Document batch settings, make synth operations idempotent ([#8448](https://github.com/googleapis/google-cloud-python/pull/8448)) -- Add custom docstrings for FlowControl enum and values (via synth). ([#8426](https://github.com/googleapis/google-cloud-python/pull/8426)) - -### Internal / Testing Changes -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Add system tests for PubSub clients ([#8277](https://github.com/googleapis/google-cloud-python/pull/8277)) - -## 0.42.1 - -06-18-2019 15:14 PDT - - -### Implementation Changes -- Increase the minimum allowed version for api core. ([#8419](https://github.com/googleapis/google-cloud-python/pull/8419)) -- Allow kwargs to be passed to create_channel. ([#8399](https://github.com/googleapis/google-cloud-python/pull/8399)) - -## 0.42.0 - -06-18-2019 11:32 PDT - -### Implementation Changes -- Core: Mitigate busy reopen loop in ResumableBidiRpc consuming 100% CPU ([#8193](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8193)) -- Pub/Sub: Increase initial_rpc_timeout for messaging (via synth). ([#8219](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8219)) -- PubSub: Release the state lock before calling the publish api ([#8234](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8234)) -- Pub/Sub: Expose publish retry settings ([#8231](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8231)) -- Prevent unhandled background error on SPM shutdown ([#8111](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8111)) -- Update timeouts, blacken noxfile.py, setup.py (via synth). ([#8128](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8128)) -- PubSub: Fix streaming pull incorrectly handling FlowControl max_messages setting ([#7948](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7948)) - -### Documentation -- Document PubSub FlowControl settings ([#8293](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8293)) -- Replace readthedocs links with links to github docs. ([#8291](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8291)) -- Pub/Sub: surface publish future in documentation ([#8229](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8229)) -- Pubsub: Separate subscriber and publish future documentation. ([#8205](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8205)) -- Drop mention of long-removed 'policy' object. ([#8081](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8081)) - -### Internal / Testing Changes -- Pub/Sub: staticmethod check ([#8091](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8091)) -- Add empty lines (via synth). ([#8067](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/8067)) - -## 0.41.0 - -05-15-2019 13:57 PDT - - -### New Features -- Add `kms_key_name` arg to `create_topic`; remove BETA warnings (via synth). ([#7936](https://github.com/googleapis/google-cloud-python/pull/7936)) -- Add message ordering (via synth). ([#7551](https://github.com/googleapis/google-cloud-python/pull/7551)) - -### Implementation Changes -- Propagate subscribe callback errors to main thread ([#7954](https://github.com/googleapis/google-cloud-python/pull/7954)) -- Fix pubsub Streaming Pull shutdown on RetryError ([#7863](https://github.com/googleapis/google-cloud-python/pull/7863)) -- Make PubSub subscriber Scheduler inherit from ABC ([#7690](https://github.com/googleapis/google-cloud-python/pull/7690)) -- Add routing header to method metadata (via synth). ([#7623](https://github.com/googleapis/google-cloud-python/pull/7623)) - -### Internal / Testing Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Add nox session `docs` (via synth). ([#7778](https://github.com/googleapis/google-cloud-python/pull/7778)) -- Pub/Sub (nit): wrong var name in sample ([#7705](https://github.com/googleapis/google-cloud-python/pull/7705)) - -## 0.40.0 - -03-15-2019 14:09 PDT - - -### Implementation Changes -- Propagate 'RetryError' in 'PublisherClient.publish'. ([#7071](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7071)) -- Protoc-generated serialization update.. ([#7091](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7091)) - -### New Features -- Add 'authentication_method' to 'PushConfig' (via synth). ([#7512](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7512)) -- Add protos as an artifact to library ([#7205](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7205)) -- Pub/sub: pass transport w/ custom channel to GAPIC API clients. ([#7008](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7008)) - -### Dependencies - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7307)) -- Update copyright headers -- Fix broken docstring cross-reference links. ([#7132](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7132)) -- Docstring changes from updates to .proto files. ([#7054](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/7054)) -- Pick up stub docstring fix in GAPIC generator. ([#6978](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6978)) - -### Internal / Testing Changes -- Copy proto files alongside protoc versions. - -## 0.39.1 - -12-17-2018 16:57 PST - - -### Implementation Changes -- Initialize `StreamingPullFuture._cancelled` as True. ([#6901](https://github.com/googleapis/google-cloud-python/pull/6901)) -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Emphasize that returned futures may differ from stdlib futures. ([#6875](https://github.com/googleapis/google-cloud-python/pull/6875)) - -### Internal / Testing Changes -- Add baseline for synth.metadata -- Update noxfile. -- blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) - -## 0.39.0 - -11-27-2018 13:32 PST - -### Implementation Changes -- Pick up fixes to GAPIC generator. ([#6503](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6503)) -- Override client classmethod factories inherited from GAPIC. ([#6453](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6453)) -- Fix imports for hand-written client docstring examples. ([#6345](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6345)) -- Fix path for patch of 'bidi' elements. ([#6243](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6243)) -- Move bidi to api-core. ([#6211](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6211)) -- Re-generate library using pubsub/synth.py ([#6059](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6059)) -- Re-generate library using pubsub/synth.py ([#5978](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5978)) - -### New Features -- Add 'expiration_policy' to subscriber client. ([#6223](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6223)) - -### Dependencies -- Bump minimum 'api_core' version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6391)) -- Update IAM version in dependencies. ([#6362](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6362)) -- Bump minimum 'api_core' version to '1.4.1'. ([#6134](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6134)) - -### Documentation -- Fix client_info bug, update docstrings. ([#6418](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6418)) -- Fix docstring reference to wrong future class. ([#6382](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6382)) -- Normalize use of support level badges. ([#6159](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6159)) -- Update subscriber example in README to current patterns. ([#6194](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6194)) -- Prep pubsub docs for repo split. ([#6001](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6001)) - -### Internal / Testing Changes -- Fix error from new flake8 version. ([#6346](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6346)) -- Use new Nox. ([#6175](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6175)) - -## 0.38.0 - -### Implementation Changes - -- Fix race condition in recv()'s usage of self.call. ([#5935](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5935)) -- Re-generate the underlying library from protos. ([#5953](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5953)) -- Change 'BatchSettings.max_bytes' default. ([#5899](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5899)) -- Fix race condition where pending Ack IDs can be modified by another thread. ([#5929](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5929)) - -### Internal / Testing Changes - -- Nox: use inplace installs ([#5865](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5865)) - -## 0.37.2 - -### Implementation Changes - -- Fix classmethod wrapping (#5826) - -### Documentation - -- Fix Sphinx rendering for publisher client. (#5822) - -### Internal / Testing Changes - -- Re-generate library, removing obsolete synth modifications. (#5825) -- Add test for testing invoking a wrapped class method on the class itself (#5828) - -## 0.37.1 - -### Implementation Changes - -- Make get_initial_request more resilient to race conditions. (#5803) - -## 0.37.0 - -### Implementation Changes - -- Make Publisher batch-related interfaces private (#5784) - -## 0.36.0 - -### Implementation Changes -- Pubsub: Make 'Message.publish_time' return datetime (#5633) -- Ensure SPM methods check that 'self._consumer' is not None before use. (#5758) - -### New Features -- PubSub: add geo-fencing support (#5769) -- Add 'Message.ack_id' property. (#5693) - -## 0.35.4 - -### Implementation Changes - -- Recover streams during the gRPC error callback. (#5446) -- Use operational lock when checking for activity on streams. (#5445) - -## 0.35.3 - -### Implementation Changes - -- Add additional error handling to unary RPCs (#5438) - -## 0.35.2 - -### Implementation Changes -- Add heartbeating to the streaming pull manager (#5413) -- Fix retrying of bidirectional RPCs and closing the streaming pull manager (#5412) - -## 0.35.1 - -### Implementation Changes -- Catch errors when re-retying send() or recv() in addition to open() (#5402) - -## 0.35.0 - -### Implementation Changes - -- Send requests during streaming pull over a separate unary RPC (#5377) -- Initialize references to helper threads before starting them (#5374) -- Make leaser exit more quickly (#5373) -- Make re-open failures bubble to callbacks (#5372) -- Avoid overwriting '__module__' of messages from shared modules. (#5364) -- Normalize overflow handling for max count and bytes (#5343) - -### New Features - -- Restore the synchronous pull method (#5379) -- Promote subscribe_experimental() to subscribe(), remove old subscriber implementation. (#5274) -- Wire up scheduler argument for subscribe() (#5279) - -### Documentation - -- Add link to streaming pull behavior documentation (#5378) -- Fix example in subscribe's documentation (#5375) - -### Internal / Testing Changes - -- Add Test runs for Python 3.7 and remove 3.4 (#5295) -- Modify system tests to use prerelease versions of grpcio (#5304) - -## 0.34.0 - -### Implementation Changes - -- Lower the flow control defaults. (#5248) - -### New Features - -- A new implementation of the subscriber has been added. This is available as `SubscriberClient.subscribe_experimental`. In the next release, this will be replace the current `subscribe` method. If you use this, please report your -findings to us on GitHub. (#5189, #5201, #5210, #5229, #5230, #5237, #5256) - -### Dependencies - -- Remove psutil dependency. (#5248) - -## 0.33.1 - -### Implementation changes - -- Surface publish RPC errors back to the publish futures (#5124) -- Make the pausable response iterator aware of the RPC state to prevent deadlock (#5108) -- Properly handle graceful stop in request generator (#5097) - -## 0.33.0 - -### Implementation changes - -- Drop leased messages after flow_control.max_lease_duration has passed. (#5020) -- Fix mantain leases to not modack messages it just dropped (#5045) -- Avoid race condition in maintain_leases by copying leased_messages (#5035) -- Retry subscription stream on InternalServerError, Unknown, and GatewayTimeout (#5021) -- Use the rpc's status to determine when to exit the request generator thread (#5054) -- Fix missing iter on request stream (#5078) -- Nack messages when the subscriber callback errors (#5019) - -### Testing - -- pubsub nox.py cleanup (#5056) -- Fix test that checks for retryable exceptions (#5034) - -## 0.32.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) - -## 0.32.0 - -### Implementation changes - -- Added support for streaming pull receipts. (#4878) - -## 0.31.0 - -### New features - -- Added the ability for subscriber to batch requests. (#4895) -- Added pending request backpressure for subscriber. (#4892) - -### Implementation changes - -- Raise `ValueError` when a message is too large for a batch. (#4872) -- Updated the default batch size to 10 MB. (#4857) -- Allow a custom `Event` type in Pub / Sub futures. (#4643) - -### Documentation - -- Clarify that `modify_ack_deadline` resets the deadline. (#4822) - -### Testing - -- Fix unit test for default `max_bytes` value. (#4860) - -## 0.30.1 - -### Notable Implementation Changes - -- Moving lock factory used in publisher client to the Batch - implementation (#4628). -- Use a UUID (rather than a sentinel object) on `Future` (#4634). -- Apply scopes to explicitly provided credentials if needed (#4594). - Fixes #4479. This feature comes as part of `google-api-core==0.1.3`. - -### Dependencies - -- Upgrading to `google-api-core==0.1.3` which depends on the latest - `grpcio==1.8.2` (#4642). This fixes #4600. For details, see related - gRPC [bug](https://github.com/grpc/grpc/issues/9688) and - [fix](https://github.com/grpc/grpc/pull/13665). - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.30.1/ - -## 0.30.0 - -### Notable Implementation Changes - -- Dropping redundant `Policy._paused` data member (#4568). -- Removing redundant "active" check in policy (#4603). -- Adding a `Consumer.active` property (#4604). -- Making it impossible to call `Policy.open()` on an already opened - policy (#4606). -- **Bug fix** (#4575): Fix bug with async publish for batches. There - were two related bugs. The first: if a batch exceeds the `max_messages` - from the batch settings, then the `commit()` will fail. The second: - when a "monitor" worker calls `commit()` after `max_latency` seconds, - a failure can occur if a new message is added to the batch **during** - the commit. To fix, the following changes were implemented: - - Adding a "STARTING" status for `Batch.commit()` (#4614). This - fixes the issue when the batch exceeds `max_messages`. - - Adding extra check in `Batch.will_accept` for the number of - messages (#4612). - - Moving `will_accept()` check out of `PublisherClient.batch()` - factory (#4613). - - Checking `Batch.will_accept` in thread-safe way (#4616). -- **Breaking API change**: As part of #4613, changing `PublisherClient.batch()` - to no longer accept a `message` (since the `will_accept` check needs to - happen in a more concurrency friendly way). In addition, changing the - `create` argument so that it means "create even if batch already exists" - rather than "create if missing". - -### Documentation - -- Add more explicit documentation for `Message.attributes` (#4601). -- Make `Message.__repr__` a bit prettier / more useful (#4602). - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.30.0/ - -## 0.29.4 - -### Notable Implementation Changes - -- **Bug fix**: Restore previous behavior of the subscription lease - maintenance worker. This was accidentally "stopped" in `0.29.3` - due to a change in implementation that went from an `active` - boolean to an "inactive" / `stopped` boolean, so `True` became - `False` and vice-versa (#4564). - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.29.4/ - -## 0.29.3 - -### Notable Implementation Changes - -- In subscription consumer thread: Making sure the request generator - attached to an inactive bidirectional streaming pull is stopped before - spawning a new request generator. This way we have a (fairly strong) - guarantee that requests in the queue don't get sent into an inactive - stream (#4503, #4554). -- Adding `pause` / `resume` to subscription consumer thread and using these - methods during flow control. The previous implementation tried to close the - subscription (which involved 3 worker threads and 10 executors in a thread - pool) and then re-open a new subscription. But, this was not entirely - possible to shut down correctly from **within** one of the worker threads. - Instead, we only pause the worker (of the 3) that is pulling new responses - from the bidirectional streaming pull (#4558). -- **Bug fix** (#4516): Using `max` where `min` was used by mistake to - ensure the number of bytes tracked for subscription flow control - remained non-negative (#4514). -- Raising `TypeError` if `SubscriberClient.subscribe` receives a - non-callable callback (#4497). -- Shutting down thread pool executor when closing a subscriber - policy (#4522). -- Renaming `Policy.on_callback_request` to `Policy.dispatch_callback` - and making the behavior much less dynamic (#4511). -- Make sure subscription consumer thread doesn't try to join itself - when exiting in error (#4540). - -### Dependencies - -- Upgrading `google-api-core` dependency to latest revision (`0.1.2`) - since we rely on the latest version of the `concurrent.futures` backport - to provide the `thread_name_prefix` argument for thread pool - executor (#4521, #4559). - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.29.3/ - -## 0.29.2 - -### Notable Implementation Changes - -- **Bug fix** (#4463): Making a subscription consumer actually stop - running after encountering an exception (#4472, #4498). This bug - is the **only** reason for the `0.29.2` release. -- Thread Changes - - Added names to all threads created directly by Pub / Sub (#4474, - #4476, #4480). Also removing spaces and colons from thread - names (#4476). -- Logging changes - - Adding debug logs when lease management exits (#4484) - - Adding debug logs when `QueueCallbackThread` exits (#4494). - Instances handle the processing of messages in a - subscription (e.g. to `ack`). - - Using a named logger in `publisher.batch.thread` (#4473) - - Adding newlines before logging protobuf payloads (#4471) - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.29.2/ - -## 0.29.1 - -### Notable Implementation Changes - -- **Bug fix** (#4234): Adding retries for connection `UNAVAILABLE`. This - bug made the Pub / Sub client mostly unusable for subscribers to topics - that don't have a steady stream of messages. After ~2 minutes of inactivity, - the gRPC connection would timeout and raise `UNAVAILABLE` locally, i.e. not - due to a response from the backend. (#4444) -- Updating autogenerated packages (#4438) - -### Documentation - -- Fixing broken examples in quick start (#4398) -- Fixing broken example in README (#4402, h/t to @mehmetboraezer) -- Updating old/dead link to usage doc in README (#4406, h/t to @mehmetboraezer) - -### Dependencies - -- Dropping dependency on `google-cloud-core` in exchange for - `google-api-core` (#4438) - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.29.1/ - -## 0.29.0 - -### Notable Implementation Changes - -- Honor `max_messages` always (#4262) -- Add futures for subscriptions (#4265) -- Set gRPC message options and keepalive (#4269) - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) -- Deferring to `google-api-core` for `grpcio` and - `googleapis-common-protos`dependencies (#4096, #4098) - -PyPI: https://pypi.org/project/google-cloud-pubsub/0.29.0/ diff --git a/pubsub/LICENSE b/pubsub/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/pubsub/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/pubsub/MANIFEST.in b/pubsub/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/pubsub/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/pubsub/README.rst b/pubsub/README.rst deleted file mode 100644 index a92a43087052..000000000000 --- a/pubsub/README.rst +++ /dev/null @@ -1,229 +0,0 @@ -Python Client for Google Cloud Pub / Sub -======================================== - -|GA| |pypi| |versions| - -`Google Cloud Pub / Sub`_ is a fully-managed real-time messaging service that -allows you to send and receive messages between independent applications. You -can leverage Cloud Pub/Sub’s flexibility to decouple systems and components -hosted on Google Cloud Platform or elsewhere on the Internet. By building on -the same technology Google uses, Cloud Pub / Sub is designed to provide “at -least once” delivery at low latency with on-demand scalability to 1 million -messages per second (and beyond). - -Publisher applications can send messages to a ``topic`` and other applications -can subscribe to that topic to receive the messages. By decoupling senders and -receivers, Google Cloud Pub/Sub allows developers to communicate between -independently written applications. - -- `Product Documentation`_ -- `Client Library Documentation`_ - -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#general-availability -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-pubsub.svg - :target: https://pypi.org/project/google-cloud-pubsub/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-pubsub.svg - :target: https://pypi.org/project/google-cloud-pubsub/ -.. _Google Cloud Pub / Sub: https://cloud.google.com/pubsub/ -.. _Product Documentation: https://cloud.google.com/pubsub/docs -.. _Client Library Documentation: https://googleapis.dev/python/pubsub/latest - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Pub / Sub API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Pub / Sub API.: https://cloud.google.com/pubsub -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-pubsub - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-pubsub - - -Example Usage -~~~~~~~~~~~~~ - -Publishing -^^^^^^^^^^ - -To publish data to Cloud Pub/Sub you must create a topic, and then publish -messages to it - -.. code-block:: python - - import os - from google.cloud import pubsub_v1 - - publisher = pubsub_v1.PublisherClient() - topic_name = 'projects/{project_id}/topics/{topic}'.format( - project_id=os.getenv('GOOGLE_CLOUD_PROJECT'), - topic='MY_TOPIC_NAME', # Set this to something appropriate. - ) - publisher.create_topic(topic_name) - publisher.publish(topic_name, b'My first message!', spam='eggs') - -To learn more, consult the `publishing documentation`_. - -.. _publishing documentation: https://googleapis.dev/python/pubsub/latest - - -Subscribing -^^^^^^^^^^^ - -To subscribe to data in Cloud Pub/Sub, you create a subscription based on -the topic, and subscribe to that, passing a callback function. - -.. code-block:: python - - import os - from google.cloud import pubsub_v1 - - subscriber = pubsub_v1.SubscriberClient() - topic_name = 'projects/{project_id}/topics/{topic}'.format( - project_id=os.getenv('GOOGLE_CLOUD_PROJECT'), - topic='MY_TOPIC_NAME', # Set this to something appropriate. - ) - subscription_name = 'projects/{project_id}/subscriptions/{sub}'.format( - project_id=os.getenv('GOOGLE_CLOUD_PROJECT'), - sub='MY_SUBSCRIPTION_NAME', # Set this to something appropriate. - ) - subscriber.create_subscription( - name=subscription_name, topic=topic_name) - - def callback(message): - print(message.data) - message.ack() - - future = subscriber.subscribe(subscription_name, callback) - -The future returned by the call to ``subscriber.subscribe`` can be used to -block the current thread until a given condition obtains: - -.. code-block:: python - - try: - future.result() - except KeyboardInterrupt: - future.cancel() - -It is also possible to pull messages in a synchronous (blocking) fashion. To -learn more about subscribing, consult the `subscriber documentation`_. - -.. _subscriber documentation: https://googleapis.dev/python/pubsub/latest - - -Authentication -^^^^^^^^^^^^^^ - -It is possible to specify the authentication method to use with the Pub/Sub -clients. This can be done by providing an explicit `Credentials`_ instance. Support -for various authentication methods is available from the `google-auth`_ library. - -For example, to use JSON Web Tokens, provide a `google.auth.jwt.Credentials`_ instance: - -.. code-block:: python - - import json - from google.auth import jwt - - service_account_info = json.load(open("service-account-info.json")) - audience = "https://pubsub.googleapis.com/google.pubsub.v1.Subscriber" - - credentials = jwt.Credentials.from_service_account_info( - service_account_info, audience=audience - ) - - subscriber = pubsub_v1.SubscriberClient(credentials=credentials) - - # The same for the publisher, except that the "audience" claim needs to be adjusted - publisher_audience = "https://pubsub.googleapis.com/google.pubsub.v1.Publisher" - credentials_pub = credentials.with_claims(audience=publisher_audience) - publisher = pubsub_v1.PublisherClient(credentials=credentials_pub) - -.. _Credentials: https://google-auth.readthedocs.io/en/latest/reference/google.auth.credentials.html#google.auth.credentials.Credentials -.. _google-auth: https://google-auth.readthedocs.io/en/latest/index.html -.. _google.auth.jwt.Credentials: https://google-auth.readthedocs.io/en/latest/reference/google.auth.jwt.html#google.auth.jwt.Credentials - - -Versioning ----------- - -This library follows `Semantic Versioning`_. - -It is currently in major version one (1.y.z), which means that the public API should be considered stable. - -.. _Semantic Versioning: http://semver.org/ - -Contributing ------------- - -Contributions to this library are always welcome and highly encouraged. - -See the `CONTRIBUTING doc`_ for more information on how to get started. - -.. _CONTRIBUTING doc: https://github.com/googleapis/google-cloud-python/blob/master/CONTRIBUTING.rst - -Community ---------- - -Google Cloud Platform Python developers hang out in `Slack`_ in the ``#python`` -channel, click here to `get an invitation`_. - -.. _Slack: https://googlecloud-community.slack.com -.. _get an invitation: https://gcp-slack.appspot.com/ - -License -------- - -Apache 2.0 - See `the LICENSE`_ for more information. - -.. _the LICENSE: https://github.com/googleapis/google-cloud-python/blob/master/LICENSE diff --git a/pubsub/docs/README.rst b/pubsub/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/pubsub/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/pubsub/docs/_static/custom.css b/pubsub/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/pubsub/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/pubsub/docs/_templates/layout.html b/pubsub/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/pubsub/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/pubsub/docs/changelog.md b/pubsub/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/pubsub/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/pubsub/docs/conf.py b/pubsub/docs/conf.py deleted file mode 100644 index 778fe480b370..000000000000 --- a/pubsub/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-pubsub documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-pubsub" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-pubsub-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-pubsub.tex", - u"google-cloud-pubsub Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-pubsub", - u"google-cloud-pubsub Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-pubsub", - u"google-cloud-pubsub Documentation", - author, - "google-cloud-pubsub", - "GAPIC library for the {metadata.shortName} service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/pubsub/docs/index.rst b/pubsub/docs/index.rst deleted file mode 100644 index 5f6f8d4d26d1..000000000000 --- a/pubsub/docs/index.rst +++ /dev/null @@ -1,22 +0,0 @@ -.. include:: README.rst - -API Documentation ------------------ - -.. toctree:: - :maxdepth: 3 - - publisher/index - subscriber/index - types - -Changelog ---------- - -For a list of all ``google-cloud-pubsub`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog - diff --git a/pubsub/docs/publisher/api/client.rst b/pubsub/docs/publisher/api/client.rst deleted file mode 100644 index 47a3aa3d5d7a..000000000000 --- a/pubsub/docs/publisher/api/client.rst +++ /dev/null @@ -1,6 +0,0 @@ -Publisher Client API -==================== - -.. automodule:: google.cloud.pubsub_v1.publisher.client - :members: - :inherited-members: diff --git a/pubsub/docs/publisher/api/futures.rst b/pubsub/docs/publisher/api/futures.rst deleted file mode 100644 index b02b9bf9039d..000000000000 --- a/pubsub/docs/publisher/api/futures.rst +++ /dev/null @@ -1,6 +0,0 @@ -Futures -======= - -.. automodule:: google.cloud.pubsub_v1.publisher.futures - :members: - :inherited-members: diff --git a/pubsub/docs/publisher/index.rst b/pubsub/docs/publisher/index.rst deleted file mode 100644 index 2a785359c443..000000000000 --- a/pubsub/docs/publisher/index.rst +++ /dev/null @@ -1,138 +0,0 @@ -Publishing Messages -=================== - -Publishing messages is handled through the -:class:`~.pubsub_v1.publisher.client.Client` class (aliased as -``google.cloud.pubsub.PublisherClient``). This class provides methods to -create topics, and (most importantly) a -:meth:`~.pubsub_v1.publisher.client.Client.publish` method that publishes -messages to Pub/Sub. - -Instantiating a publishing client is straightforward: - -.. code-block:: python - - from google.cloud import pubsub - publish_client = pubsub.PublisherClient() - - -Publish a Message ------------------ - -To publish a message, use the -:meth:`~.pubsub_v1.publisher.client.Client.publish` method. This method accepts -two positional arguments: the topic to publish to, and the body of the message. -It also accepts arbitrary keyword arguments, which are passed along as -attributes of the message. - -The topic is passed along as a string; all topics have the canonical form of -``projects/{project_name}/topics/{topic_name}``. - -Therefore, a very basic publishing call looks like: - -.. code-block:: python - - topic = 'projects/{project}/topics/{topic}' - publish_client.publish(topic, b'This is my message.') - -.. note:: - - The message data in Pub/Sub is an opaque blob of bytes, and as such, you - *must* send a ``bytes`` object in Python 3 (``str`` object in Python 2). - If you send a text string (``str`` in Python 3, ``unicode`` in Python 2), - the method will raise :exc:`TypeError`. - - The reason it works this way is because there is no reasonable guarantee - that the same language or environment is being used by the subscriber, - and so it is the responsibility of the publisher to properly encode - the payload. - -If you want to include attributes, simply add keyword arguments: - -.. code-block:: python - - topic = 'projects/{project}/topics/{topic}' - publish_client.publish(topic, b'This is my message.', foo='bar') - - -Batching --------- - -Whenever you publish a message, the publisher will automatically batch the -messages over a small time window to avoid making too many separate requests to -the service. This helps increase throughput. - -.. note:: - - By default, this uses ``threading``, and you will need to be in an - environment with threading enabled. It is possible to provide an - alternative batch class that uses another concurrency strategy. - -The way that this works is that on the first message that you send, a new batch -is created automatically. For every subsequent message, if there is already a -valid batch that is still accepting messages, then that batch is used. When the -batch is created, it begins a countdown that publishes the batch once -sufficient time has elapsed (by default, this is 0.05 seconds). - -If you need different batching settings, simply provide a -:class:`~.pubsub_v1.types.BatchSettings` object when you instantiate the -:class:`~.pubsub_v1.publisher.client.Client`: - -.. code-block:: python - - from google.cloud import pubsub - from google.cloud.pubsub import types - - client = pubsub.PublisherClient( - batch_settings=types.BatchSettings(max_messages=500), - ) - -Pub/Sub accepts a maximum of 1,000 messages in a batch, and the size of a -batch can not exceed 10 megabytes. - - -Futures -------- - -Every call to :meth:`~.pubsub_v1.publisher.client.Client.publish` returns -an instance of :class:`~.pubsub_v1.publisher.futures.Future`. - -.. note:: - - The returned future conforms for the most part to the interface of - the standard library's :class:`~concurrent.futures.Future`, but might not - be usable in all cases which expect that exact implementaton. - -You can use this to ensure that the publish succeeded: - -.. code-block:: python - - # The .result() method will block until the future is complete. - # If there is an error, it will raise an exception. - future = client.publish(topic, b'My awesome message.') - message_id = future.result() - -You can also attach a callback to the future: - -.. code-block:: python - - # Callbacks receive the future as their only argument, as defined in - # the Future interface. - def callback(future): - message_id = future.result() - do_something_with(message_id) - - # The callback is added once you get the future. If you add a callback - # and the future is already done, it will simply be executed immediately. - future = client.publish(topic, b'My awesome message.') - future.add_done_callback(callback) - - -API Reference -------------- - -.. toctree:: - :maxdepth: 2 - - api/client - api/futures diff --git a/pubsub/docs/subscriber/api/client.rst b/pubsub/docs/subscriber/api/client.rst deleted file mode 100644 index 965880c5a640..000000000000 --- a/pubsub/docs/subscriber/api/client.rst +++ /dev/null @@ -1,6 +0,0 @@ -Subscriber Client API -===================== - -.. automodule:: google.cloud.pubsub_v1.subscriber.client - :members: - :inherited-members: diff --git a/pubsub/docs/subscriber/api/futures.rst b/pubsub/docs/subscriber/api/futures.rst deleted file mode 100644 index fb0264279cf6..000000000000 --- a/pubsub/docs/subscriber/api/futures.rst +++ /dev/null @@ -1,6 +0,0 @@ -Futures -======= - -.. automodule:: google.cloud.pubsub_v1.subscriber.futures - :members: - :inherited-members: diff --git a/pubsub/docs/subscriber/api/message.rst b/pubsub/docs/subscriber/api/message.rst deleted file mode 100644 index cc5b0e37c9b4..000000000000 --- a/pubsub/docs/subscriber/api/message.rst +++ /dev/null @@ -1,5 +0,0 @@ -Messages -======== - -.. autoclass:: google.cloud.pubsub_v1.subscriber.message.Message - :members: diff --git a/pubsub/docs/subscriber/api/scheduler.rst b/pubsub/docs/subscriber/api/scheduler.rst deleted file mode 100644 index 06e839f219e6..000000000000 --- a/pubsub/docs/subscriber/api/scheduler.rst +++ /dev/null @@ -1,6 +0,0 @@ -Scheduler -========= - -.. automodule:: google.cloud.pubsub_v1.subscriber.scheduler - :members: - :inherited-members: diff --git a/pubsub/docs/subscriber/index.rst b/pubsub/docs/subscriber/index.rst deleted file mode 100644 index d3d1cb5415b5..000000000000 --- a/pubsub/docs/subscriber/index.rst +++ /dev/null @@ -1,190 +0,0 @@ -Subscribing to Messages -======================= - -Subscribing to messages is handled through the -:class:`~.pubsub_v1.subscriber.client.Client` class (aliased as -``google.cloud.pubsub.SubscriberClient``). This class provides a -:meth:`~.pubsub_v1.subscriber.client.Client.subscribe` method to -attach to subscriptions on existing topics. - -Instantiating a subscriber client is straightforward: - -.. code-block:: python - - from google.cloud import pubsub - subscriber = pubsub.SubscriberClient() - - -Creating a Subscription ------------------------ - -In Pub/Sub, a **subscription** is a discrete pull of messages from a topic. -If multiple clients pull the same subscription, then messages are split -between them. If multiple clients create a subscription each, then each client -will get every message. - -.. note:: - - Remember that Pub/Sub operates under the principle of "everything at least - once". Even in the case where multiple clients pull the same subscription, - *some* redundancy is likely. - -Creating a subscription requires that you already know what topic you want -to subscribe to, and it must already exist. Once you have that, it is easy: - -.. code-block:: python - - # Substitute PROJECT, SUBSCRIPTION, and TOPIC with appropriate values for - # your application. - sub_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION) - topic_path = subscriber.topic_path(PROJECT, TOPIC) - subscriber.create_subscription(sub_path, topic_path) - -Once you have created a subscription (or if you already had one), the next -step is to pull data from it. - - -Pulling a Subscription Synchronously ------------------------------------- - -To pull the messages synchronously, use the client's -:meth:`~.pubsub_v1.subscriber.client.Client.pull` method. - -.. code-block:: python - - # Substitute PROJECT and SUBSCRIPTION with appropriate values for your - # application. - subscription_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION) - response = subscriber.pull(subscription_path, max_messages=5) - - for msg in response.received_messages: - print("Received message:", msg.message.data) - - ack_ids = [msg.ack_id for msg in response.received_messages] - subscriber.acknowledge(subscription_path, ack_ids) - -The method returns a :class:`~.pubsub_v1.types.PullResponse` instance that -cointains a list of received :class:`~.pubsub_v1.types.ReceivedMessage` -instances. - - -Pulling a Subscription Asynchronously -------------------------------------- - -The subscriber client uses the -:meth:`~.pubsub_v1.subscriber.client.Client.subscribe` method to start a -background thread to receive messages from Pub/Sub and calls a callback with -each message received. - -.. code-block:: python - - # Substitute PROJECT and SUBSCRIPTION with appropriate values for your - # application. - subscription_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION) - future = subscriber.subscribe(subscription_path, callback) - -This will return a -:class:`~.pubsub_v1.subscriber.futures.StreamingPullFuture`. This future allows -you to control the background thread that is managing the subscription. - - -Subscription Callbacks ----------------------- - -Messages received from a subscription are processed asynchronously through -**callbacks**. - -The basic idea: Define a function that takes one argument; this argument -will be a :class:`~.pubsub_v1.subscriber.message.Message` instance, which is -a convenience wrapper around the :class:`~.pubsub_v1.types.PubsubMessage` -instance received from the server (and stored under the ``message`` attribute). - -This function should do whatever processing is necessary. At the end, the -function should either :meth:`~.pubsub_v1.subscriber.message.Message.ack` -or :meth:`~.pubsub_v1.subscriber.message.Message.nack` the message. - -When you call :meth:`~.pubsub_v1.subscriber.client.Client.subscribe`, you -must pass the callback that will be used. - -Here is an example: - -.. code-block:: python - - # Define the callback. - # Note that the callback is defined *before* the subscription is opened. - def callback(message): - do_something_with(message) # Replace this with your actual logic. - message.ack() # Asynchronously acknowledge the message. - - # Substitute PROJECT and SUBSCRIPTION with appropriate values for your - # application. - subscription_path = subscriber.subscription_path(PROJECT, SUBSCRIPTION) - - # Open the subscription, passing the callback. - future = subscriber.subscribe(subscription_path, callback) - -The :meth:`~.pubsub_v1.subscriber.client.Client.subscribe` method returns -a :class:`~.pubsub_v1.subscriber.futures.StreamingPullFuture`, which is both -the interface to wait on messages (e.g. block the primary thread) and to -address exceptions. - -To block the thread you are in while messages are coming in the stream, -use the :meth:`~.pubsub_v1.subscriber.futures.Future.result` method: - -.. code-block:: python - - future.result() - -.. note: This will block forever assuming no errors or that ``cancel`` is never - called. - -You can also use this for error handling; any exceptions that crop up on a -thread will be set on the future. - -.. code-block:: python - - try: - future.result() - except Exception as ex: - subscription.close() - raise - -Finally, you can use -:meth:`~.pubsub_v1.subscriber.futures.StreamingPullFuture.cancel` to stop -receiving messages. - - -.. code-block:: python - - future.cancel() - - -Explaining Ack --------------- - -In Pub/Sub, the term **ack** stands for "acknowledge". You should ack a -message when your processing of that message *has completed*. When you ack -a message, you are telling Pub/Sub that you do not need to see it again. - -It might be tempting to ack messages immediately on receipt. While there -are valid use cases for this, in general it is unwise. The reason why: If -there is some error or edge case in your processing logic, and processing -of the message fails, you will have already told Pub/Sub that you successfully -processed the message. By contrast, if you ack only upon completion, then -Pub/Sub will eventually re-deliver the unacknowledged message. - -It is also possible to **nack** a message, which is the opposite. When you -nack, it tells Pub/Sub that you are unable or unwilling to deal with the -message, and that the service should redeliver it. - - -API Reference -------------- - -.. toctree:: - :maxdepth: 2 - - api/client - api/message - api/futures - api/scheduler diff --git a/pubsub/docs/types.rst b/pubsub/docs/types.rst deleted file mode 100644 index 87c987571766..000000000000 --- a/pubsub/docs/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Pub/Sub Client Types -==================== - -.. automodule:: google.cloud.pubsub_v1.types - :members: diff --git a/pubsub/google/__init__.py b/pubsub/google/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/pubsub/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/pubsub/google/cloud/__init__.py b/pubsub/google/cloud/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/pubsub/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/pubsub/google/cloud/pubsub.py b/pubsub/google/cloud/pubsub.py deleted file mode 100644 index b9f92e991aa6..000000000000 --- a/pubsub/google/cloud/pubsub.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.pubsub_v1 import PublisherClient -from google.cloud.pubsub_v1 import SubscriberClient -from google.cloud.pubsub_v1 import types - - -__all__ = ("types", "PublisherClient", "SubscriberClient") diff --git a/pubsub/google/cloud/pubsub_v1/__init__.py b/pubsub/google/cloud/pubsub_v1/__init__.py deleted file mode 100644 index 67bec51b248b..000000000000 --- a/pubsub/google/cloud/pubsub_v1/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1 import publisher -from google.cloud.pubsub_v1 import subscriber - - -class PublisherClient(publisher.Client): - __doc__ = publisher.Client.__doc__ - - -class SubscriberClient(subscriber.Client): - __doc__ = subscriber.Client.__doc__ - - -__all__ = ("types", "PublisherClient", "SubscriberClient") diff --git a/pubsub/google/cloud/pubsub_v1/_gapic.py b/pubsub/google/cloud/pubsub_v1/_gapic.py deleted file mode 100644 index da755dfbca09..000000000000 --- a/pubsub/google/cloud/pubsub_v1/_gapic.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2019, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import functools - - -def add_methods(source_class, blacklist=()): - """Add wrapped versions of the `api` member's methods to the class. - - Any methods passed in `blacklist` are not added. - Additionally, any methods explicitly defined on the wrapped class are - not added. - """ - - def wrap(wrapped_fx, lookup_fx): - """Wrap a GAPIC method; preserve its name and docstring.""" - # If this is a static or class method, then we do *not* - # send self as the first argument. - # - # For instance methods, we need to send self.api rather - # than self, since that is where the actual methods were declared. - - if isinstance(lookup_fx, (classmethod, staticmethod)): - fx = lambda *a, **kw: wrapped_fx(*a, **kw) # noqa - return staticmethod(functools.wraps(wrapped_fx)(fx)) - else: - fx = lambda self, *a, **kw: wrapped_fx(self.api, *a, **kw) # noqa - return functools.wraps(wrapped_fx)(fx) - - def actual_decorator(cls): - # Reflectively iterate over most of the methods on the source class - # (the GAPIC) and make wrapped versions available on this client. - for name in dir(source_class): - # Ignore all private and magic methods. - if name.startswith("_"): - continue - - # Ignore anything on our blacklist. - if name in blacklist: - continue - - # Retrieve the attribute, and ignore it if it is not callable. - attr = getattr(source_class, name) - if not callable(attr): - continue - - # Add a wrapper method to this object. - lookup_fx = source_class.__dict__[name] - fx = wrap(attr, lookup_fx) - - setattr(cls, name, fx) - - # Return the augmented class. - return cls - - # Simply return the actual decorator; this is returned from this method - # and actually used to decorate the class. - return actual_decorator diff --git a/pubsub/google/cloud/pubsub_v1/exceptions.py b/pubsub/google/cloud/pubsub_v1/exceptions.py deleted file mode 100644 index 5ab750d0477c..000000000000 --- a/pubsub/google/cloud/pubsub_v1/exceptions.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from concurrent.futures import TimeoutError - - -__all__ = ("TimeoutError",) diff --git a/pubsub/google/cloud/pubsub_v1/futures.py b/pubsub/google/cloud/pubsub_v1/futures.py deleted file mode 100644 index ba861e40c653..000000000000 --- a/pubsub/google/cloud/pubsub_v1/futures.py +++ /dev/null @@ -1,186 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import threading -import uuid - -import google.api_core.future -from google.cloud.pubsub_v1.publisher import exceptions - - -class Future(google.api_core.future.Future): - """Encapsulation of the asynchronous execution of an action. - - This object is returned from asychronous Pub/Sub calls, and is the - interface to determine the status of those calls. - - This object should not be created directly, but is returned by other - methods in this library. - - Args: - completed (Optional[Any]): An event, with the same interface as - :class:`threading.Event`. This is provided so that callers - with different concurrency models (e.g. ``threading`` or - ``multiprocessing``) can supply an event that is compatible - with that model. The ``wait()`` and ``set()`` methods will be - used. If this argument is not provided, then a new - :class:`threading.Event` will be created and used. - """ - - # This could be a sentinel object or None, but the sentinel object's ID - # can change if the process is forked, and None has the possibility of - # actually being a result. - _SENTINEL = uuid.uuid4() - - def __init__(self, completed=None): - self._result = self._SENTINEL - self._exception = self._SENTINEL - self._callbacks = [] - if completed is None: - completed = threading.Event() - self._completed = completed - - def cancel(self): - """Actions in Pub/Sub generally may not be canceled. - - This method always returns False. - """ - return False - - def cancelled(self): - """Actions in Pub/Sub generally may not be canceled. - - This method always returns False. - """ - return False - - def running(self): - """Actions in Pub/Sub generally may not be canceled. - - Returns: - bool: ``True`` if this method has not yet completed, or - ``False`` if it has completed. - """ - return not self.done() - - def done(self): - """Return True the future is done, False otherwise. - - This still returns True in failure cases; checking :meth:`result` or - :meth:`exception` is the canonical way to assess success or failure. - """ - return self._exception != self._SENTINEL or self._result != self._SENTINEL - - def result(self, timeout=None): - """Resolve the future and return a value where appropriate. - - Args: - timeout (Union[int, float]): The number of seconds before this call - times out and raises TimeoutError. - - Raises: - concurrent.futures.TimeoutError: If the request times out. - Exception: For undefined exceptions in the underlying - call execution. - """ - # Attempt to get the exception if there is one. - # If there is not one, then we know everything worked, and we can - # return an appropriate value. - err = self.exception(timeout=timeout) - if err is None: - return self._result - raise err - - def exception(self, timeout=None): - """Return the exception raised by the call, if any. - - Args: - timeout (Union[int, float]): The number of seconds before this call - times out and raises TimeoutError. - - Raises: - concurrent.futures.TimeoutError: If the request times out. - - Returns: - Exception: The exception raised by the call, if any. - """ - # Wait until the future is done. - if not self._completed.wait(timeout=timeout): - raise exceptions.TimeoutError("Timed out waiting for result.") - - # If the batch completed successfully, this should return None. - if self._result != self._SENTINEL: - return None - - # Okay, this batch had an error; this should return it. - return self._exception - - def add_done_callback(self, callback): - """Attach the provided callable to the future. - - The provided function is called, with this future as its only argument, - when the future finishes running. - - Args: - callback (Callable): The function to call. - - Returns: - None - """ - if self.done(): - return callback(self) - self._callbacks.append(callback) - - def set_result(self, result): - """Set the result of the future to the provided result. - - Args: - result (Any): The result - """ - # Sanity check: A future can only complete once. - if self.done(): - raise RuntimeError("set_result can only be called once.") - - # Set the result and trigger the future. - self._result = result - self._trigger() - - def set_exception(self, exception): - """Set the result of the future to the given exception. - - Args: - exception (:exc:`Exception`): The exception raised. - """ - # Sanity check: A future can only complete once. - if self.done(): - raise RuntimeError("set_exception can only be called once.") - - # Set the exception and trigger the future. - self._exception = exception - self._trigger() - - def _trigger(self): - """Trigger all callbacks registered to this Future. - - This method is called internally by the batch once the batch - completes. - - Args: - message_id (str): The message ID, as a string. - """ - self._completed.set() - for callback in self._callbacks: - callback(self) diff --git a/pubsub/google/cloud/pubsub_v1/gapic/__init__.py b/pubsub/google/cloud/pubsub_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py b/pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py deleted file mode 100644 index 774fda25d622..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py +++ /dev/null @@ -1,1095 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.pubsub.v1 Publisher API.""" - -import collections -from copy import deepcopy -import functools -import pkg_resources -import six -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.path_template -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.pubsub_v1.gapic import publisher_client_config -from google.cloud.pubsub_v1.gapic.transports import publisher_grpc_transport -from google.cloud.pubsub_v1.proto import pubsub_pb2 -from google.cloud.pubsub_v1.proto import pubsub_pb2_grpc -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import iam_policy_pb2_grpc -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub").version - - -# TODO: remove conditional import after Python 2 support is dropped -if six.PY3: - from collections.abc import Mapping -else: - from collections import Mapping - - -def _merge_dict(d1, d2): - # Modifies d1 in-place to take values from d2 - # if the nested keys from d2 are present in d1. - # https://stackoverflow.com/a/10704003/4488789 - for k, v2 in d2.items(): - v1 = d1.get(k) # returns None if v1 has no such key - if v1 is None: - raise Exception("{} is not recognized by client_config".format(k)) - if isinstance(v1, Mapping) and isinstance(v2, Mapping): - _merge_dict(v1, v2) - else: - d1[k] = v2 - return d1 - - -class PublisherClient(object): - """ - The service that an application uses to manipulate topics, and to send - messages to a topic. - """ - - SERVICE_ADDRESS = "pubsub.googleapis.com:443" - """The default address of the service.""" - - # The scopes needed to make gRPC calls to all of the methods defined in - # this service - _DEFAULT_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub", - ) - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.pubsub.v1.Publisher" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - PublisherClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def topic_path(cls, project, topic): - """Return a fully-qualified topic string.""" - return google.api_core.path_template.expand( - "projects/{project}/topics/{topic}", project=project, topic=topic - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.PublisherGrpcTransport, - Callable[[~.Credentials, type], ~.PublisherGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - default_client_config = deepcopy(publisher_client_config.config) - - if client_config is None: - client_config = default_client_config - else: - client_config = _merge_dict(default_client_config, client_config) - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=publisher_grpc_transport.PublisherGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = publisher_grpc_transport.PublisherGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_topic( - self, - name, - labels=None, - message_storage_policy=None, - kms_key_name=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates the given topic with the given name. See the resource name - rules. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> name = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> response = client.create_topic(name) - - Args: - name (str): The name of the topic. It must have the format - `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - signs (`%`). It must be between 3 and 255 characters in length, and it - must not start with `"goog"`. - labels (dict[str -> str]): See Creating and - managing labels. - message_storage_policy (Union[dict, ~google.cloud.pubsub_v1.types.MessageStoragePolicy]): Policy constraining the set of Google Cloud Platform regions where messages - published to the topic may be stored. If not present, then no constraints - are in effect. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.MessageStoragePolicy` - kms_key_name (str): The resource name of the Cloud KMS CryptoKey to be used to protect - access to messages published on this topic. - - The expected format is - ``projects/*/locations/*/keyRings/*/cryptoKeys/*``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Topic` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_topic" not in self._inner_api_calls: - self._inner_api_calls[ - "create_topic" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_topic, - default_retry=self._method_configs["CreateTopic"].retry, - default_timeout=self._method_configs["CreateTopic"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.Topic( - name=name, - labels=labels, - message_storage_policy=message_storage_policy, - kms_key_name=kms_key_name, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_topic"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_topic( - self, - topic, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an existing topic. Note that certain properties of a - topic are not modifiable. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> # TODO: Initialize `topic`: - >>> topic = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_topic(topic, update_mask) - - Args: - topic (Union[dict, ~google.cloud.pubsub_v1.types.Topic]): The updated topic object. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Topic` - update_mask (Union[dict, ~google.cloud.pubsub_v1.types.FieldMask]): Indicates which fields in the provided topic to update. Must be - specified and non-empty. Note that if ``update_mask`` contains - "message\_storage\_policy" then the new value will be determined based - on the policy configured at the project or organization level. The - ``message_storage_policy`` must not be set in the ``topic`` provided - above. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Topic` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_topic" not in self._inner_api_calls: - self._inner_api_calls[ - "update_topic" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_topic, - default_retry=self._method_configs["UpdateTopic"].retry, - default_timeout=self._method_configs["UpdateTopic"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.UpdateTopicRequest(topic=topic, update_mask=update_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("topic.name", topic.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_topic"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def publish( - self, - topic, - messages, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Adds one or more messages to the topic. Returns ``NOT_FOUND`` if the - topic does not exist. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> data = b'' - >>> messages_element = {'data': data} - >>> messages = [messages_element] - >>> - >>> response = client.publish(topic, messages) - - Args: - topic (str): The messages in the request will be published on this topic. Format is - ``projects/{project}/topics/{topic}``. - messages (list[Union[dict, ~google.cloud.pubsub_v1.types.PubsubMessage]]): The messages to publish. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.PubsubMessage` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.PublishResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "publish" not in self._inner_api_calls: - self._inner_api_calls[ - "publish" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.publish, - default_retry=self._method_configs["Publish"].retry, - default_timeout=self._method_configs["Publish"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.PublishRequest(topic=topic, messages=messages) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("topic", topic)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["publish"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_topic( - self, - topic, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the configuration of a topic. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> response = client.get_topic(topic) - - Args: - topic (str): The name of the topic to get. Format is - ``projects/{project}/topics/{topic}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Topic` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_topic" not in self._inner_api_calls: - self._inner_api_calls[ - "get_topic" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_topic, - default_retry=self._method_configs["GetTopic"].retry, - default_timeout=self._method_configs["GetTopic"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.GetTopicRequest(topic=topic) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("topic", topic)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_topic"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_topics( - self, - project, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists matching topics. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> project = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_topics(project): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_topics(project).pages: - ... for element in page: - ... # process element - ... pass - - Args: - project (str): The name of the project in which to list topics. Format is - ``projects/{project-id}``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.GRPCIterator` instance. - An iterable of :class:`~google.cloud.pubsub_v1.types.Topic` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_topics" not in self._inner_api_calls: - self._inner_api_calls[ - "list_topics" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_topics, - default_retry=self._method_configs["ListTopics"].retry, - default_timeout=self._method_configs["ListTopics"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ListTopicsRequest(project=project, page_size=page_size) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project", project)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_topics"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="topics", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def list_topic_subscriptions( - self, - topic, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists the names of the subscriptions on this topic. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> # Iterate over all results - >>> for element in client.list_topic_subscriptions(topic): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_topic_subscriptions(topic).pages: - ... for element in page: - ... # process element - ... pass - - Args: - topic (str): The name of the topic that subscriptions are attached to. Format is - ``projects/{project}/topics/{topic}``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.GRPCIterator` instance. - An iterable of :class:`str` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_topic_subscriptions" not in self._inner_api_calls: - self._inner_api_calls[ - "list_topic_subscriptions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_topic_subscriptions, - default_retry=self._method_configs["ListTopicSubscriptions"].retry, - default_timeout=self._method_configs["ListTopicSubscriptions"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ListTopicSubscriptionsRequest( - topic=topic, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("topic", topic)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_topic_subscriptions"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="subscriptions", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_topic( - self, - topic, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes the topic with the given name. Returns ``NOT_FOUND`` if the - topic does not exist. After a topic is deleted, a new topic may be - created with the same name; this is an entirely new topic with none of - the old configuration or subscriptions. Existing subscriptions to this - topic are not deleted, but their ``topic`` field is set to - ``_deleted-topic_``. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> client.delete_topic(topic) - - Args: - topic (str): Name of the topic to delete. Format is - ``projects/{project}/topics/{topic}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_topic" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_topic" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_topic, - default_retry=self._method_configs["DeleteTopic"].retry, - default_timeout=self._method_configs["DeleteTopic"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.DeleteTopicRequest(topic=topic) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("topic", topic)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_topic"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_iam_policy( - self, - resource, - policy, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the access control policy on the specified resource. Replaces any - existing policy. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> resource = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> # TODO: Initialize `policy`: - >>> policy = {} - >>> - >>> response = client.set_iam_policy(resource, policy) - - Args: - resource (str): REQUIRED: The resource for which the policy is being specified. - See the operation documentation for the appropriate value for this field. - policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The - size of the policy is limited to a few 10s of KB. An empty policy is a - valid policy but certain Cloud Platform services (such as Projects) - might reject them. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Policy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_iam_policy, - default_retry=self._method_configs["SetIamPolicy"].retry, - default_timeout=self._method_configs["SetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_iam_policy( - self, - resource, - options_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the access control policy for a resource. - Returns an empty policy if the resource exists and does not have a policy - set. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> resource = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> response = client.get_iam_policy(resource) - - Args: - resource (str): REQUIRED: The resource for which the policy is being requested. - See the operation documentation for the appropriate value for this field. - options_ (Union[dict, ~google.cloud.pubsub_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to - ``GetIamPolicy``. This field is only used by Cloud IAM. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.GetPolicyOptions` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_iam_policy, - default_retry=self._method_configs["GetIamPolicy"].retry, - default_timeout=self._method_configs["GetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def test_iam_permissions( - self, - resource, - permissions, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.PublisherClient() - >>> - >>> resource = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> # TODO: Initialize `permissions`: - >>> permissions = [] - >>> - >>> response = client.test_iam_permissions(resource, permissions) - - Args: - resource (str): REQUIRED: The resource for which the policy detail is being requested. - See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more - information see `IAM - Overview `__. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.TestIamPermissionsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "test_iam_permissions" not in self._inner_api_calls: - self._inner_api_calls[ - "test_iam_permissions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.test_iam_permissions, - default_retry=self._method_configs["TestIamPermissions"].retry, - default_timeout=self._method_configs["TestIamPermissions"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["test_iam_permissions"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/pubsub/google/cloud/pubsub_v1/gapic/publisher_client_config.py b/pubsub/google/cloud/pubsub_v1/gapic/publisher_client_config.py deleted file mode 100644 index 055b3424e6cd..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/publisher_client_config.py +++ /dev/null @@ -1,99 +0,0 @@ -config = { - "interfaces": { - "google.pubsub.v1.Publisher": { - "retry_codes": { - "idempotent": ["ABORTED", "UNAVAILABLE", "UNKNOWN"], - "non_idempotent": ["UNAVAILABLE"], - "none": [], - "publish": [ - "ABORTED", - "CANCELLED", - "DEADLINE_EXCEEDED", - "INTERNAL", - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - "UNKNOWN", - ], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - }, - "messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.3, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 60000, - }, - }, - "methods": { - "CreateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateTopic": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "Publish": { - "timeout_millis": 60000, - "retry_codes_name": "publish", - "retry_params_name": "messaging", - "bundling": { - "element_count_threshold": 100, - "element_count_limit": 1000, - "request_byte_threshold": 1048576, - "request_byte_limit": 10485760, - "delay_threshold_millis": 10, - }, - }, - "GetTopic": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListTopics": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListTopicSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteTopic": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py b/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py deleted file mode 100644 index 0ecce7ac9d1c..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py +++ /dev/null @@ -1,1885 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.pubsub.v1 Subscriber API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.pubsub_v1.gapic import subscriber_client_config -from google.cloud.pubsub_v1.gapic.transports import subscriber_grpc_transport -from google.cloud.pubsub_v1.proto import pubsub_pb2 -from google.cloud.pubsub_v1.proto import pubsub_pb2_grpc -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import iam_policy_pb2_grpc -from google.iam.v1 import options_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub").version - - -class SubscriberClient(object): - """ - The service that an application uses to manipulate subscriptions and to - consume messages from a subscription via the ``Pull`` method or by - establishing a bi-directional stream using the ``StreamingPull`` method. - """ - - SERVICE_ADDRESS = "pubsub.googleapis.com:443" - """The default address of the service.""" - - # The scopes needed to make gRPC calls to all of the methods defined in - # this service - _DEFAULT_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub", - ) - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.pubsub.v1.Subscriber" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - SubscriberClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def snapshot_path(cls, project, snapshot): - """Return a fully-qualified snapshot string.""" - return google.api_core.path_template.expand( - "projects/{project}/snapshots/{snapshot}", - project=project, - snapshot=snapshot, - ) - - @classmethod - def subscription_path(cls, project, subscription): - """Return a fully-qualified subscription string.""" - return google.api_core.path_template.expand( - "projects/{project}/subscriptions/{subscription}", - project=project, - subscription=subscription, - ) - - @classmethod - def topic_path(cls, project, topic): - """Return a fully-qualified topic string.""" - return google.api_core.path_template.expand( - "projects/{project}/topics/{topic}", project=project, topic=topic - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.SubscriberGrpcTransport, - Callable[[~.Credentials, type], ~.SubscriberGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = subscriber_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=subscriber_grpc_transport.SubscriberGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = subscriber_grpc_transport.SubscriberGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_subscription( - self, - name, - topic, - push_config=None, - ack_deadline_seconds=None, - retain_acked_messages=None, - message_retention_duration=None, - labels=None, - enable_message_ordering=None, - expiration_policy=None, - dead_letter_policy=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a subscription to a given topic. See the resource name rules. If - the subscription already exists, returns ``ALREADY_EXISTS``. If the - corresponding topic doesn't exist, returns ``NOT_FOUND``. - - If the name is not provided in the request, the server will assign a - random name for this subscription on the same project as the topic, - conforming to the `resource name - format `__. - The generated name is populated in the returned Subscription object. - Note that for REST API requests, you must specify a name in the request. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> name = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> - >>> response = client.create_subscription(name, topic) - - Args: - name (str): The name of the subscription. It must have the format - `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - start with a letter, and contain only letters (`[A-Za-z]`), numbers - (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - in length, and it must not start with `"goog"` - topic (str): The name of the topic from which this subscription is receiving - messages. Format is ``projects/{project}/topics/{topic}``. The value of - this field will be ``_deleted-topic_`` if the topic has been deleted. - push_config (Union[dict, ~google.cloud.pubsub_v1.types.PushConfig]): If push delivery is used with this subscription, this field is used to - configure it. An empty ``pushConfig`` signifies that the subscriber will - pull and ack messages using API methods. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.PushConfig` - ack_deadline_seconds (int): The approximate amount of time (on a best-effort basis) Pub/Sub waits - for the subscriber to acknowledge receipt before resending the message. - In the interval after the message is delivered and before it is - acknowledged, it is considered to be outstanding. During that time - period, the message will not be redelivered (on a best-effort basis). - - For pull subscriptions, this value is used as the initial value for the - ack deadline. To override this value for a given message, call - ``ModifyAckDeadline`` with the corresponding ``ack_id`` if using - non-streaming pull or send the ``ack_id`` in a - ``StreamingModifyAckDeadlineRequest`` if using streaming pull. The - minimum custom deadline you can specify is 10 seconds. The maximum - custom deadline you can specify is 600 seconds (10 minutes). If this - parameter is 0, a default value of 10 seconds is used. - - For push delivery, this value is also used to set the request timeout - for the call to the push endpoint. - - If the subscriber never acknowledges the message, the Pub/Sub system - will eventually redeliver the message. - retain_acked_messages (bool): Indicates whether to retain acknowledged messages. If true, then - messages are not expunged from the subscription's backlog, even if they - are acknowledged, until they fall out of the - ``message_retention_duration`` window. This must be true if you would - like to Seek to a timestamp. - message_retention_duration (Union[dict, ~google.cloud.pubsub_v1.types.Duration]): How long to retain unacknowledged messages in the subscription's - backlog, from the moment a message is published. If - ``retain_acked_messages`` is true, then this also configures the - retention of acknowledged messages, and thus configures how far back in - time a ``Seek`` can be done. Defaults to 7 days. Cannot be more than 7 - days or less than 10 minutes. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Duration` - labels (dict[str -> str]): See Creating and - managing labels. - enable_message_ordering (bool): If true, messages published with the same ``ordering_key`` in - ``PubsubMessage`` will be delivered to the subscribers in the order in - which they are received by the Pub/Sub system. Otherwise, they may be - delivered in any order. EXPERIMENTAL: This feature is part of a closed - alpha release. This API might be changed in backward-incompatible ways - and is not recommended for production use. It is not subject to any SLA - or deprecation policy. - expiration_policy (Union[dict, ~google.cloud.pubsub_v1.types.ExpirationPolicy]): A policy that specifies the conditions for this subscription's - expiration. A subscription is considered active as long as any connected - subscriber is successfully consuming messages from the subscription or - is issuing operations on the subscription. If ``expiration_policy`` is - not set, a *default policy* with ``ttl`` of 31 days will be used. The - minimum allowed value for ``expiration_policy.ttl`` is 1 day. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.ExpirationPolicy` - dead_letter_policy (Union[dict, ~google.cloud.pubsub_v1.types.DeadLetterPolicy]): A policy that specifies the conditions for dead lettering messages in - this subscription. If dead\_letter\_policy is not set, dead lettering is - disabled. - - The Cloud Pub/Sub service account associated with this subscriptions's - parent project (i.e., - service-{project\_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must - have permission to Acknowledge() messages on this subscription. - EXPERIMENTAL: This feature is part of a closed alpha release. This API - might be changed in backward-incompatible ways and is not recommended - for production use. It is not subject to any SLA or deprecation policy. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.DeadLetterPolicy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Subscription` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_subscription" not in self._inner_api_calls: - self._inner_api_calls[ - "create_subscription" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_subscription, - default_retry=self._method_configs["CreateSubscription"].retry, - default_timeout=self._method_configs["CreateSubscription"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.Subscription( - name=name, - topic=topic, - push_config=push_config, - ack_deadline_seconds=ack_deadline_seconds, - retain_acked_messages=retain_acked_messages, - message_retention_duration=message_retention_duration, - labels=labels, - enable_message_ordering=enable_message_ordering, - expiration_policy=expiration_policy, - dead_letter_policy=dead_letter_policy, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_subscription"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_subscription( - self, - subscription, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the configuration details of a subscription. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> response = client.get_subscription(subscription) - - Args: - subscription (str): The name of the subscription to get. Format is - ``projects/{project}/subscriptions/{sub}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Subscription` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_subscription" not in self._inner_api_calls: - self._inner_api_calls[ - "get_subscription" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_subscription, - default_retry=self._method_configs["GetSubscription"].retry, - default_timeout=self._method_configs["GetSubscription"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.GetSubscriptionRequest(subscription=subscription) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_subscription"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_subscription( - self, - subscription, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an existing subscription. Note that certain properties of a - subscription, such as its topic, are not modifiable. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> ack_deadline_seconds = 42 - >>> subscription = {'ack_deadline_seconds': ack_deadline_seconds} - >>> paths_element = 'ack_deadline_seconds' - >>> paths = [paths_element] - >>> update_mask = {'paths': paths} - >>> - >>> response = client.update_subscription(subscription, update_mask) - - Args: - subscription (Union[dict, ~google.cloud.pubsub_v1.types.Subscription]): The updated subscription object. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Subscription` - update_mask (Union[dict, ~google.cloud.pubsub_v1.types.FieldMask]): Indicates which fields in the provided subscription to update. - Must be specified and non-empty. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Subscription` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_subscription" not in self._inner_api_calls: - self._inner_api_calls[ - "update_subscription" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_subscription, - default_retry=self._method_configs["UpdateSubscription"].retry, - default_timeout=self._method_configs["UpdateSubscription"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.UpdateSubscriptionRequest( - subscription=subscription, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription.name", subscription.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_subscription"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_subscriptions( - self, - project, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists matching subscriptions. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> project = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_subscriptions(project): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_subscriptions(project).pages: - ... for element in page: - ... # process element - ... pass - - Args: - project (str): The name of the project in which to list subscriptions. Format is - ``projects/{project-id}``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.GRPCIterator` instance. - An iterable of :class:`~google.cloud.pubsub_v1.types.Subscription` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_subscriptions" not in self._inner_api_calls: - self._inner_api_calls[ - "list_subscriptions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_subscriptions, - default_retry=self._method_configs["ListSubscriptions"].retry, - default_timeout=self._method_configs["ListSubscriptions"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ListSubscriptionsRequest( - project=project, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project", project)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_subscriptions"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="subscriptions", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def delete_subscription( - self, - subscription, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes an existing subscription. All messages retained in the - subscription are immediately dropped. Calls to ``Pull`` after deletion - will return ``NOT_FOUND``. After a subscription is deleted, a new one - may be created with the same name, but the new one has no association - with the old subscription or its topic unless the same topic is - specified. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> client.delete_subscription(subscription) - - Args: - subscription (str): The subscription to delete. Format is - ``projects/{project}/subscriptions/{sub}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_subscription" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_subscription" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_subscription, - default_retry=self._method_configs["DeleteSubscription"].retry, - default_timeout=self._method_configs["DeleteSubscription"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.DeleteSubscriptionRequest(subscription=subscription) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_subscription"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def modify_ack_deadline( - self, - subscription, - ack_ids, - ack_deadline_seconds, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Modifies the ack deadline for a specific message. This method is useful - to indicate that more time is needed to process a message by the - subscriber, or to make the message available for redelivery if the - processing was interrupted. Note that this does not modify the - subscription-level ``ackDeadlineSeconds`` used for subsequent messages. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `ack_ids`: - >>> ack_ids = [] - >>> - >>> # TODO: Initialize `ack_deadline_seconds`: - >>> ack_deadline_seconds = 0 - >>> - >>> client.modify_ack_deadline(subscription, ack_ids, ack_deadline_seconds) - - Args: - subscription (str): The name of the subscription. Format is - ``projects/{project}/subscriptions/{sub}``. - ack_ids (list[str]): List of acknowledgment IDs. - ack_deadline_seconds (int): The new ack deadline with respect to the time this request was sent to - the Pub/Sub system. For example, if the value is 10, the new ack - deadline will expire 10 seconds after the ``ModifyAckDeadline`` call was - made. Specifying zero might immediately make the message available for - delivery to another subscriber client. This typically results in an - increase in the rate of message redeliveries (that is, duplicates). The - minimum deadline you can specify is 0 seconds. The maximum deadline you - can specify is 600 seconds (10 minutes). - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "modify_ack_deadline" not in self._inner_api_calls: - self._inner_api_calls[ - "modify_ack_deadline" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.modify_ack_deadline, - default_retry=self._method_configs["ModifyAckDeadline"].retry, - default_timeout=self._method_configs["ModifyAckDeadline"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ModifyAckDeadlineRequest( - subscription=subscription, - ack_ids=ack_ids, - ack_deadline_seconds=ack_deadline_seconds, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["modify_ack_deadline"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def acknowledge( - self, - subscription, - ack_ids, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Acknowledges the messages associated with the ``ack_ids`` in the - ``AcknowledgeRequest``. The Pub/Sub system can remove the relevant - messages from the subscription. - - Acknowledging a message whose ack deadline has expired may succeed, but - such a message may be redelivered later. Acknowledging a message more - than once will not result in an error. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `ack_ids`: - >>> ack_ids = [] - >>> - >>> client.acknowledge(subscription, ack_ids) - - Args: - subscription (str): The subscription whose message is being acknowledged. Format is - ``projects/{project}/subscriptions/{sub}``. - ack_ids (list[str]): The acknowledgment ID for the messages being acknowledged that was - returned by the Pub/Sub system in the ``Pull`` response. Must not be - empty. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "acknowledge" not in self._inner_api_calls: - self._inner_api_calls[ - "acknowledge" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.acknowledge, - default_retry=self._method_configs["Acknowledge"].retry, - default_timeout=self._method_configs["Acknowledge"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.AcknowledgeRequest( - subscription=subscription, ack_ids=ack_ids - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["acknowledge"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def pull( - self, - subscription, - max_messages, - return_immediately=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Pulls messages from the server. The server may return ``UNAVAILABLE`` if - there are too many concurrent pull requests pending for the given - subscription. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `max_messages`: - >>> max_messages = 0 - >>> - >>> response = client.pull(subscription, max_messages) - - Args: - subscription (str): The subscription from which messages should be pulled. Format is - ``projects/{project}/subscriptions/{sub}``. - max_messages (int): The maximum number of messages to return for this request. Must be a - positive integer. The Pub/Sub system may return fewer than the number - specified. - return_immediately (bool): If this field set to true, the system will respond immediately even if - it there are no messages available to return in the ``Pull`` response. - Otherwise, the system may wait (for a bounded amount of time) until at - least one message is available, rather than returning no messages. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.PullResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "pull" not in self._inner_api_calls: - self._inner_api_calls["pull"] = google.api_core.gapic_v1.method.wrap_method( - self.transport.pull, - default_retry=self._method_configs["Pull"].retry, - default_timeout=self._method_configs["Pull"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.PullRequest( - subscription=subscription, - max_messages=max_messages, - return_immediately=return_immediately, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["pull"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def streaming_pull( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Establishes a stream with the server, which sends messages down to the - client. The client streams acknowledgements and ack deadline - modifications back to the server. The server will close the stream and - return the status on any error. The server may close the stream with - status ``UNAVAILABLE`` to reassign server-side resources, in which case, - the client should re-establish the stream. Flow control can be achieved - by configuring the underlying RPC channel. - - EXPERIMENTAL: This method interface might change in the future. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `stream_ack_deadline_seconds`: - >>> stream_ack_deadline_seconds = 0 - >>> request = {'subscription': subscription, 'stream_ack_deadline_seconds': stream_ack_deadline_seconds} - >>> - >>> requests = [request] - >>> for element in client.streaming_pull(requests): - ... # process element - ... pass - - Args: - requests (iterator[dict|google.cloud.pubsub_v1.proto.pubsub_pb2.StreamingPullRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.pubsub_v1.types.StreamingPullRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - Iterable[~google.cloud.pubsub_v1.types.StreamingPullResponse]. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "streaming_pull" not in self._inner_api_calls: - self._inner_api_calls[ - "streaming_pull" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.streaming_pull, - default_retry=self._method_configs["StreamingPull"].retry, - default_timeout=self._method_configs["StreamingPull"].timeout, - client_info=self._client_info, - ) - - return self._inner_api_calls["streaming_pull"]( - requests, retry=retry, timeout=timeout, metadata=metadata - ) - - def modify_push_config( - self, - subscription, - push_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Modifies the ``PushConfig`` for a specified subscription. - - This may be used to change a push subscription to a pull one (signified - by an empty ``PushConfig``) or vice versa, or change the endpoint URL - and other attributes of a push subscription. Messages will accumulate - for delivery continuously through the call regardless of changes to the - ``PushConfig``. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `push_config`: - >>> push_config = {} - >>> - >>> client.modify_push_config(subscription, push_config) - - Args: - subscription (str): The name of the subscription. Format is - ``projects/{project}/subscriptions/{sub}``. - push_config (Union[dict, ~google.cloud.pubsub_v1.types.PushConfig]): The push configuration for future deliveries. - - An empty ``pushConfig`` indicates that the Pub/Sub system should stop - pushing messages from the given subscription and allow messages to be - pulled and acknowledged - effectively pausing the subscription if - ``Pull`` or ``StreamingPull`` is not called. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.PushConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "modify_push_config" not in self._inner_api_calls: - self._inner_api_calls[ - "modify_push_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.modify_push_config, - default_retry=self._method_configs["ModifyPushConfig"].retry, - default_timeout=self._method_configs["ModifyPushConfig"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ModifyPushConfigRequest( - subscription=subscription, push_config=push_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["modify_push_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_snapshots( - self, - project, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists the existing snapshots. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> project = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_snapshots(project): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_snapshots(project).pages: - ... for element in page: - ... # process element - ... pass - - Args: - project (str): The name of the project in which to list snapshots. Format is - ``projects/{project-id}``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.GRPCIterator` instance. - An iterable of :class:`~google.cloud.pubsub_v1.types.Snapshot` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_snapshots" not in self._inner_api_calls: - self._inner_api_calls[ - "list_snapshots" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_snapshots, - default_retry=self._method_configs["ListSnapshots"].retry, - default_timeout=self._method_configs["ListSnapshots"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.ListSnapshotsRequest(project=project, page_size=page_size) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project", project)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_snapshots"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="snapshots", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def create_snapshot( - self, - name, - subscription, - labels=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a snapshot from the requested subscription. Snapshots are used - in Seek operations, which allow you to manage message acknowledgments in - bulk. That is, you can set the acknowledgment state of messages in an - existing subscription to the state captured by a snapshot. If the - snapshot already exists, returns ``ALREADY_EXISTS``. If the requested - subscription doesn't exist, returns ``NOT_FOUND``. If the backlog in the - subscription is too old -- and the resulting snapshot would expire in - less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also - the ``Snapshot.expire_time`` field. If the name is not provided in the - request, the server will assign a random name for this snapshot on the - same project as the subscription, conforming to the `resource name - format `__. - The generated name is populated in the returned Snapshot object. Note - that for REST API requests, you must specify a name in the request. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> name = client.snapshot_path('[PROJECT]', '[SNAPSHOT]') - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> response = client.create_snapshot(name, subscription) - - Args: - name (str): Optional user-provided name for this snapshot. If the name is not - provided in the request, the server will assign a random name for this - snapshot on the same project as the subscription. Note that for REST API - requests, you must specify a name. See the resource name rules. Format - is ``projects/{project}/snapshots/{snap}``. - subscription (str): The subscription whose backlog the snapshot retains. Specifically, the - created snapshot is guaranteed to retain: (a) The existing backlog on - the subscription. More precisely, this is defined as the messages in the - subscription's backlog that are unacknowledged upon the successful - completion of the ``CreateSnapshot`` request; as well as: (b) Any - messages published to the subscription's topic following the successful - completion of the CreateSnapshot request. Format is - ``projects/{project}/subscriptions/{sub}``. - labels (dict[str -> str]): See Creating and - managing labels. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Snapshot` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_snapshot" not in self._inner_api_calls: - self._inner_api_calls[ - "create_snapshot" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_snapshot, - default_retry=self._method_configs["CreateSnapshot"].retry, - default_timeout=self._method_configs["CreateSnapshot"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.CreateSnapshotRequest( - name=name, subscription=subscription, labels=labels - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_snapshot"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_snapshot( - self, - snapshot, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> seconds = 123456 - >>> expire_time = {'seconds': seconds} - >>> snapshot = {'expire_time': expire_time} - >>> paths_element = 'expire_time' - >>> paths = [paths_element] - >>> update_mask = {'paths': paths} - >>> - >>> response = client.update_snapshot(snapshot, update_mask) - - Args: - snapshot (Union[dict, ~google.cloud.pubsub_v1.types.Snapshot]): The updated snapshot object. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Snapshot` - update_mask (Union[dict, ~google.cloud.pubsub_v1.types.FieldMask]): Indicates which fields in the provided snapshot to update. - Must be specified and non-empty. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Snapshot` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_snapshot" not in self._inner_api_calls: - self._inner_api_calls[ - "update_snapshot" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_snapshot, - default_retry=self._method_configs["UpdateSnapshot"].retry, - default_timeout=self._method_configs["UpdateSnapshot"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.UpdateSnapshotRequest( - snapshot=snapshot, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("snapshot.name", snapshot.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_snapshot"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_snapshot( - self, - snapshot, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Removes an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot.

- When the snapshot is deleted, all messages retained in the snapshot - are immediately dropped. After a snapshot is deleted, a new one may be - created with the same name, but the new one has no association with the old - snapshot or its subscription, unless the same subscription is specified. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> snapshot = client.snapshot_path('[PROJECT]', '[SNAPSHOT]') - >>> - >>> client.delete_snapshot(snapshot) - - Args: - snapshot (str): The name of the snapshot to delete. Format is - ``projects/{project}/snapshots/{snap}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_snapshot" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_snapshot" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_snapshot, - default_retry=self._method_configs["DeleteSnapshot"].retry, - default_timeout=self._method_configs["DeleteSnapshot"].timeout, - client_info=self._client_info, - ) - - request = pubsub_pb2.DeleteSnapshotRequest(snapshot=snapshot) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("snapshot", snapshot)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_snapshot"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def seek( - self, - subscription, - time=None, - snapshot=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Seeks an existing subscription to a point in time or to a given snapshot, - whichever is provided in the request. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. Note that both the subscription and the snapshot - must be on the same topic. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> subscription = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> response = client.seek(subscription) - - Args: - subscription (str): The subscription to affect. - time (Union[dict, ~google.cloud.pubsub_v1.types.Timestamp]): The time to seek to. Messages retained in the subscription that were - published before this time are marked as acknowledged, and messages - retained in the subscription that were published after this time are - marked as unacknowledged. Note that this operation affects only those - messages retained in the subscription (configured by the combination of - ``message_retention_duration`` and ``retain_acked_messages``). For - example, if ``time`` corresponds to a point before the message retention - window (or to a point before the system's notion of the subscription - creation time), only retained messages will be marked as unacknowledged, - and already-expunged messages will not be restored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Timestamp` - snapshot (str): The snapshot to seek to. The snapshot's topic must be the same as that - of the provided subscription. Format is - ``projects/{project}/snapshots/{snap}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.SeekResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "seek" not in self._inner_api_calls: - self._inner_api_calls["seek"] = google.api_core.gapic_v1.method.wrap_method( - self.transport.seek, - default_retry=self._method_configs["Seek"].retry, - default_timeout=self._method_configs["Seek"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof(time=time, snapshot=snapshot) - - request = pubsub_pb2.SeekRequest( - subscription=subscription, time=time, snapshot=snapshot - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("subscription", subscription)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["seek"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def set_iam_policy( - self, - resource, - policy, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sets the access control policy on the specified resource. Replaces any - existing policy. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> resource = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `policy`: - >>> policy = {} - >>> - >>> response = client.set_iam_policy(resource, policy) - - Args: - resource (str): REQUIRED: The resource for which the policy is being specified. - See the operation documentation for the appropriate value for this field. - policy (Union[dict, ~google.cloud.pubsub_v1.types.Policy]): REQUIRED: The complete policy to be applied to the ``resource``. The - size of the policy is limited to a few 10s of KB. An empty policy is a - valid policy but certain Cloud Platform services (such as Projects) - might reject them. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.Policy` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "set_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "set_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.set_iam_policy, - default_retry=self._method_configs["SetIamPolicy"].retry, - default_timeout=self._method_configs["SetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["set_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_iam_policy( - self, - resource, - options_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the access control policy for a resource. - Returns an empty policy if the resource exists and does not have a policy - set. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> resource = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> response = client.get_iam_policy(resource) - - Args: - resource (str): REQUIRED: The resource for which the policy is being requested. - See the operation documentation for the appropriate value for this field. - options_ (Union[dict, ~google.cloud.pubsub_v1.types.GetPolicyOptions]): OPTIONAL: A ``GetPolicyOptions`` object for specifying options to - ``GetIamPolicy``. This field is only used by Cloud IAM. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.pubsub_v1.types.GetPolicyOptions` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.Policy` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_iam_policy" not in self._inner_api_calls: - self._inner_api_calls[ - "get_iam_policy" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_iam_policy, - default_retry=self._method_configs["GetIamPolicy"].retry, - default_timeout=self._method_configs["GetIamPolicy"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_iam_policy"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def test_iam_permissions( - self, - resource, - permissions, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - - Example: - >>> from google.cloud import pubsub_v1 - >>> - >>> client = pubsub_v1.SubscriberClient() - >>> - >>> resource = client.subscription_path('[PROJECT]', '[SUBSCRIPTION]') - >>> - >>> # TODO: Initialize `permissions`: - >>> permissions = [] - >>> - >>> response = client.test_iam_permissions(resource, permissions) - - Args: - resource (str): REQUIRED: The resource for which the policy detail is being requested. - See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more - information see `IAM - Overview `__. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.pubsub_v1.types.TestIamPermissionsResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "test_iam_permissions" not in self._inner_api_calls: - self._inner_api_calls[ - "test_iam_permissions" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.test_iam_permissions, - default_retry=self._method_configs["TestIamPermissions"].retry, - default_timeout=self._method_configs["TestIamPermissions"].timeout, - client_info=self._client_info, - ) - - request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("resource", resource)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["test_iam_permissions"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client_config.py b/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client_config.py deleted file mode 100644 index 3955f2da1dcb..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/subscriber_client_config.py +++ /dev/null @@ -1,138 +0,0 @@ -config = { - "interfaces": { - "google.pubsub.v1.Subscriber": { - "retry_codes": { - "idempotent": ["ABORTED", "UNAVAILABLE", "UNKNOWN"], - "non_idempotent": ["UNAVAILABLE"], - "streaming_pull": [ - "ABORTED", - "DEADLINE_EXCEEDED", - "INTERNAL", - "RESOURCE_EXHAUSTED", - "UNAVAILABLE", - ], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - }, - "messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 5000, - "rpc_timeout_multiplier": 1.3, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000, - }, - "streaming_messaging": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 600000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 600000, - "total_timeout_millis": 600000, - }, - }, - "methods": { - "CreateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListSubscriptions": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteSubscription": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ModifyAckDeadline": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "Acknowledge": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "messaging", - }, - "Pull": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "messaging", - }, - "StreamingPull": { - "timeout_millis": 900000, - "retry_codes_name": "streaming_pull", - "retry_params_name": "streaming_messaging", - }, - "ModifyPushConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListSnapshots": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteSnapshot": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "Seek": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetIamPolicy": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "TestIamPermissions": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/pubsub/google/cloud/pubsub_v1/gapic/transports/__init__.py b/pubsub/google/cloud/pubsub_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py b/pubsub/google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py deleted file mode 100644 index aedcc8c465e1..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py +++ /dev/null @@ -1,260 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers - -from google.cloud.pubsub_v1.proto import pubsub_pb2_grpc -from google.iam.v1 import iam_policy_pb2_grpc as iam_policy_pb2_grpc - - -class PublisherGrpcTransport(object): - """gRPC transport class providing stubs for - google.pubsub.v1 Publisher API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub", - ) - - def __init__( - self, channel=None, credentials=None, address="pubsub.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "iam_policy_stub": iam_policy_pb2_grpc.IAMPolicyStub(channel), - "publisher_stub": pubsub_pb2_grpc.PublisherStub(channel), - } - - @classmethod - def create_channel( - cls, address="pubsub.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_topic(self): - """Return the gRPC stub for :meth:`PublisherClient.create_topic`. - - Creates the given topic with the given name. See the resource name - rules. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].CreateTopic - - @property - def update_topic(self): - """Return the gRPC stub for :meth:`PublisherClient.update_topic`. - - Updates an existing topic. Note that certain properties of a - topic are not modifiable. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].UpdateTopic - - @property - def publish(self): - """Return the gRPC stub for :meth:`PublisherClient.publish`. - - Adds one or more messages to the topic. Returns ``NOT_FOUND`` if the - topic does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].Publish - - @property - def get_topic(self): - """Return the gRPC stub for :meth:`PublisherClient.get_topic`. - - Gets the configuration of a topic. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].GetTopic - - @property - def list_topics(self): - """Return the gRPC stub for :meth:`PublisherClient.list_topics`. - - Lists matching topics. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].ListTopics - - @property - def list_topic_subscriptions(self): - """Return the gRPC stub for :meth:`PublisherClient.list_topic_subscriptions`. - - Lists the names of the subscriptions on this topic. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].ListTopicSubscriptions - - @property - def delete_topic(self): - """Return the gRPC stub for :meth:`PublisherClient.delete_topic`. - - Deletes the topic with the given name. Returns ``NOT_FOUND`` if the - topic does not exist. After a topic is deleted, a new topic may be - created with the same name; this is an entirely new topic with none of - the old configuration or subscriptions. Existing subscriptions to this - topic are not deleted, but their ``topic`` field is set to - ``_deleted-topic_``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["publisher_stub"].DeleteTopic - - @property - def set_iam_policy(self): - """Return the gRPC stub for :meth:`PublisherClient.set_iam_policy`. - - Sets the access control policy on the specified resource. Replaces any - existing policy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].SetIamPolicy - - @property - def get_iam_policy(self): - """Return the gRPC stub for :meth:`PublisherClient.get_iam_policy`. - - Gets the access control policy for a resource. - Returns an empty policy if the resource exists and does not have a policy - set. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].GetIamPolicy - - @property - def test_iam_permissions(self): - """Return the gRPC stub for :meth:`PublisherClient.test_iam_permissions`. - - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].TestIamPermissions diff --git a/pubsub/google/cloud/pubsub_v1/gapic/transports/subscriber_grpc_transport.py b/pubsub/google/cloud/pubsub_v1/gapic/transports/subscriber_grpc_transport.py deleted file mode 100644 index fa8ac9f29329..000000000000 --- a/pubsub/google/cloud/pubsub_v1/gapic/transports/subscriber_grpc_transport.py +++ /dev/null @@ -1,434 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers - -from google.cloud.pubsub_v1.proto import pubsub_pb2_grpc -from google.iam.v1 import iam_policy_pb2_grpc as iam_policy_pb2_grpc - - -class SubscriberGrpcTransport(object): - """gRPC transport class providing stubs for - google.pubsub.v1 Subscriber API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/pubsub", - ) - - def __init__( - self, channel=None, credentials=None, address="pubsub.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "iam_policy_stub": iam_policy_pb2_grpc.IAMPolicyStub(channel), - "subscriber_stub": pubsub_pb2_grpc.SubscriberStub(channel), - } - - @classmethod - def create_channel( - cls, address="pubsub.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_subscription(self): - """Return the gRPC stub for :meth:`SubscriberClient.create_subscription`. - - Creates a subscription to a given topic. See the resource name rules. If - the subscription already exists, returns ``ALREADY_EXISTS``. If the - corresponding topic doesn't exist, returns ``NOT_FOUND``. - - If the name is not provided in the request, the server will assign a - random name for this subscription on the same project as the topic, - conforming to the `resource name - format `__. - The generated name is populated in the returned Subscription object. - Note that for REST API requests, you must specify a name in the request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].CreateSubscription - - @property - def get_subscription(self): - """Return the gRPC stub for :meth:`SubscriberClient.get_subscription`. - - Gets the configuration details of a subscription. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].GetSubscription - - @property - def update_subscription(self): - """Return the gRPC stub for :meth:`SubscriberClient.update_subscription`. - - Updates an existing subscription. Note that certain properties of a - subscription, such as its topic, are not modifiable. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].UpdateSubscription - - @property - def list_subscriptions(self): - """Return the gRPC stub for :meth:`SubscriberClient.list_subscriptions`. - - Lists matching subscriptions. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].ListSubscriptions - - @property - def delete_subscription(self): - """Return the gRPC stub for :meth:`SubscriberClient.delete_subscription`. - - Deletes an existing subscription. All messages retained in the - subscription are immediately dropped. Calls to ``Pull`` after deletion - will return ``NOT_FOUND``. After a subscription is deleted, a new one - may be created with the same name, but the new one has no association - with the old subscription or its topic unless the same topic is - specified. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].DeleteSubscription - - @property - def modify_ack_deadline(self): - """Return the gRPC stub for :meth:`SubscriberClient.modify_ack_deadline`. - - Modifies the ack deadline for a specific message. This method is useful - to indicate that more time is needed to process a message by the - subscriber, or to make the message available for redelivery if the - processing was interrupted. Note that this does not modify the - subscription-level ``ackDeadlineSeconds`` used for subsequent messages. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].ModifyAckDeadline - - @property - def acknowledge(self): - """Return the gRPC stub for :meth:`SubscriberClient.acknowledge`. - - Acknowledges the messages associated with the ``ack_ids`` in the - ``AcknowledgeRequest``. The Pub/Sub system can remove the relevant - messages from the subscription. - - Acknowledging a message whose ack deadline has expired may succeed, but - such a message may be redelivered later. Acknowledging a message more - than once will not result in an error. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].Acknowledge - - @property - def pull(self): - """Return the gRPC stub for :meth:`SubscriberClient.pull`. - - Pulls messages from the server. The server may return ``UNAVAILABLE`` if - there are too many concurrent pull requests pending for the given - subscription. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].Pull - - @property - def streaming_pull(self): - """Return the gRPC stub for :meth:`SubscriberClient.streaming_pull`. - - Establishes a stream with the server, which sends messages down to the - client. The client streams acknowledgements and ack deadline - modifications back to the server. The server will close the stream and - return the status on any error. The server may close the stream with - status ``UNAVAILABLE`` to reassign server-side resources, in which case, - the client should re-establish the stream. Flow control can be achieved - by configuring the underlying RPC channel. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].StreamingPull - - @property - def modify_push_config(self): - """Return the gRPC stub for :meth:`SubscriberClient.modify_push_config`. - - Modifies the ``PushConfig`` for a specified subscription. - - This may be used to change a push subscription to a pull one (signified - by an empty ``PushConfig``) or vice versa, or change the endpoint URL - and other attributes of a push subscription. Messages will accumulate - for delivery continuously through the call regardless of changes to the - ``PushConfig``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].ModifyPushConfig - - @property - def list_snapshots(self): - """Return the gRPC stub for :meth:`SubscriberClient.list_snapshots`. - - Lists the existing snapshots. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].ListSnapshots - - @property - def create_snapshot(self): - """Return the gRPC stub for :meth:`SubscriberClient.create_snapshot`. - - Creates a snapshot from the requested subscription. Snapshots are used - in Seek operations, which allow you to manage message acknowledgments in - bulk. That is, you can set the acknowledgment state of messages in an - existing subscription to the state captured by a snapshot. If the - snapshot already exists, returns ``ALREADY_EXISTS``. If the requested - subscription doesn't exist, returns ``NOT_FOUND``. If the backlog in the - subscription is too old -- and the resulting snapshot would expire in - less than 1 hour -- then ``FAILED_PRECONDITION`` is returned. See also - the ``Snapshot.expire_time`` field. If the name is not provided in the - request, the server will assign a random name for this snapshot on the - same project as the subscription, conforming to the `resource name - format `__. - The generated name is populated in the returned Snapshot object. Note - that for REST API requests, you must specify a name in the request. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].CreateSnapshot - - @property - def update_snapshot(self): - """Return the gRPC stub for :meth:`SubscriberClient.update_snapshot`. - - Updates an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].UpdateSnapshot - - @property - def delete_snapshot(self): - """Return the gRPC stub for :meth:`SubscriberClient.delete_snapshot`. - - Removes an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot.

- When the snapshot is deleted, all messages retained in the snapshot - are immediately dropped. After a snapshot is deleted, a new one may be - created with the same name, but the new one has no association with the old - snapshot or its subscription, unless the same subscription is specified. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].DeleteSnapshot - - @property - def seek(self): - """Return the gRPC stub for :meth:`SubscriberClient.seek`. - - Seeks an existing subscription to a point in time or to a given snapshot, - whichever is provided in the request. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. Note that both the subscription and the snapshot - must be on the same topic. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["subscriber_stub"].Seek - - @property - def set_iam_policy(self): - """Return the gRPC stub for :meth:`SubscriberClient.set_iam_policy`. - - Sets the access control policy on the specified resource. Replaces any - existing policy. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].SetIamPolicy - - @property - def get_iam_policy(self): - """Return the gRPC stub for :meth:`SubscriberClient.get_iam_policy`. - - Gets the access control policy for a resource. - Returns an empty policy if the resource exists and does not have a policy - set. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].GetIamPolicy - - @property - def test_iam_permissions(self): - """Return the gRPC stub for :meth:`SubscriberClient.test_iam_permissions`. - - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. - - Note: This operation is designed to be used for building - permission-aware UIs and command-line tools, not for authorization - checking. This operation may "fail open" without warning. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["iam_policy_stub"].TestIamPermissions diff --git a/pubsub/google/cloud/pubsub_v1/proto/__init__.py b/pubsub/google/cloud/pubsub_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/google/cloud/pubsub_v1/proto/pubsub.proto b/pubsub/google/cloud/pubsub_v1/proto/pubsub.proto deleted file mode 100644 index 3ad6355a8bf6..000000000000 --- a/pubsub/google/cloud/pubsub_v1/proto/pubsub.proto +++ /dev/null @@ -1,1067 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.pubsub.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option csharp_namespace = "Google.Cloud.PubSub.V1"; -option go_package = "google.golang.org/genproto/googleapis/pubsub/v1;pubsub"; -option java_multiple_files = true; -option java_outer_classname = "PubsubProto"; -option java_package = "com.google.pubsub.v1"; -option php_namespace = "Google\\Cloud\\PubSub\\V1"; -option ruby_package = "Google::Cloud::PubSub::V1"; - -// The service that an application uses to manipulate topics, and to send -// messages to a topic. -service Publisher { - option (google.api.default_host) = "pubsub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/pubsub"; - - // Creates the given topic with the given name. See the - // - // resource name rules. - rpc CreateTopic(Topic) returns (Topic) { - option (google.api.http) = { - put: "/v1/{name=projects/*/topics/*}" - body: "*" - }; - } - - // Updates an existing topic. Note that certain properties of a - // topic are not modifiable. - rpc UpdateTopic(UpdateTopicRequest) returns (Topic) { - option (google.api.http) = { - patch: "/v1/{topic.name=projects/*/topics/*}" - body: "*" - }; - } - - // Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - // does not exist. - rpc Publish(PublishRequest) returns (PublishResponse) { - option (google.api.http) = { - post: "/v1/{topic=projects/*/topics/*}:publish" - body: "*" - }; - } - - // Gets the configuration of a topic. - rpc GetTopic(GetTopicRequest) returns (Topic) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}" - }; - } - - // Lists matching topics. - rpc ListTopics(ListTopicsRequest) returns (ListTopicsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/topics" - }; - } - - // Lists the names of the subscriptions on this topic. - rpc ListTopicSubscriptions(ListTopicSubscriptionsRequest) - returns (ListTopicSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/subscriptions" - }; - } - - // Lists the names of the snapshots on this topic. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot. - rpc ListTopicSnapshots(ListTopicSnapshotsRequest) - returns (ListTopicSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{topic=projects/*/topics/*}/snapshots" - }; - } - - // Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - // does not exist. After a topic is deleted, a new topic may be created with - // the same name; this is an entirely new topic with none of the old - // configuration or subscriptions. Existing subscriptions to this topic are - // not deleted, but their `topic` field is set to `_deleted-topic_`. - rpc DeleteTopic(DeleteTopicRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{topic=projects/*/topics/*}" - }; - } -} - -message MessageStoragePolicy { - // A list of IDs of GCP regions where messages that are published to the topic - // may be persisted in storage. Messages published by publishers running in - // non-allowed GCP regions (or running outside of GCP altogether) will be - // routed for storage in one of the allowed regions. An empty list means that - // no regions are allowed, and is not a valid configuration. - repeated string allowed_persistence_regions = 1; -} - -// A topic resource. -message Topic { - // The name of the topic. It must have the format - // `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, - // and contain only letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), - // underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or percent - // signs (`%`). It must be between 3 and 255 characters in length, and it - // must not start with `"goog"`. - string name = 1; - - // See Creating and - // managing labels. - map labels = 2; - - // Policy constraining the set of Google Cloud Platform regions where messages - // published to the topic may be stored. If not present, then no constraints - // are in effect. - MessageStoragePolicy message_storage_policy = 3; - - // The resource name of the Cloud KMS CryptoKey to be used to protect access - // to messages published on this topic. - // - // The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`. - string kms_key_name = 5; -} - -// A message that is published by publishers and consumed by subscribers. The -// message must contain either a non-empty data field or at least one attribute. -// Note that client libraries represent this object differently -// depending on the language. See the corresponding -// client -// library documentation for more information. See -// Quotas and limits -// for more information about message limits. -message PubsubMessage { - // The message data field. If this field is empty, the message must contain - // at least one attribute. - bytes data = 1; - - // Optional attributes for this message. - map attributes = 2; - - // ID of this message, assigned by the server when the message is published. - // Guaranteed to be unique within the topic. This value may be read by a - // subscriber that receives a `PubsubMessage` via a `Pull` call or a push - // delivery. It must not be populated by the publisher in a `Publish` call. - string message_id = 3; - - // The time at which the message was published, populated by the server when - // it receives the `Publish` call. It must not be populated by the - // publisher in a `Publish` call. - google.protobuf.Timestamp publish_time = 4; - - // Identifies related messages for which publish order should be respected. - // If a `Subscription` has `enable_message_ordering` set to `true`, messages - // published with the same `ordering_key` value will be delivered to - // subscribers in the order in which they are received by the Pub/Sub system. - // EXPERIMENTAL: This feature is part of a closed alpha release. This - // API might be changed in backward-incompatible ways and is not recommended - // for production use. It is not subject to any SLA or deprecation policy. - string ordering_key = 5; -} - -// Request for the GetTopic method. -message GetTopicRequest { - // The name of the topic to get. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1; -} - -// Request for the UpdateTopic method. -message UpdateTopicRequest { - // The updated topic object. - Topic topic = 1; - - // Indicates which fields in the provided topic to update. Must be specified - // and non-empty. Note that if `update_mask` contains - // "message_storage_policy" then the new value will be determined based on the - // policy configured at the project or organization level. The - // `message_storage_policy` must not be set in the `topic` provided above. - google.protobuf.FieldMask update_mask = 2; -} - -// Request for the Publish method. -message PublishRequest { - // The messages in the request will be published on this topic. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1; - - // The messages to publish. - repeated PubsubMessage messages = 2; -} - -// Response for the `Publish` method. -message PublishResponse { - // The server-assigned ID of each published message, in the same order as - // the messages in the request. IDs are guaranteed to be unique within - // the topic. - repeated string message_ids = 1; -} - -// Request for the `ListTopics` method. -message ListTopicsRequest { - // The name of the project in which to list topics. - // Format is `projects/{project-id}`. - string project = 1; - - // Maximum number of topics to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicsResponse`; indicates that this is - // a continuation of a prior `ListTopics` call, and that the system should - // return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopics` method. -message ListTopicsResponse { - // The resulting topics. - repeated Topic topics = 1; - - // If not empty, indicates that there may be more topics that match the - // request; this value should be passed in a new `ListTopicsRequest`. - string next_page_token = 2; -} - -// Request for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsRequest { - // The name of the topic that subscriptions are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1; - - // Maximum number of subscription names to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicSubscriptionsResponse`; indicates - // that this is a continuation of a prior `ListTopicSubscriptions` call, and - // that the system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopicSubscriptions` method. -message ListTopicSubscriptionsResponse { - // The names of the subscriptions that match the request. - repeated string subscriptions = 1; - - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new - // `ListTopicSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; -} - -// Request for the `ListTopicSnapshots` method. -message ListTopicSnapshotsRequest { - // The name of the topic that snapshots are attached to. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1; - - // Maximum number of snapshot names to return. - int32 page_size = 2; - - // The value returned by the last `ListTopicSnapshotsResponse`; indicates - // that this is a continuation of a prior `ListTopicSnapshots` call, and - // that the system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListTopicSnapshots` method. -message ListTopicSnapshotsResponse { - // The names of the snapshots that match the request. - repeated string snapshots = 1; - - // If not empty, indicates that there may be more snapshots that match - // the request; this value should be passed in a new - // `ListTopicSnapshotsRequest` to get more snapshots. - string next_page_token = 2; -} - -// Request for the `DeleteTopic` method. -message DeleteTopicRequest { - // Name of the topic to delete. - // Format is `projects/{project}/topics/{topic}`. - string topic = 1; -} - -// The service that an application uses to manipulate subscriptions and to -// consume messages from a subscription via the `Pull` method or by -// establishing a bi-directional stream using the `StreamingPull` method. -service Subscriber { - option (google.api.default_host) = "pubsub.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/pubsub"; - - // Creates a subscription to a given topic. See the - // - // resource name rules. - // If the subscription already exists, returns `ALREADY_EXISTS`. - // If the corresponding topic doesn't exist, returns `NOT_FOUND`. - // - // If the name is not provided in the request, the server will assign a random - // name for this subscription on the same project as the topic, conforming - // to the - // [resource name - // format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - // generated name is populated in the returned Subscription object. Note that - // for REST API requests, you must specify a name in the request. - rpc CreateSubscription(Subscription) returns (Subscription) { - option (google.api.http) = { - put: "/v1/{name=projects/*/subscriptions/*}" - body: "*" - }; - } - - // Gets the configuration details of a subscription. - rpc GetSubscription(GetSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - get: "/v1/{subscription=projects/*/subscriptions/*}" - }; - } - - // Updates an existing subscription. Note that certain properties of a - // subscription, such as its topic, are not modifiable. - rpc UpdateSubscription(UpdateSubscriptionRequest) returns (Subscription) { - option (google.api.http) = { - patch: "/v1/{subscription.name=projects/*/subscriptions/*}" - body: "*" - }; - } - - // Lists matching subscriptions. - rpc ListSubscriptions(ListSubscriptionsRequest) - returns (ListSubscriptionsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/subscriptions" - }; - } - - // Deletes an existing subscription. All messages retained in the subscription - // are immediately dropped. Calls to `Pull` after deletion will return - // `NOT_FOUND`. After a subscription is deleted, a new one may be created with - // the same name, but the new one has no association with the old - // subscription or its topic unless the same topic is specified. - rpc DeleteSubscription(DeleteSubscriptionRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{subscription=projects/*/subscriptions/*}" - }; - } - - // Modifies the ack deadline for a specific message. This method is useful - // to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. Note that this does not modify the - // subscription-level `ackDeadlineSeconds` used for subsequent messages. - rpc ModifyAckDeadline(ModifyAckDeadlineRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline" - body: "*" - }; - } - - // Acknowledges the messages associated with the `ack_ids` in the - // `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - // from the subscription. - // - // Acknowledging a message whose ack deadline has expired may succeed, - // but such a message may be redelivered later. Acknowledging a message more - // than once will not result in an error. - rpc Acknowledge(AcknowledgeRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:acknowledge" - body: "*" - }; - } - - // Pulls messages from the server. The server may return `UNAVAILABLE` if - // there are too many concurrent pull requests pending for the given - // subscription. - rpc Pull(PullRequest) returns (PullResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:pull" - body: "*" - }; - } - - // Establishes a stream with the server, which sends messages down to the - // client. The client streams acknowledgements and ack deadline modifications - // back to the server. The server will close the stream and return the status - // on any error. The server may close the stream with status `UNAVAILABLE` to - // reassign server-side resources, in which case, the client should - // re-establish the stream. Flow control can be achieved by configuring the - // underlying RPC channel. - rpc StreamingPull(stream StreamingPullRequest) - returns (stream StreamingPullResponse) {} - - // Modifies the `PushConfig` for a specified subscription. - // - // This may be used to change a push subscription to a pull one (signified by - // an empty `PushConfig`) or vice versa, or change the endpoint URL and other - // attributes of a push subscription. Messages will accumulate for delivery - // continuously through the call regardless of changes to the `PushConfig`. - rpc ModifyPushConfig(ModifyPushConfigRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig" - body: "*" - }; - } - - // Gets the configuration details of a snapshot. Snapshots are used in - // Seek - // operations, which allow you to manage message acknowledgments in bulk. That - // is, you can set the acknowledgment state of messages in an existing - // subscription to the state captured by a snapshot. - rpc GetSnapshot(GetSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - get: "/v1/{snapshot=projects/*/snapshots/*}" - }; - } - - // Lists the existing snapshots. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot. - rpc ListSnapshots(ListSnapshotsRequest) returns (ListSnapshotsResponse) { - option (google.api.http) = { - get: "/v1/{project=projects/*}/snapshots" - }; - } - - // Creates a snapshot from the requested subscription. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot. - //

If the snapshot already exists, returns `ALREADY_EXISTS`. - // If the requested subscription doesn't exist, returns `NOT_FOUND`. - // If the backlog in the subscription is too old -- and the resulting snapshot - // would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - // See also the `Snapshot.expire_time` field. If the name is not provided in - // the request, the server will assign a random - // name for this snapshot on the same project as the subscription, conforming - // to the - // [resource name - // format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - // generated name is populated in the returned Snapshot object. Note that for - // REST API requests, you must specify a name in the request. - rpc CreateSnapshot(CreateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - put: "/v1/{name=projects/*/snapshots/*}" - body: "*" - }; - } - - // Updates an existing snapshot. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot. - rpc UpdateSnapshot(UpdateSnapshotRequest) returns (Snapshot) { - option (google.api.http) = { - patch: "/v1/{snapshot.name=projects/*/snapshots/*}" - body: "*" - }; - } - - // Removes an existing snapshot. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot.

- // When the snapshot is deleted, all messages retained in the snapshot - // are immediately dropped. After a snapshot is deleted, a new one may be - // created with the same name, but the new one has no association with the old - // snapshot or its subscription, unless the same subscription is specified. - rpc DeleteSnapshot(DeleteSnapshotRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1/{snapshot=projects/*/snapshots/*}" - }; - } - - // Seeks an existing subscription to a point in time or to a given snapshot, - // whichever is provided in the request. Snapshots are used in - // Seek - // operations, which allow - // you to manage message acknowledgments in bulk. That is, you can set the - // acknowledgment state of messages in an existing subscription to the state - // captured by a snapshot. Note that both the subscription and the snapshot - // must be on the same topic. - rpc Seek(SeekRequest) returns (SeekResponse) { - option (google.api.http) = { - post: "/v1/{subscription=projects/*/subscriptions/*}:seek" - body: "*" - }; - } -} - -// A subscription resource. -message Subscription { - // The name of the subscription. It must have the format - // `"projects/{project}/subscriptions/{subscription}"`. `{subscription}` must - // start with a letter, and contain only letters (`[A-Za-z]`), numbers - // (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), - // plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters - // in length, and it must not start with `"goog"`. - string name = 1; - - // The name of the topic from which this subscription is receiving messages. - // Format is `projects/{project}/topics/{topic}`. - // The value of this field will be `_deleted-topic_` if the topic has been - // deleted. - string topic = 2; - - // If push delivery is used with this subscription, this field is - // used to configure it. An empty `pushConfig` signifies that the subscriber - // will pull and ack messages using API methods. - PushConfig push_config = 4; - - // The approximate amount of time (on a best-effort basis) Pub/Sub waits for - // the subscriber to acknowledge receipt before resending the message. In the - // interval after the message is delivered and before it is acknowledged, it - // is considered to be outstanding. During that time period, the - // message will not be redelivered (on a best-effort basis). - // - // For pull subscriptions, this value is used as the initial value for the ack - // deadline. To override this value for a given message, call - // `ModifyAckDeadline` with the corresponding `ack_id` if using - // non-streaming pull or send the `ack_id` in a - // `StreamingModifyAckDeadlineRequest` if using streaming pull. - // The minimum custom deadline you can specify is 10 seconds. - // The maximum custom deadline you can specify is 600 seconds (10 minutes). - // If this parameter is 0, a default value of 10 seconds is used. - // - // For push delivery, this value is also used to set the request timeout for - // the call to the push endpoint. - // - // If the subscriber never acknowledges the message, the Pub/Sub - // system will eventually redeliver the message. - int32 ack_deadline_seconds = 5; - - // Indicates whether to retain acknowledged messages. If true, then - // messages are not expunged from the subscription's backlog, even if they are - // acknowledged, until they fall out of the `message_retention_duration` - // window. This must be true if you would like to - // - // Seek to a timestamp. - bool retain_acked_messages = 7; - - // How long to retain unacknowledged messages in the subscription's backlog, - // from the moment a message is published. - // If `retain_acked_messages` is true, then this also configures the retention - // of acknowledged messages, and thus configures how far back in time a `Seek` - // can be done. Defaults to 7 days. Cannot be more than 7 days or less than 10 - // minutes. - google.protobuf.Duration message_retention_duration = 8; - - // See Creating and - // managing labels. - map labels = 9; - - // If true, messages published with the same `ordering_key` in `PubsubMessage` - // will be delivered to the subscribers in the order in which they - // are received by the Pub/Sub system. Otherwise, they may be delivered in - // any order. - // EXPERIMENTAL: This feature is part of a closed alpha release. This - // API might be changed in backward-incompatible ways and is not recommended - // for production use. It is not subject to any SLA or deprecation policy. - bool enable_message_ordering = 10; - - // A policy that specifies the conditions for this subscription's expiration. - // A subscription is considered active as long as any connected subscriber is - // successfully consuming messages from the subscription or is issuing - // operations on the subscription. If `expiration_policy` is not set, a - // *default policy* with `ttl` of 31 days will be used. The minimum allowed - // value for `expiration_policy.ttl` is 1 day. - ExpirationPolicy expiration_policy = 11; - - // A policy that specifies the conditions for dead lettering messages in - // this subscription. If dead_letter_policy is not set, dead lettering - // is disabled. - // - // The Cloud Pub/Sub service account associated with this subscriptions's - // parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Acknowledge() messages on this subscription. - // EXPERIMENTAL: This feature is part of a closed alpha release. This - // API might be changed in backward-incompatible ways and is not recommended - // for production use. It is not subject to any SLA or deprecation policy. - DeadLetterPolicy dead_letter_policy = 13; -} - -// Dead lettering is done on a best effort basis. The same message might be -// dead lettered multiple times. -// -// If validation on any of the fields fails at subscription creation/updation, -// the create/update subscription request will fail. -message DeadLetterPolicy { - // The name of the topic to which dead letter messages should be published. - // Format is `projects/{project}/topics/{topic}`.The Cloud Pub/Sub service - // account associated with the enclosing subscription's parent project (i.e., - // service-{project_number}@gcp-sa-pubsub.iam.gserviceaccount.com) must have - // permission to Publish() to this topic. - // - // The operation will fail if the topic does not exist. - // Users should ensure that there is a subscription attached to this topic - // since messages published to a topic with no subscriptions are lost. - string dead_letter_topic = 1; - - // The maximum number of delivery attempts for any message. The value must be - // between 5 and 100. - // - // The number of delivery attempts is defined as 1 + (the sum of number of - // NACKs and number of times the acknowledgement deadline has been exceeded - // for the message). - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. Note that - // client libraries may automatically extend ack_deadlines. - // - // This field will be honored on a best effort basis. - // - // If this parameter is 0, a default value of 5 is used. - int32 max_delivery_attempts = 2; -} - -// A policy that specifies the conditions for resource expiration (i.e., -// automatic resource deletion). -message ExpirationPolicy { - // Specifies the "time-to-live" duration for an associated resource. The - // resource expires if it is not active for a period of `ttl`. The definition - // of "activity" depends on the type of the associated resource. The minimum - // and maximum allowed values for `ttl` depend on the type of the associated - // resource, as well. If `ttl` is not set, the associated resource never - // expires. - google.protobuf.Duration ttl = 1; -} - -// Configuration for a push delivery endpoint. -message PushConfig { - // Contains information needed for generating an - // [OpenID Connect - // token](https://developers.google.com/identity/protocols/OpenIDConnect). - message OidcToken { - // [Service account - // email](https://cloud.google.com/iam/docs/service-accounts) - // to be used for generating the OIDC token. The caller (for - // CreateSubscription, UpdateSubscription, and ModifyPushConfig RPCs) must - // have the iam.serviceAccounts.actAs permission for the service account. - string service_account_email = 1; - - // Audience to be used when generating OIDC token. The audience claim - // identifies the recipients that the JWT is intended for. The audience - // value is a single case-sensitive string. Having multiple values (array) - // for the audience field is not supported. More info about the OIDC JWT - // token audience here: https://tools.ietf.org/html/rfc7519#section-4.1.3 - // Note: if not specified, the Push endpoint URL will be used. - string audience = 2; - } - - // A URL locating the endpoint to which messages should be pushed. - // For example, a Webhook endpoint might use "https://example.com/push". - string push_endpoint = 1; - - // Endpoint configuration attributes that can be used to control different - // aspects of the message delivery. - // - // The only currently supported attribute is `x-goog-version`, which you can - // use to change the format of the pushed message. This attribute - // indicates the version of the data expected by the endpoint. This - // controls the shape of the pushed message (i.e., its fields and metadata). - // - // If not present during the `CreateSubscription` call, it will default to - // the version of the Pub/Sub API used to make such call. If not present in a - // `ModifyPushConfig` call, its value will not be changed. `GetSubscription` - // calls will always return a valid version, even if the subscription was - // created without this attribute. - // - // The only supported values for the `x-goog-version` attribute are: - // - // * `v1beta1`: uses the push format defined in the v1beta1 Pub/Sub API. - // * `v1` or `v1beta2`: uses the push format defined in the v1 Pub/Sub API. - // - // For example: - //
attributes { "x-goog-version": "v1" } 
- map attributes = 2; - - // An authentication method used by push endpoints to verify the source of - // push requests. This can be used with push endpoints that are private by - // default to allow requests only from the Cloud Pub/Sub system, for example. - // This field is optional and should be set only by users interested in - // authenticated push. - oneof authentication_method { - // If specified, Pub/Sub will generate and attach an OIDC JWT token as an - // `Authorization` header in the HTTP request for every pushed message. - OidcToken oidc_token = 3; - } -} - -// A message and its corresponding acknowledgment ID. -message ReceivedMessage { - // This ID can be used to acknowledge the received message. - string ack_id = 1; - - // The message. - PubsubMessage message = 2; - - // Delivery attempt counter is 1 + (the sum of number of NACKs and number of - // ack_deadline exceeds) for this message. - // - // A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - // exceeds event is whenever a message is not acknowledged within - // ack_deadline. Note that ack_deadline is initially - // Subscription.ackDeadlineSeconds, but may get extended automatically by - // the client library. - // - // The first delivery of a given message will have this value as 1. The value - // is calculated at best effort and is approximate. - // - // If a DeadLetterPolicy is not set on the subscription, this will be 0. - // EXPERIMENTAL: This feature is part of a closed alpha release. This - // API might be changed in backward-incompatible ways and is not recommended - // for production use. It is not subject to any SLA or deprecation policy. - int32 delivery_attempt = 3; -} - -// Request for the GetSubscription method. -message GetSubscriptionRequest { - // The name of the subscription to get. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; -} - -// Request for the UpdateSubscription method. -message UpdateSubscriptionRequest { - // The updated subscription object. - Subscription subscription = 1; - - // Indicates which fields in the provided subscription to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2; -} - -// Request for the `ListSubscriptions` method. -message ListSubscriptionsRequest { - // The name of the project in which to list subscriptions. - // Format is `projects/{project-id}`. - string project = 1; - - // Maximum number of subscriptions to return. - int32 page_size = 2; - - // The value returned by the last `ListSubscriptionsResponse`; indicates that - // this is a continuation of a prior `ListSubscriptions` call, and that the - // system should return the next page of data. - string page_token = 3; -} - -// Response for the `ListSubscriptions` method. -message ListSubscriptionsResponse { - // The subscriptions that match the request. - repeated Subscription subscriptions = 1; - - // If not empty, indicates that there may be more subscriptions that match - // the request; this value should be passed in a new - // `ListSubscriptionsRequest` to get more subscriptions. - string next_page_token = 2; -} - -// Request for the DeleteSubscription method. -message DeleteSubscriptionRequest { - // The subscription to delete. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; -} - -// Request for the ModifyPushConfig method. -message ModifyPushConfigRequest { - // The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; - - // The push configuration for future deliveries. - // - // An empty `pushConfig` indicates that the Pub/Sub system should - // stop pushing messages from the given subscription and allow - // messages to be pulled and acknowledged - effectively pausing - // the subscription if `Pull` or `StreamingPull` is not called. - PushConfig push_config = 2; -} - -// Request for the `Pull` method. -message PullRequest { - // The subscription from which messages should be pulled. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; - - // If this field set to true, the system will respond immediately even if - // it there are no messages available to return in the `Pull` response. - // Otherwise, the system may wait (for a bounded amount of time) until at - // least one message is available, rather than returning no messages. - bool return_immediately = 2; - - // The maximum number of messages to return for this request. Must be a - // positive integer. The Pub/Sub system may return fewer than the number - // specified. - int32 max_messages = 3; -} - -// Response for the `Pull` method. -message PullResponse { - // Received Pub/Sub messages. The list will be empty if there are no more - // messages available in the backlog. For JSON, the response can be entirely - // empty. The Pub/Sub system may return fewer than the `maxMessages` requested - // even if there are more messages available in the backlog. - repeated ReceivedMessage received_messages = 1; -} - -// Request for the ModifyAckDeadline method. -message ModifyAckDeadlineRequest { - // The name of the subscription. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; - - // List of acknowledgment IDs. - repeated string ack_ids = 4; - - // The new ack deadline with respect to the time this request was sent to - // the Pub/Sub system. For example, if the value is 10, the new - // ack deadline will expire 10 seconds after the `ModifyAckDeadline` call - // was made. Specifying zero might immediately make the message available for - // delivery to another subscriber client. This typically results in an - // increase in the rate of message redeliveries (that is, duplicates). - // The minimum deadline you can specify is 0 seconds. - // The maximum deadline you can specify is 600 seconds (10 minutes). - int32 ack_deadline_seconds = 3; -} - -// Request for the Acknowledge method. -message AcknowledgeRequest { - // The subscription whose message is being acknowledged. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; - - // The acknowledgment ID for the messages being acknowledged that was returned - // by the Pub/Sub system in the `Pull` response. Must not be empty. - repeated string ack_ids = 2; -} - -// Request for the `StreamingPull` streaming RPC method. This request is used to -// establish the initial stream as well as to stream acknowledgements and ack -// deadline modifications from the client to the server. -message StreamingPullRequest { - // The subscription for which to initialize the new stream. This must be - // provided in the first request on the stream, and must not be set in - // subsequent requests from client to server. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 1; - - // List of acknowledgement IDs for acknowledging previously received messages - // (received on this stream or a different stream). If an ack ID has expired, - // the corresponding message may be redelivered later. Acknowledging a message - // more than once will not result in an error. If the acknowledgement ID is - // malformed, the stream will be aborted with status `INVALID_ARGUMENT`. - repeated string ack_ids = 2; - - // The list of new ack deadlines for the IDs listed in - // `modify_deadline_ack_ids`. The size of this list must be the same as the - // size of `modify_deadline_ack_ids`. If it differs the stream will be aborted - // with `INVALID_ARGUMENT`. Each element in this list is applied to the - // element in the same position in `modify_deadline_ack_ids`. The new ack - // deadline is with respect to the time this request was sent to the Pub/Sub - // system. Must be >= 0. For example, if the value is 10, the new ack deadline - // will expire 10 seconds after this request is received. If the value is 0, - // the message is immediately made available for another streaming or - // non-streaming pull request. If the value is < 0 (an error), the stream will - // be aborted with status `INVALID_ARGUMENT`. - repeated int32 modify_deadline_seconds = 3; - - // List of acknowledgement IDs whose deadline will be modified based on the - // corresponding element in `modify_deadline_seconds`. This field can be used - // to indicate that more time is needed to process a message by the - // subscriber, or to make the message available for redelivery if the - // processing was interrupted. - repeated string modify_deadline_ack_ids = 4; - - // The ack deadline to use for the stream. This must be provided in the - // first request on the stream, but it can also be updated on subsequent - // requests from client to server. The minimum deadline you can specify is 10 - // seconds. The maximum deadline you can specify is 600 seconds (10 minutes). - int32 stream_ack_deadline_seconds = 5; -} - -// Response for the `StreamingPull` method. This response is used to stream -// messages from the server to the client. -message StreamingPullResponse { - // Received Pub/Sub messages. This will not be empty. - repeated ReceivedMessage received_messages = 1; -} - -// Request for the `CreateSnapshot` method. -message CreateSnapshotRequest { - // Optional user-provided name for this snapshot. - // If the name is not provided in the request, the server will assign a random - // name for this snapshot on the same project as the subscription. - // Note that for REST API requests, you must specify a name. See the - // - // resource name rules. - // Format is `projects/{project}/snapshots/{snap}`. - string name = 1; - - // The subscription whose backlog the snapshot retains. - // Specifically, the created snapshot is guaranteed to retain: - // (a) The existing backlog on the subscription. More precisely, this is - // defined as the messages in the subscription's backlog that are - // unacknowledged upon the successful completion of the - // `CreateSnapshot` request; as well as: - // (b) Any messages published to the subscription's topic following the - // successful completion of the CreateSnapshot request. - // Format is `projects/{project}/subscriptions/{sub}`. - string subscription = 2; - - // See Creating and - // managing labels. - map labels = 3; -} - -// Request for the UpdateSnapshot method. -message UpdateSnapshotRequest { - // The updated snapshot object. - Snapshot snapshot = 1; - - // Indicates which fields in the provided snapshot to update. - // Must be specified and non-empty. - google.protobuf.FieldMask update_mask = 2; -} - -// A snapshot resource. Snapshots are used in -// Seek -// operations, which allow -// you to manage message acknowledgments in bulk. That is, you can set the -// acknowledgment state of messages in an existing subscription to the state -// captured by a snapshot. -message Snapshot { - // The name of the snapshot. - string name = 1; - - // The name of the topic from which this snapshot is retaining messages. - string topic = 2; - - // The snapshot is guaranteed to exist up until this time. - // A newly-created snapshot expires no later than 7 days from the time of its - // creation. Its exact lifetime is determined at creation by the existing - // backlog in the source subscription. Specifically, the lifetime of the - // snapshot is `7 days - (age of oldest unacked message in the subscription)`. - // For example, consider a subscription whose oldest unacked message is 3 days - // old. If a snapshot is created from this subscription, the snapshot -- which - // will always capture this 3-day-old backlog as long as the snapshot - // exists -- will expire in 4 days. The service will refuse to create a - // snapshot that would expire in less than 1 hour after creation. - google.protobuf.Timestamp expire_time = 3; - - // See Creating and - // managing labels. - map labels = 4; -} - -// Request for the GetSnapshot method. -message GetSnapshotRequest { - // The name of the snapshot to get. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1; -} - -// Request for the `ListSnapshots` method. -message ListSnapshotsRequest { - // The name of the project in which to list snapshots. - // Format is `projects/{project-id}`. - string project = 1; - - // Maximum number of snapshots to return. - int32 page_size = 2; - - // The value returned by the last `ListSnapshotsResponse`; indicates that this - // is a continuation of a prior `ListSnapshots` call, and that the system - // should return the next page of data. - string page_token = 3; -} - -// Response for the `ListSnapshots` method. -message ListSnapshotsResponse { - // The resulting snapshots. - repeated Snapshot snapshots = 1; - - // If not empty, indicates that there may be more snapshot that match the - // request; this value should be passed in a new `ListSnapshotsRequest`. - string next_page_token = 2; -} - -// Request for the `DeleteSnapshot` method. -message DeleteSnapshotRequest { - // The name of the snapshot to delete. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 1; -} - -// Request for the `Seek` method. -message SeekRequest { - // The subscription to affect. - string subscription = 1; - - oneof target { - // The time to seek to. - // Messages retained in the subscription that were published before this - // time are marked as acknowledged, and messages retained in the - // subscription that were published after this time are marked as - // unacknowledged. Note that this operation affects only those messages - // retained in the subscription (configured by the combination of - // `message_retention_duration` and `retain_acked_messages`). For example, - // if `time` corresponds to a point before the message retention - // window (or to a point before the system's notion of the subscription - // creation time), only retained messages will be marked as unacknowledged, - // and already-expunged messages will not be restored. - google.protobuf.Timestamp time = 2; - - // The snapshot to seek to. The snapshot's topic must be the same as that of - // the provided subscription. - // Format is `projects/{project}/snapshots/{snap}`. - string snapshot = 3; - } -} - -// Response for the `Seek` method (this response is empty). -message SeekResponse {} diff --git a/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2.py b/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2.py deleted file mode 100644 index dd4427f7e9a1..000000000000 --- a/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2.py +++ /dev/null @@ -1,4694 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/pubsub_v1/proto/pubsub.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/pubsub_v1/proto/pubsub.proto", - package="google.pubsub.v1", - syntax="proto3", - serialized_options=_b( - "\n\024com.google.pubsub.v1B\013PubsubProtoP\001Z6google.golang.org/genproto/googleapis/pubsub/v1;pubsub\370\001\001\252\002\026Google.Cloud.PubSub.V1\312\002\026Google\\Cloud\\PubSub\\V1\352\002\031Google::Cloud::PubSub::V1" - ), - serialized_pb=_b( - '\n)google/cloud/pubsub_v1/proto/pubsub.proto\x12\x10google.pubsub.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto";\n\x14MessageStoragePolicy\x12#\n\x1b\x61llowed_persistence_regions\x18\x01 \x03(\t"\xd7\x01\n\x05Topic\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x33\n\x06labels\x18\x02 \x03(\x0b\x32#.google.pubsub.v1.Topic.LabelsEntry\x12\x46\n\x16message_storage_policy\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.MessageStoragePolicy\x12\x14\n\x0ckms_key_name\x18\x05 \x01(\t\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\xf1\x01\n\rPubsubMessage\x12\x0c\n\x04\x64\x61ta\x18\x01 \x01(\x0c\x12\x43\n\nattributes\x18\x02 \x03(\x0b\x32/.google.pubsub.v1.PubsubMessage.AttributesEntry\x12\x12\n\nmessage_id\x18\x03 \x01(\t\x12\x30\n\x0cpublish_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x14\n\x0cordering_key\x18\x05 \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01" \n\x0fGetTopicRequest\x12\r\n\x05topic\x18\x01 \x01(\t"m\n\x12UpdateTopicRequest\x12&\n\x05topic\x18\x01 \x01(\x0b\x32\x17.google.pubsub.v1.Topic\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"R\n\x0ePublishRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x31\n\x08messages\x18\x02 \x03(\x0b\x32\x1f.google.pubsub.v1.PubsubMessage"&\n\x0fPublishResponse\x12\x13\n\x0bmessage_ids\x18\x01 \x03(\t"K\n\x11ListTopicsRequest\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"V\n\x12ListTopicsResponse\x12\'\n\x06topics\x18\x01 \x03(\x0b\x32\x17.google.pubsub.v1.Topic\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"U\n\x1dListTopicSubscriptionsRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"P\n\x1eListTopicSubscriptionsResponse\x12\x15\n\rsubscriptions\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"Q\n\x19ListTopicSnapshotsRequest\x12\r\n\x05topic\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"H\n\x1aListTopicSnapshotsResponse\x12\x11\n\tsnapshots\x18\x01 \x03(\t\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"#\n\x12\x44\x65leteTopicRequest\x12\r\n\x05topic\x18\x01 \x01(\t"\xe5\x03\n\x0cSubscription\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12\x31\n\x0bpush_config\x18\x04 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfig\x12\x1c\n\x14\x61\x63k_deadline_seconds\x18\x05 \x01(\x05\x12\x1d\n\x15retain_acked_messages\x18\x07 \x01(\x08\x12=\n\x1amessage_retention_duration\x18\x08 \x01(\x0b\x32\x19.google.protobuf.Duration\x12:\n\x06labels\x18\t \x03(\x0b\x32*.google.pubsub.v1.Subscription.LabelsEntry\x12\x1f\n\x17\x65nable_message_ordering\x18\n \x01(\x08\x12=\n\x11\x65xpiration_policy\x18\x0b \x01(\x0b\x32".google.pubsub.v1.ExpirationPolicy\x12>\n\x12\x64\x65\x61\x64_letter_policy\x18\r \x01(\x0b\x32".google.pubsub.v1.DeadLetterPolicy\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"L\n\x10\x44\x65\x61\x64LetterPolicy\x12\x19\n\x11\x64\x65\x61\x64_letter_topic\x18\x01 \x01(\t\x12\x1d\n\x15max_delivery_attempts\x18\x02 \x01(\x05":\n\x10\x45xpirationPolicy\x12&\n\x03ttl\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration"\xad\x02\n\nPushConfig\x12\x15\n\rpush_endpoint\x18\x01 \x01(\t\x12@\n\nattributes\x18\x02 \x03(\x0b\x32,.google.pubsub.v1.PushConfig.AttributesEntry\x12<\n\noidc_token\x18\x03 \x01(\x0b\x32&.google.pubsub.v1.PushConfig.OidcTokenH\x00\x1a<\n\tOidcToken\x12\x1d\n\x15service_account_email\x18\x01 \x01(\t\x12\x10\n\x08\x61udience\x18\x02 \x01(\t\x1a\x31\n\x0f\x41ttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x42\x17\n\x15\x61uthentication_method"m\n\x0fReceivedMessage\x12\x0e\n\x06\x61\x63k_id\x18\x01 \x01(\t\x12\x30\n\x07message\x18\x02 \x01(\x0b\x32\x1f.google.pubsub.v1.PubsubMessage\x12\x18\n\x10\x64\x65livery_attempt\x18\x03 \x01(\x05".\n\x16GetSubscriptionRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t"\x82\x01\n\x19UpdateSubscriptionRequest\x12\x34\n\x0csubscription\x18\x01 \x01(\x0b\x32\x1e.google.pubsub.v1.Subscription\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"R\n\x18ListSubscriptionsRequest\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"k\n\x19ListSubscriptionsResponse\x12\x35\n\rsubscriptions\x18\x01 \x03(\x0b\x32\x1e.google.pubsub.v1.Subscription\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"1\n\x19\x44\x65leteSubscriptionRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t"b\n\x17ModifyPushConfigRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12\x31\n\x0bpush_config\x18\x02 \x01(\x0b\x32\x1c.google.pubsub.v1.PushConfig"U\n\x0bPullRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12\x1a\n\x12return_immediately\x18\x02 \x01(\x08\x12\x14\n\x0cmax_messages\x18\x03 \x01(\x05"L\n\x0cPullResponse\x12<\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessage"_\n\x18ModifyAckDeadlineRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63k_ids\x18\x04 \x03(\t\x12\x1c\n\x14\x61\x63k_deadline_seconds\x18\x03 \x01(\x05";\n\x12\x41\x63knowledgeRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63k_ids\x18\x02 \x03(\t"\xa4\x01\n\x14StreamingPullRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12\x0f\n\x07\x61\x63k_ids\x18\x02 \x03(\t\x12\x1f\n\x17modify_deadline_seconds\x18\x03 \x03(\x05\x12\x1f\n\x17modify_deadline_ack_ids\x18\x04 \x03(\t\x12#\n\x1bstream_ack_deadline_seconds\x18\x05 \x01(\x05"U\n\x15StreamingPullResponse\x12<\n\x11received_messages\x18\x01 \x03(\x0b\x32!.google.pubsub.v1.ReceivedMessage"\xaf\x01\n\x15\x43reateSnapshotRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0csubscription\x18\x02 \x01(\t\x12\x43\n\x06labels\x18\x03 \x03(\x0b\x32\x33.google.pubsub.v1.CreateSnapshotRequest.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"v\n\x15UpdateSnapshotRequest\x12,\n\x08snapshot\x18\x01 \x01(\x0b\x32\x1a.google.pubsub.v1.Snapshot\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xbf\x01\n\x08Snapshot\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05topic\x18\x02 \x01(\t\x12/\n\x0b\x65xpire_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x06labels\x18\x04 \x03(\x0b\x32&.google.pubsub.v1.Snapshot.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"&\n\x12GetSnapshotRequest\x12\x10\n\x08snapshot\x18\x01 \x01(\t"N\n\x14ListSnapshotsRequest\x12\x0f\n\x07project\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"_\n\x15ListSnapshotsResponse\x12-\n\tsnapshots\x18\x01 \x03(\x0b\x32\x1a.google.pubsub.v1.Snapshot\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t")\n\x15\x44\x65leteSnapshotRequest\x12\x10\n\x08snapshot\x18\x01 \x01(\t"m\n\x0bSeekRequest\x12\x14\n\x0csubscription\x18\x01 \x01(\t\x12*\n\x04time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x12\n\x08snapshot\x18\x03 \x01(\tH\x00\x42\x08\n\x06target"\x0e\n\x0cSeekResponse2\xb1\t\n\tPublisher\x12j\n\x0b\x43reateTopic\x12\x17.google.pubsub.v1.Topic\x1a\x17.google.pubsub.v1.Topic")\x82\xd3\xe4\x93\x02#\x1a\x1e/v1/{name=projects/*/topics/*}:\x01*\x12}\n\x0bUpdateTopic\x12$.google.pubsub.v1.UpdateTopicRequest\x1a\x17.google.pubsub.v1.Topic"/\x82\xd3\xe4\x93\x02)2$/v1/{topic.name=projects/*/topics/*}:\x01*\x12\x82\x01\n\x07Publish\x12 .google.pubsub.v1.PublishRequest\x1a!.google.pubsub.v1.PublishResponse"2\x82\xd3\xe4\x93\x02,"\'/v1/{topic=projects/*/topics/*}:publish:\x01*\x12o\n\x08GetTopic\x12!.google.pubsub.v1.GetTopicRequest\x1a\x17.google.pubsub.v1.Topic"\'\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{topic=projects/*/topics/*}\x12\x80\x01\n\nListTopics\x12#.google.pubsub.v1.ListTopicsRequest\x1a$.google.pubsub.v1.ListTopicsResponse"\'\x82\xd3\xe4\x93\x02!\x12\x1f/v1/{project=projects/*}/topics\x12\xb2\x01\n\x16ListTopicSubscriptions\x12/.google.pubsub.v1.ListTopicSubscriptionsRequest\x1a\x30.google.pubsub.v1.ListTopicSubscriptionsResponse"5\x82\xd3\xe4\x93\x02/\x12-/v1/{topic=projects/*/topics/*}/subscriptions\x12\xa2\x01\n\x12ListTopicSnapshots\x12+.google.pubsub.v1.ListTopicSnapshotsRequest\x1a,.google.pubsub.v1.ListTopicSnapshotsResponse"1\x82\xd3\xe4\x93\x02+\x12)/v1/{topic=projects/*/topics/*}/snapshots\x12t\n\x0b\x44\x65leteTopic\x12$.google.pubsub.v1.DeleteTopicRequest\x1a\x16.google.protobuf.Empty"\'\x82\xd3\xe4\x93\x02!*\x1f/v1/{topic=projects/*/topics/*}\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub2\xeb\x12\n\nSubscriber\x12\x86\x01\n\x12\x43reateSubscription\x12\x1e.google.pubsub.v1.Subscription\x1a\x1e.google.pubsub.v1.Subscription"0\x82\xd3\xe4\x93\x02*\x1a%/v1/{name=projects/*/subscriptions/*}:\x01*\x12\x92\x01\n\x0fGetSubscription\x12(.google.pubsub.v1.GetSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription"5\x82\xd3\xe4\x93\x02/\x12-/v1/{subscription=projects/*/subscriptions/*}\x12\xa0\x01\n\x12UpdateSubscription\x12+.google.pubsub.v1.UpdateSubscriptionRequest\x1a\x1e.google.pubsub.v1.Subscription"=\x82\xd3\xe4\x93\x02\x37\x32\x32/v1/{subscription.name=projects/*/subscriptions/*}:\x01*\x12\x9c\x01\n\x11ListSubscriptions\x12*.google.pubsub.v1.ListSubscriptionsRequest\x1a+.google.pubsub.v1.ListSubscriptionsResponse".\x82\xd3\xe4\x93\x02(\x12&/v1/{project=projects/*}/subscriptions\x12\x90\x01\n\x12\x44\x65leteSubscription\x12+.google.pubsub.v1.DeleteSubscriptionRequest\x1a\x16.google.protobuf.Empty"5\x82\xd3\xe4\x93\x02/*-/v1/{subscription=projects/*/subscriptions/*}\x12\xa3\x01\n\x11ModifyAckDeadline\x12*.google.pubsub.v1.ModifyAckDeadlineRequest\x1a\x16.google.protobuf.Empty"J\x82\xd3\xe4\x93\x02\x44"?/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline:\x01*\x12\x91\x01\n\x0b\x41\x63knowledge\x12$.google.pubsub.v1.AcknowledgeRequest\x1a\x16.google.protobuf.Empty"D\x82\xd3\xe4\x93\x02>"9/v1/{subscription=projects/*/subscriptions/*}:acknowledge:\x01*\x12\x84\x01\n\x04Pull\x12\x1d.google.pubsub.v1.PullRequest\x1a\x1e.google.pubsub.v1.PullResponse"=\x82\xd3\xe4\x93\x02\x37"2/v1/{subscription=projects/*/subscriptions/*}:pull:\x01*\x12\x66\n\rStreamingPull\x12&.google.pubsub.v1.StreamingPullRequest\x1a\'.google.pubsub.v1.StreamingPullResponse"\x00(\x01\x30\x01\x12\xa0\x01\n\x10ModifyPushConfig\x12).google.pubsub.v1.ModifyPushConfigRequest\x1a\x16.google.protobuf.Empty"I\x82\xd3\xe4\x93\x02\x43">/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig:\x01*\x12~\n\x0bGetSnapshot\x12$.google.pubsub.v1.GetSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot"-\x82\xd3\xe4\x93\x02\'\x12%/v1/{snapshot=projects/*/snapshots/*}\x12\x8c\x01\n\rListSnapshots\x12&.google.pubsub.v1.ListSnapshotsRequest\x1a\'.google.pubsub.v1.ListSnapshotsResponse"*\x82\xd3\xe4\x93\x02$\x12"/v1/{project=projects/*}/snapshots\x12\x83\x01\n\x0e\x43reateSnapshot\x12\'.google.pubsub.v1.CreateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot",\x82\xd3\xe4\x93\x02&\x1a!/v1/{name=projects/*/snapshots/*}:\x01*\x12\x8c\x01\n\x0eUpdateSnapshot\x12\'.google.pubsub.v1.UpdateSnapshotRequest\x1a\x1a.google.pubsub.v1.Snapshot"5\x82\xd3\xe4\x93\x02/2*/v1/{snapshot.name=projects/*/snapshots/*}:\x01*\x12\x80\x01\n\x0e\x44\x65leteSnapshot\x12\'.google.pubsub.v1.DeleteSnapshotRequest\x1a\x16.google.protobuf.Empty"-\x82\xd3\xe4\x93\x02\'*%/v1/{snapshot=projects/*/snapshots/*}\x12\x84\x01\n\x04Seek\x12\x1d.google.pubsub.v1.SeekRequest\x1a\x1e.google.pubsub.v1.SeekResponse"=\x82\xd3\xe4\x93\x02\x37"2/v1/{subscription=projects/*/subscriptions/*}:seek:\x01*\x1ap\xca\x41\x15pubsub.googleapis.com\xd2\x41Uhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsubB\xae\x01\n\x14\x63om.google.pubsub.v1B\x0bPubsubProtoP\x01Z6google.golang.org/genproto/googleapis/pubsub/v1;pubsub\xf8\x01\x01\xaa\x02\x16Google.Cloud.PubSub.V1\xca\x02\x16Google\\Cloud\\PubSub\\V1\xea\x02\x19Google::Cloud::PubSub::V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_MESSAGESTORAGEPOLICY = _descriptor.Descriptor( - name="MessageStoragePolicy", - full_name="google.pubsub.v1.MessageStoragePolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="allowed_persistence_regions", - full_name="google.pubsub.v1.MessageStoragePolicy.allowed_persistence_regions", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=246, - serialized_end=305, -) - - -_TOPIC_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.pubsub.v1.Topic.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.Topic.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.Topic.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=478, - serialized_end=523, -) - -_TOPIC = _descriptor.Descriptor( - name="Topic", - full_name="google.pubsub.v1.Topic", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.pubsub.v1.Topic.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.pubsub.v1.Topic.labels", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message_storage_policy", - full_name="google.pubsub.v1.Topic.message_storage_policy", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="kms_key_name", - full_name="google.pubsub.v1.Topic.kms_key_name", - index=3, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TOPIC_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=308, - serialized_end=523, -) - - -_PUBSUBMESSAGE_ATTRIBUTESENTRY = _descriptor.Descriptor( - name="AttributesEntry", - full_name="google.pubsub.v1.PubsubMessage.AttributesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.PubsubMessage.AttributesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.PubsubMessage.AttributesEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=718, - serialized_end=767, -) - -_PUBSUBMESSAGE = _descriptor.Descriptor( - name="PubsubMessage", - full_name="google.pubsub.v1.PubsubMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="data", - full_name="google.pubsub.v1.PubsubMessage.data", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.pubsub.v1.PubsubMessage.attributes", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message_id", - full_name="google.pubsub.v1.PubsubMessage.message_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publish_time", - full_name="google.pubsub.v1.PubsubMessage.publish_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ordering_key", - full_name="google.pubsub.v1.PubsubMessage.ordering_key", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PUBSUBMESSAGE_ATTRIBUTESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=526, - serialized_end=767, -) - - -_GETTOPICREQUEST = _descriptor.Descriptor( - name="GetTopicRequest", - full_name="google.pubsub.v1.GetTopicRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.GetTopicRequest.topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=769, - serialized_end=801, -) - - -_UPDATETOPICREQUEST = _descriptor.Descriptor( - name="UpdateTopicRequest", - full_name="google.pubsub.v1.UpdateTopicRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.UpdateTopicRequest.topic", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.pubsub.v1.UpdateTopicRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=803, - serialized_end=912, -) - - -_PUBLISHREQUEST = _descriptor.Descriptor( - name="PublishRequest", - full_name="google.pubsub.v1.PublishRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.PublishRequest.topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="messages", - full_name="google.pubsub.v1.PublishRequest.messages", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=914, - serialized_end=996, -) - - -_PUBLISHRESPONSE = _descriptor.Descriptor( - name="PublishResponse", - full_name="google.pubsub.v1.PublishResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="message_ids", - full_name="google.pubsub.v1.PublishResponse.message_ids", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=998, - serialized_end=1036, -) - - -_LISTTOPICSREQUEST = _descriptor.Descriptor( - name="ListTopicsRequest", - full_name="google.pubsub.v1.ListTopicsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project", - full_name="google.pubsub.v1.ListTopicsRequest.project", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.pubsub.v1.ListTopicsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.pubsub.v1.ListTopicsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1038, - serialized_end=1113, -) - - -_LISTTOPICSRESPONSE = _descriptor.Descriptor( - name="ListTopicsResponse", - full_name="google.pubsub.v1.ListTopicsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topics", - full_name="google.pubsub.v1.ListTopicsResponse.topics", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.pubsub.v1.ListTopicsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1115, - serialized_end=1201, -) - - -_LISTTOPICSUBSCRIPTIONSREQUEST = _descriptor.Descriptor( - name="ListTopicSubscriptionsRequest", - full_name="google.pubsub.v1.ListTopicSubscriptionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.ListTopicSubscriptionsRequest.topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.pubsub.v1.ListTopicSubscriptionsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.pubsub.v1.ListTopicSubscriptionsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1203, - serialized_end=1288, -) - - -_LISTTOPICSUBSCRIPTIONSRESPONSE = _descriptor.Descriptor( - name="ListTopicSubscriptionsResponse", - full_name="google.pubsub.v1.ListTopicSubscriptionsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscriptions", - full_name="google.pubsub.v1.ListTopicSubscriptionsResponse.subscriptions", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.pubsub.v1.ListTopicSubscriptionsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1290, - serialized_end=1370, -) - - -_LISTTOPICSNAPSHOTSREQUEST = _descriptor.Descriptor( - name="ListTopicSnapshotsRequest", - full_name="google.pubsub.v1.ListTopicSnapshotsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.ListTopicSnapshotsRequest.topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.pubsub.v1.ListTopicSnapshotsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.pubsub.v1.ListTopicSnapshotsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1372, - serialized_end=1453, -) - - -_LISTTOPICSNAPSHOTSRESPONSE = _descriptor.Descriptor( - name="ListTopicSnapshotsResponse", - full_name="google.pubsub.v1.ListTopicSnapshotsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="snapshots", - full_name="google.pubsub.v1.ListTopicSnapshotsResponse.snapshots", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.pubsub.v1.ListTopicSnapshotsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1455, - serialized_end=1527, -) - - -_DELETETOPICREQUEST = _descriptor.Descriptor( - name="DeleteTopicRequest", - full_name="google.pubsub.v1.DeleteTopicRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.DeleteTopicRequest.topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1529, - serialized_end=1564, -) - - -_SUBSCRIPTION_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.pubsub.v1.Subscription.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.Subscription.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.Subscription.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=478, - serialized_end=523, -) - -_SUBSCRIPTION = _descriptor.Descriptor( - name="Subscription", - full_name="google.pubsub.v1.Subscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.pubsub.v1.Subscription.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.Subscription.topic", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="push_config", - full_name="google.pubsub.v1.Subscription.push_config", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ack_deadline_seconds", - full_name="google.pubsub.v1.Subscription.ack_deadline_seconds", - index=3, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="retain_acked_messages", - full_name="google.pubsub.v1.Subscription.retain_acked_messages", - index=4, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message_retention_duration", - full_name="google.pubsub.v1.Subscription.message_retention_duration", - index=5, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.pubsub.v1.Subscription.labels", - index=6, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_message_ordering", - full_name="google.pubsub.v1.Subscription.enable_message_ordering", - index=7, - number=10, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expiration_policy", - full_name="google.pubsub.v1.Subscription.expiration_policy", - index=8, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dead_letter_policy", - full_name="google.pubsub.v1.Subscription.dead_letter_policy", - index=9, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SUBSCRIPTION_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1567, - serialized_end=2052, -) - - -_DEADLETTERPOLICY = _descriptor.Descriptor( - name="DeadLetterPolicy", - full_name="google.pubsub.v1.DeadLetterPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dead_letter_topic", - full_name="google.pubsub.v1.DeadLetterPolicy.dead_letter_topic", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_delivery_attempts", - full_name="google.pubsub.v1.DeadLetterPolicy.max_delivery_attempts", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2054, - serialized_end=2130, -) - - -_EXPIRATIONPOLICY = _descriptor.Descriptor( - name="ExpirationPolicy", - full_name="google.pubsub.v1.ExpirationPolicy", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="ttl", - full_name="google.pubsub.v1.ExpirationPolicy.ttl", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2132, - serialized_end=2190, -) - - -_PUSHCONFIG_OIDCTOKEN = _descriptor.Descriptor( - name="OidcToken", - full_name="google.pubsub.v1.PushConfig.OidcToken", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="service_account_email", - full_name="google.pubsub.v1.PushConfig.OidcToken.service_account_email", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audience", - full_name="google.pubsub.v1.PushConfig.OidcToken.audience", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2358, - serialized_end=2418, -) - -_PUSHCONFIG_ATTRIBUTESENTRY = _descriptor.Descriptor( - name="AttributesEntry", - full_name="google.pubsub.v1.PushConfig.AttributesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.PushConfig.AttributesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.PushConfig.AttributesEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=718, - serialized_end=767, -) - -_PUSHCONFIG = _descriptor.Descriptor( - name="PushConfig", - full_name="google.pubsub.v1.PushConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="push_endpoint", - full_name="google.pubsub.v1.PushConfig.push_endpoint", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.pubsub.v1.PushConfig.attributes", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="oidc_token", - full_name="google.pubsub.v1.PushConfig.oidc_token", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PUSHCONFIG_OIDCTOKEN, _PUSHCONFIG_ATTRIBUTESENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="authentication_method", - full_name="google.pubsub.v1.PushConfig.authentication_method", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2193, - serialized_end=2494, -) - - -_RECEIVEDMESSAGE = _descriptor.Descriptor( - name="ReceivedMessage", - full_name="google.pubsub.v1.ReceivedMessage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="ack_id", - full_name="google.pubsub.v1.ReceivedMessage.ack_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message", - full_name="google.pubsub.v1.ReceivedMessage.message", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delivery_attempt", - full_name="google.pubsub.v1.ReceivedMessage.delivery_attempt", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2496, - serialized_end=2605, -) - - -_GETSUBSCRIPTIONREQUEST = _descriptor.Descriptor( - name="GetSubscriptionRequest", - full_name="google.pubsub.v1.GetSubscriptionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.GetSubscriptionRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2607, - serialized_end=2653, -) - - -_UPDATESUBSCRIPTIONREQUEST = _descriptor.Descriptor( - name="UpdateSubscriptionRequest", - full_name="google.pubsub.v1.UpdateSubscriptionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.UpdateSubscriptionRequest.subscription", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.pubsub.v1.UpdateSubscriptionRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2656, - serialized_end=2786, -) - - -_LISTSUBSCRIPTIONSREQUEST = _descriptor.Descriptor( - name="ListSubscriptionsRequest", - full_name="google.pubsub.v1.ListSubscriptionsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project", - full_name="google.pubsub.v1.ListSubscriptionsRequest.project", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.pubsub.v1.ListSubscriptionsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.pubsub.v1.ListSubscriptionsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2788, - serialized_end=2870, -) - - -_LISTSUBSCRIPTIONSRESPONSE = _descriptor.Descriptor( - name="ListSubscriptionsResponse", - full_name="google.pubsub.v1.ListSubscriptionsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscriptions", - full_name="google.pubsub.v1.ListSubscriptionsResponse.subscriptions", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.pubsub.v1.ListSubscriptionsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2872, - serialized_end=2979, -) - - -_DELETESUBSCRIPTIONREQUEST = _descriptor.Descriptor( - name="DeleteSubscriptionRequest", - full_name="google.pubsub.v1.DeleteSubscriptionRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.DeleteSubscriptionRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2981, - serialized_end=3030, -) - - -_MODIFYPUSHCONFIGREQUEST = _descriptor.Descriptor( - name="ModifyPushConfigRequest", - full_name="google.pubsub.v1.ModifyPushConfigRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.ModifyPushConfigRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="push_config", - full_name="google.pubsub.v1.ModifyPushConfigRequest.push_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3032, - serialized_end=3130, -) - - -_PULLREQUEST = _descriptor.Descriptor( - name="PullRequest", - full_name="google.pubsub.v1.PullRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.PullRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="return_immediately", - full_name="google.pubsub.v1.PullRequest.return_immediately", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_messages", - full_name="google.pubsub.v1.PullRequest.max_messages", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3132, - serialized_end=3217, -) - - -_PULLRESPONSE = _descriptor.Descriptor( - name="PullResponse", - full_name="google.pubsub.v1.PullResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="received_messages", - full_name="google.pubsub.v1.PullResponse.received_messages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3219, - serialized_end=3295, -) - - -_MODIFYACKDEADLINEREQUEST = _descriptor.Descriptor( - name="ModifyAckDeadlineRequest", - full_name="google.pubsub.v1.ModifyAckDeadlineRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.ModifyAckDeadlineRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ack_ids", - full_name="google.pubsub.v1.ModifyAckDeadlineRequest.ack_ids", - index=1, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ack_deadline_seconds", - full_name="google.pubsub.v1.ModifyAckDeadlineRequest.ack_deadline_seconds", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3297, - serialized_end=3392, -) - - -_ACKNOWLEDGEREQUEST = _descriptor.Descriptor( - name="AcknowledgeRequest", - full_name="google.pubsub.v1.AcknowledgeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.AcknowledgeRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ack_ids", - full_name="google.pubsub.v1.AcknowledgeRequest.ack_ids", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3394, - serialized_end=3453, -) - - -_STREAMINGPULLREQUEST = _descriptor.Descriptor( - name="StreamingPullRequest", - full_name="google.pubsub.v1.StreamingPullRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.StreamingPullRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ack_ids", - full_name="google.pubsub.v1.StreamingPullRequest.ack_ids", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="modify_deadline_seconds", - full_name="google.pubsub.v1.StreamingPullRequest.modify_deadline_seconds", - index=2, - number=3, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="modify_deadline_ack_ids", - full_name="google.pubsub.v1.StreamingPullRequest.modify_deadline_ack_ids", - index=3, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stream_ack_deadline_seconds", - full_name="google.pubsub.v1.StreamingPullRequest.stream_ack_deadline_seconds", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3456, - serialized_end=3620, -) - - -_STREAMINGPULLRESPONSE = _descriptor.Descriptor( - name="StreamingPullResponse", - full_name="google.pubsub.v1.StreamingPullResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="received_messages", - full_name="google.pubsub.v1.StreamingPullResponse.received_messages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3622, - serialized_end=3707, -) - - -_CREATESNAPSHOTREQUEST_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.pubsub.v1.CreateSnapshotRequest.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.CreateSnapshotRequest.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.CreateSnapshotRequest.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=478, - serialized_end=523, -) - -_CREATESNAPSHOTREQUEST = _descriptor.Descriptor( - name="CreateSnapshotRequest", - full_name="google.pubsub.v1.CreateSnapshotRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.pubsub.v1.CreateSnapshotRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.CreateSnapshotRequest.subscription", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.pubsub.v1.CreateSnapshotRequest.labels", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CREATESNAPSHOTREQUEST_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3710, - serialized_end=3885, -) - - -_UPDATESNAPSHOTREQUEST = _descriptor.Descriptor( - name="UpdateSnapshotRequest", - full_name="google.pubsub.v1.UpdateSnapshotRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="snapshot", - full_name="google.pubsub.v1.UpdateSnapshotRequest.snapshot", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.pubsub.v1.UpdateSnapshotRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3887, - serialized_end=4005, -) - - -_SNAPSHOT_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.pubsub.v1.Snapshot.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.pubsub.v1.Snapshot.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.pubsub.v1.Snapshot.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=478, - serialized_end=523, -) - -_SNAPSHOT = _descriptor.Descriptor( - name="Snapshot", - full_name="google.pubsub.v1.Snapshot", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.pubsub.v1.Snapshot.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topic", - full_name="google.pubsub.v1.Snapshot.topic", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_time", - full_name="google.pubsub.v1.Snapshot.expire_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.pubsub.v1.Snapshot.labels", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SNAPSHOT_LABELSENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4008, - serialized_end=4199, -) - - -_GETSNAPSHOTREQUEST = _descriptor.Descriptor( - name="GetSnapshotRequest", - full_name="google.pubsub.v1.GetSnapshotRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="snapshot", - full_name="google.pubsub.v1.GetSnapshotRequest.snapshot", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4201, - serialized_end=4239, -) - - -_LISTSNAPSHOTSREQUEST = _descriptor.Descriptor( - name="ListSnapshotsRequest", - full_name="google.pubsub.v1.ListSnapshotsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project", - full_name="google.pubsub.v1.ListSnapshotsRequest.project", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.pubsub.v1.ListSnapshotsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.pubsub.v1.ListSnapshotsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4241, - serialized_end=4319, -) - - -_LISTSNAPSHOTSRESPONSE = _descriptor.Descriptor( - name="ListSnapshotsResponse", - full_name="google.pubsub.v1.ListSnapshotsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="snapshots", - full_name="google.pubsub.v1.ListSnapshotsResponse.snapshots", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.pubsub.v1.ListSnapshotsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4321, - serialized_end=4416, -) - - -_DELETESNAPSHOTREQUEST = _descriptor.Descriptor( - name="DeleteSnapshotRequest", - full_name="google.pubsub.v1.DeleteSnapshotRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="snapshot", - full_name="google.pubsub.v1.DeleteSnapshotRequest.snapshot", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4418, - serialized_end=4459, -) - - -_SEEKREQUEST = _descriptor.Descriptor( - name="SeekRequest", - full_name="google.pubsub.v1.SeekRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="subscription", - full_name="google.pubsub.v1.SeekRequest.subscription", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time", - full_name="google.pubsub.v1.SeekRequest.time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="snapshot", - full_name="google.pubsub.v1.SeekRequest.snapshot", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="target", - full_name="google.pubsub.v1.SeekRequest.target", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=4461, - serialized_end=4570, -) - - -_SEEKRESPONSE = _descriptor.Descriptor( - name="SeekResponse", - full_name="google.pubsub.v1.SeekResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4572, - serialized_end=4586, -) - -_TOPIC_LABELSENTRY.containing_type = _TOPIC -_TOPIC.fields_by_name["labels"].message_type = _TOPIC_LABELSENTRY -_TOPIC.fields_by_name["message_storage_policy"].message_type = _MESSAGESTORAGEPOLICY -_PUBSUBMESSAGE_ATTRIBUTESENTRY.containing_type = _PUBSUBMESSAGE -_PUBSUBMESSAGE.fields_by_name[ - "attributes" -].message_type = _PUBSUBMESSAGE_ATTRIBUTESENTRY -_PUBSUBMESSAGE.fields_by_name[ - "publish_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_UPDATETOPICREQUEST.fields_by_name["topic"].message_type = _TOPIC -_UPDATETOPICREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_PUBLISHREQUEST.fields_by_name["messages"].message_type = _PUBSUBMESSAGE -_LISTTOPICSRESPONSE.fields_by_name["topics"].message_type = _TOPIC -_SUBSCRIPTION_LABELSENTRY.containing_type = _SUBSCRIPTION -_SUBSCRIPTION.fields_by_name["push_config"].message_type = _PUSHCONFIG -_SUBSCRIPTION.fields_by_name[ - "message_retention_duration" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_SUBSCRIPTION.fields_by_name["labels"].message_type = _SUBSCRIPTION_LABELSENTRY -_SUBSCRIPTION.fields_by_name["expiration_policy"].message_type = _EXPIRATIONPOLICY -_SUBSCRIPTION.fields_by_name["dead_letter_policy"].message_type = _DEADLETTERPOLICY -_EXPIRATIONPOLICY.fields_by_name[ - "ttl" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_PUSHCONFIG_OIDCTOKEN.containing_type = _PUSHCONFIG -_PUSHCONFIG_ATTRIBUTESENTRY.containing_type = _PUSHCONFIG -_PUSHCONFIG.fields_by_name["attributes"].message_type = _PUSHCONFIG_ATTRIBUTESENTRY -_PUSHCONFIG.fields_by_name["oidc_token"].message_type = _PUSHCONFIG_OIDCTOKEN -_PUSHCONFIG.oneofs_by_name["authentication_method"].fields.append( - _PUSHCONFIG.fields_by_name["oidc_token"] -) -_PUSHCONFIG.fields_by_name["oidc_token"].containing_oneof = _PUSHCONFIG.oneofs_by_name[ - "authentication_method" -] -_RECEIVEDMESSAGE.fields_by_name["message"].message_type = _PUBSUBMESSAGE -_UPDATESUBSCRIPTIONREQUEST.fields_by_name["subscription"].message_type = _SUBSCRIPTION -_UPDATESUBSCRIPTIONREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTSUBSCRIPTIONSRESPONSE.fields_by_name["subscriptions"].message_type = _SUBSCRIPTION -_MODIFYPUSHCONFIGREQUEST.fields_by_name["push_config"].message_type = _PUSHCONFIG -_PULLRESPONSE.fields_by_name["received_messages"].message_type = _RECEIVEDMESSAGE -_STREAMINGPULLRESPONSE.fields_by_name[ - "received_messages" -].message_type = _RECEIVEDMESSAGE -_CREATESNAPSHOTREQUEST_LABELSENTRY.containing_type = _CREATESNAPSHOTREQUEST -_CREATESNAPSHOTREQUEST.fields_by_name[ - "labels" -].message_type = _CREATESNAPSHOTREQUEST_LABELSENTRY -_UPDATESNAPSHOTREQUEST.fields_by_name["snapshot"].message_type = _SNAPSHOT -_UPDATESNAPSHOTREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_SNAPSHOT_LABELSENTRY.containing_type = _SNAPSHOT -_SNAPSHOT.fields_by_name[ - "expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SNAPSHOT.fields_by_name["labels"].message_type = _SNAPSHOT_LABELSENTRY -_LISTSNAPSHOTSRESPONSE.fields_by_name["snapshots"].message_type = _SNAPSHOT -_SEEKREQUEST.fields_by_name[ - "time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SEEKREQUEST.oneofs_by_name["target"].fields.append(_SEEKREQUEST.fields_by_name["time"]) -_SEEKREQUEST.fields_by_name["time"].containing_oneof = _SEEKREQUEST.oneofs_by_name[ - "target" -] -_SEEKREQUEST.oneofs_by_name["target"].fields.append( - _SEEKREQUEST.fields_by_name["snapshot"] -) -_SEEKREQUEST.fields_by_name["snapshot"].containing_oneof = _SEEKREQUEST.oneofs_by_name[ - "target" -] -DESCRIPTOR.message_types_by_name["MessageStoragePolicy"] = _MESSAGESTORAGEPOLICY -DESCRIPTOR.message_types_by_name["Topic"] = _TOPIC -DESCRIPTOR.message_types_by_name["PubsubMessage"] = _PUBSUBMESSAGE -DESCRIPTOR.message_types_by_name["GetTopicRequest"] = _GETTOPICREQUEST -DESCRIPTOR.message_types_by_name["UpdateTopicRequest"] = _UPDATETOPICREQUEST -DESCRIPTOR.message_types_by_name["PublishRequest"] = _PUBLISHREQUEST -DESCRIPTOR.message_types_by_name["PublishResponse"] = _PUBLISHRESPONSE -DESCRIPTOR.message_types_by_name["ListTopicsRequest"] = _LISTTOPICSREQUEST -DESCRIPTOR.message_types_by_name["ListTopicsResponse"] = _LISTTOPICSRESPONSE -DESCRIPTOR.message_types_by_name[ - "ListTopicSubscriptionsRequest" -] = _LISTTOPICSUBSCRIPTIONSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListTopicSubscriptionsResponse" -] = _LISTTOPICSUBSCRIPTIONSRESPONSE -DESCRIPTOR.message_types_by_name[ - "ListTopicSnapshotsRequest" -] = _LISTTOPICSNAPSHOTSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListTopicSnapshotsResponse" -] = _LISTTOPICSNAPSHOTSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteTopicRequest"] = _DELETETOPICREQUEST -DESCRIPTOR.message_types_by_name["Subscription"] = _SUBSCRIPTION -DESCRIPTOR.message_types_by_name["DeadLetterPolicy"] = _DEADLETTERPOLICY -DESCRIPTOR.message_types_by_name["ExpirationPolicy"] = _EXPIRATIONPOLICY -DESCRIPTOR.message_types_by_name["PushConfig"] = _PUSHCONFIG -DESCRIPTOR.message_types_by_name["ReceivedMessage"] = _RECEIVEDMESSAGE -DESCRIPTOR.message_types_by_name["GetSubscriptionRequest"] = _GETSUBSCRIPTIONREQUEST -DESCRIPTOR.message_types_by_name[ - "UpdateSubscriptionRequest" -] = _UPDATESUBSCRIPTIONREQUEST -DESCRIPTOR.message_types_by_name["ListSubscriptionsRequest"] = _LISTSUBSCRIPTIONSREQUEST -DESCRIPTOR.message_types_by_name[ - "ListSubscriptionsResponse" -] = _LISTSUBSCRIPTIONSRESPONSE -DESCRIPTOR.message_types_by_name[ - "DeleteSubscriptionRequest" -] = _DELETESUBSCRIPTIONREQUEST -DESCRIPTOR.message_types_by_name["ModifyPushConfigRequest"] = _MODIFYPUSHCONFIGREQUEST -DESCRIPTOR.message_types_by_name["PullRequest"] = _PULLREQUEST -DESCRIPTOR.message_types_by_name["PullResponse"] = _PULLRESPONSE -DESCRIPTOR.message_types_by_name["ModifyAckDeadlineRequest"] = _MODIFYACKDEADLINEREQUEST -DESCRIPTOR.message_types_by_name["AcknowledgeRequest"] = _ACKNOWLEDGEREQUEST -DESCRIPTOR.message_types_by_name["StreamingPullRequest"] = _STREAMINGPULLREQUEST -DESCRIPTOR.message_types_by_name["StreamingPullResponse"] = _STREAMINGPULLRESPONSE -DESCRIPTOR.message_types_by_name["CreateSnapshotRequest"] = _CREATESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name["UpdateSnapshotRequest"] = _UPDATESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name["Snapshot"] = _SNAPSHOT -DESCRIPTOR.message_types_by_name["GetSnapshotRequest"] = _GETSNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name["ListSnapshotsRequest"] = _LISTSNAPSHOTSREQUEST -DESCRIPTOR.message_types_by_name["ListSnapshotsResponse"] = _LISTSNAPSHOTSRESPONSE -DESCRIPTOR.message_types_by_name["DeleteSnapshotRequest"] = _DELETESNAPSHOTREQUEST -DESCRIPTOR.message_types_by_name["SeekRequest"] = _SEEKREQUEST -DESCRIPTOR.message_types_by_name["SeekResponse"] = _SEEKRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -MessageStoragePolicy = _reflection.GeneratedProtocolMessageType( - "MessageStoragePolicy", - (_message.Message,), - dict( - DESCRIPTOR=_MESSAGESTORAGEPOLICY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A message storage policy. - - - Attributes: - allowed_persistence_regions: - A list of IDs of GCP regions where messages that are published - to the topic may be persisted in storage. Messages published - by publishers running in non-allowed GCP regions (or running - outside of GCP altogether) will be routed for storage in one - of the allowed regions. An empty list means that no regions - are allowed, and is not a valid configuration. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.MessageStoragePolicy) - ), -) -_sym_db.RegisterMessage(MessageStoragePolicy) - -Topic = _reflection.GeneratedProtocolMessageType( - "Topic", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TOPIC_LABELSENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Topic.LabelsEntry) - ), - ), - DESCRIPTOR=_TOPIC, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A topic resource. - - - Attributes: - name: - The name of the topic. It must have the format - ``"projects/{project}/topics/{topic}"``. ``{topic}`` must - start with a letter, and contain only letters (``[A-Za-z]``), - numbers (``[0-9]``), dashes (``-``), underscores (``_``), - periods (``.``), tildes (``~``), plus (``+``) or percent signs - (``%``). It must be between 3 and 255 characters in length, - and it must not start with ``"goog"``. - labels: - See Creating and managing labels. - message_storage_policy: - Policy constraining the set of Google Cloud Platform regions - where messages published to the topic may be stored. If not - present, then no constraints are in effect. - kms_key_name: - The resource name of the Cloud KMS CryptoKey to be used to - protect access to messages published on this topic. The - expected format is - ``projects/*/locations/*/keyRings/*/cryptoKeys/*``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Topic) - ), -) -_sym_db.RegisterMessage(Topic) -_sym_db.RegisterMessage(Topic.LabelsEntry) - -PubsubMessage = _reflection.GeneratedProtocolMessageType( - "PubsubMessage", - (_message.Message,), - dict( - AttributesEntry=_reflection.GeneratedProtocolMessageType( - "AttributesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_PUBSUBMESSAGE_ATTRIBUTESENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PubsubMessage.AttributesEntry) - ), - ), - DESCRIPTOR=_PUBSUBMESSAGE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A message that is published by publishers and consumed by subscribers. - The message must contain either a non-empty data field or at least one - attribute. Note that client libraries represent this object differently - depending on the language. See the corresponding client library - documentation for more information. See Quotas and limits for more - information about message limits. - - - Attributes: - data: - The message data field. If this field is empty, the message - must contain at least one attribute. - attributes: - Optional attributes for this message. - message_id: - ID of this message, assigned by the server when the message is - published. Guaranteed to be unique within the topic. This - value may be read by a subscriber that receives a - ``PubsubMessage`` via a ``Pull`` call or a push delivery. It - must not be populated by the publisher in a ``Publish`` call. - publish_time: - The time at which the message was published, populated by the - server when it receives the ``Publish`` call. It must not be - populated by the publisher in a ``Publish`` call. - ordering_key: - Identifies related messages for which publish order should be - respected. If a ``Subscription`` has - ``enable_message_ordering`` set to ``true``, messages - published with the same ``ordering_key`` value will be - delivered to subscribers in the order in which they are - received by the Pub/Sub system. EXPERIMENTAL: This feature is - part of a closed alpha release. This API might be changed in - backward-incompatible ways and is not recommended for - production use. It is not subject to any SLA or deprecation - policy. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PubsubMessage) - ), -) -_sym_db.RegisterMessage(PubsubMessage) -_sym_db.RegisterMessage(PubsubMessage.AttributesEntry) - -GetTopicRequest = _reflection.GeneratedProtocolMessageType( - "GetTopicRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETTOPICREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the GetTopic method. - - - Attributes: - topic: - The name of the topic to get. Format is - ``projects/{project}/topics/{topic}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.GetTopicRequest) - ), -) -_sym_db.RegisterMessage(GetTopicRequest) - -UpdateTopicRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTopicRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETOPICREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the UpdateTopic method. - - - Attributes: - topic: - The updated topic object. - update_mask: - Indicates which fields in the provided topic to update. Must - be specified and non-empty. Note that if ``update_mask`` - contains "message\_storage\_policy" then the new value will be - determined based on the policy configured at the project or - organization level. The ``message_storage_policy`` must not be - set in the ``topic`` provided above. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateTopicRequest) - ), -) -_sym_db.RegisterMessage(UpdateTopicRequest) - -PublishRequest = _reflection.GeneratedProtocolMessageType( - "PublishRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PUBLISHREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the Publish method. - - - Attributes: - topic: - The messages in the request will be published on this topic. - Format is ``projects/{project}/topics/{topic}``. - messages: - The messages to publish. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishRequest) - ), -) -_sym_db.RegisterMessage(PublishRequest) - -PublishResponse = _reflection.GeneratedProtocolMessageType( - "PublishResponse", - (_message.Message,), - dict( - DESCRIPTOR=_PUBLISHRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``Publish`` method. - - - Attributes: - message_ids: - The server-assigned ID of each published message, in the same - order as the messages in the request. IDs are guaranteed to be - unique within the topic. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PublishResponse) - ), -) -_sym_db.RegisterMessage(PublishResponse) - -ListTopicsRequest = _reflection.GeneratedProtocolMessageType( - "ListTopicsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``ListTopics`` method. - - - Attributes: - project: - The name of the project in which to list topics. Format is - ``projects/{project-id}``. - page_size: - Maximum number of topics to return. - page_token: - The value returned by the last ``ListTopicsResponse``; - indicates that this is a continuation of a prior - ``ListTopics`` call, and that the system should return the - next page of data. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsRequest) - ), -) -_sym_db.RegisterMessage(ListTopicsRequest) - -ListTopicsResponse = _reflection.GeneratedProtocolMessageType( - "ListTopicsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``ListTopics`` method. - - - Attributes: - topics: - The resulting topics. - next_page_token: - If not empty, indicates that there may be more topics that - match the request; this value should be passed in a new - ``ListTopicsRequest``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicsResponse) - ), -) -_sym_db.RegisterMessage(ListTopicsResponse) - -ListTopicSubscriptionsRequest = _reflection.GeneratedProtocolMessageType( - "ListTopicSubscriptionsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSUBSCRIPTIONSREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``ListTopicSubscriptions`` method. - - - Attributes: - topic: - The name of the topic that subscriptions are attached to. - Format is ``projects/{project}/topics/{topic}``. - page_size: - Maximum number of subscription names to return. - page_token: - The value returned by the last - ``ListTopicSubscriptionsResponse``; indicates that this is a - continuation of a prior ``ListTopicSubscriptions`` call, and - that the system should return the next page of data. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsRequest) - ), -) -_sym_db.RegisterMessage(ListTopicSubscriptionsRequest) - -ListTopicSubscriptionsResponse = _reflection.GeneratedProtocolMessageType( - "ListTopicSubscriptionsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSUBSCRIPTIONSRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``ListTopicSubscriptions`` method. - - - Attributes: - subscriptions: - The names of the subscriptions that match the request. - next_page_token: - If not empty, indicates that there may be more subscriptions - that match the request; this value should be passed in a new - ``ListTopicSubscriptionsRequest`` to get more subscriptions. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSubscriptionsResponse) - ), -) -_sym_db.RegisterMessage(ListTopicSubscriptionsResponse) - -ListTopicSnapshotsRequest = _reflection.GeneratedProtocolMessageType( - "ListTopicSnapshotsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSNAPSHOTSREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``ListTopicSnapshots`` method. - - - Attributes: - topic: - The name of the topic that snapshots are attached to. Format - is ``projects/{project}/topics/{topic}``. - page_size: - Maximum number of snapshot names to return. - page_token: - The value returned by the last ``ListTopicSnapshotsResponse``; - indicates that this is a continuation of a prior - ``ListTopicSnapshots`` call, and that the system should return - the next page of data. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSnapshotsRequest) - ), -) -_sym_db.RegisterMessage(ListTopicSnapshotsRequest) - -ListTopicSnapshotsResponse = _reflection.GeneratedProtocolMessageType( - "ListTopicSnapshotsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTOPICSNAPSHOTSRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``ListTopicSnapshots`` method. - - - Attributes: - snapshots: - The names of the snapshots that match the request. - next_page_token: - If not empty, indicates that there may be more snapshots that - match the request; this value should be passed in a new - ``ListTopicSnapshotsRequest`` to get more snapshots. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListTopicSnapshotsResponse) - ), -) -_sym_db.RegisterMessage(ListTopicSnapshotsResponse) - -DeleteTopicRequest = _reflection.GeneratedProtocolMessageType( - "DeleteTopicRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETETOPICREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``DeleteTopic`` method. - - - Attributes: - topic: - Name of the topic to delete. Format is - ``projects/{project}/topics/{topic}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteTopicRequest) - ), -) -_sym_db.RegisterMessage(DeleteTopicRequest) - -Subscription = _reflection.GeneratedProtocolMessageType( - "Subscription", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SUBSCRIPTION_LABELSENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription.LabelsEntry) - ), - ), - DESCRIPTOR=_SUBSCRIPTION, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A subscription resource. - - - Attributes: - name: - The name of the subscription. It must have the format - ``"projects/{project}/subscriptions/{subscription}"``. - ``{subscription}`` must start with a letter, and contain only - letters (``[A-Za-z]``), numbers (``[0-9]``), dashes (``-``), - underscores (``_``), periods (``.``), tildes (``~``), plus - (``+``) or percent signs (``%``). It must be between 3 and 255 - characters in length, and it must not start with ``"goog"``. - topic: - The name of the topic from which this subscription is - receiving messages. Format is - ``projects/{project}/topics/{topic}``. The value of this field - will be ``_deleted-topic_`` if the topic has been deleted. - push_config: - If push delivery is used with this subscription, this field is - used to configure it. An empty ``pushConfig`` signifies that - the subscriber will pull and ack messages using API methods. - ack_deadline_seconds: - The approximate amount of time (on a best-effort basis) - Pub/Sub waits for the subscriber to acknowledge receipt before - resending the message. In the interval after the message is - delivered and before it is acknowledged, it is considered to - be outstanding. During that time period, the message will not - be redelivered (on a best-effort basis). For pull - subscriptions, this value is used as the initial value for the - ack deadline. To override this value for a given message, call - ``ModifyAckDeadline`` with the corresponding ``ack_id`` if - using non-streaming pull or send the ``ack_id`` in a - ``StreamingModifyAckDeadlineRequest`` if using streaming pull. - The minimum custom deadline you can specify is 10 seconds. The - maximum custom deadline you can specify is 600 seconds (10 - minutes). If this parameter is 0, a default value of 10 - seconds is used. For push delivery, this value is also used - to set the request timeout for the call to the push endpoint. - If the subscriber never acknowledges the message, the Pub/Sub - system will eventually redeliver the message. - retain_acked_messages: - Indicates whether to retain acknowledged messages. If true, - then messages are not expunged from the subscription's - backlog, even if they are acknowledged, until they fall out of - the ``message_retention_duration`` window. This must be true - if you would like to Seek to a timestamp. - message_retention_duration: - How long to retain unacknowledged messages in the - subscription's backlog, from the moment a message is - published. If ``retain_acked_messages`` is true, then this - also configures the retention of acknowledged messages, and - thus configures how far back in time a ``Seek`` can be done. - Defaults to 7 days. Cannot be more than 7 days or less than 10 - minutes. - labels: - See Creating and managing labels. - enable_message_ordering: - If true, messages published with the same ``ordering_key`` in - ``PubsubMessage`` will be delivered to the subscribers in the - order in which they are received by the Pub/Sub system. - Otherwise, they may be delivered in any order. EXPERIMENTAL: - This feature is part of a closed alpha release. This API might - be changed in backward-incompatible ways and is not - recommended for production use. It is not subject to any SLA - or deprecation policy. - expiration_policy: - A policy that specifies the conditions for this subscription's - expiration. A subscription is considered active as long as any - connected subscriber is successfully consuming messages from - the subscription or is issuing operations on the subscription. - If ``expiration_policy`` is not set, a *default policy* with - ``ttl`` of 31 days will be used. The minimum allowed value for - ``expiration_policy.ttl`` is 1 day. - dead_letter_policy: - A policy that specifies the conditions for dead lettering - messages in this subscription. If dead\_letter\_policy is not - set, dead lettering is disabled. The Cloud Pub/Sub service - account associated with this subscriptions's parent project - (i.e., service-{project\_number}@gcp-sa- - pubsub.iam.gserviceaccount.com) must have permission to - Acknowledge() messages on this subscription. EXPERIMENTAL: - This feature is part of a closed alpha release. This API might - be changed in backward-incompatible ways and is not - recommended for production use. It is not subject to any SLA - or deprecation policy. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Subscription) - ), -) -_sym_db.RegisterMessage(Subscription) -_sym_db.RegisterMessage(Subscription.LabelsEntry) - -DeadLetterPolicy = _reflection.GeneratedProtocolMessageType( - "DeadLetterPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_DEADLETTERPOLICY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Dead lettering is done on a best effort basis. The same message might be - dead lettered multiple times. - - If validation on any of the fields fails at subscription - creation/updation, the create/update subscription request will fail. - - - Attributes: - dead_letter_topic: - The name of the topic to which dead letter messages should be - published. Format is ``projects/{project}/topics/{topic}``.The - Cloud Pub/Sub service account associated with the enclosing - subscription's parent project (i.e., - service-{project\_number}@gcp-sa- - pubsub.iam.gserviceaccount.com) must have permission to - Publish() to this topic. The operation will fail if the topic - does not exist. Users should ensure that there is a - subscription attached to this topic since messages published - to a topic with no subscriptions are lost. - max_delivery_attempts: - The maximum number of delivery attempts for any message. The - value must be between 5 and 100. The number of delivery - attempts is defined as 1 + (the sum of number of NACKs and - number of times the acknowledgement deadline has been exceeded - for the message). A NACK is any call to ModifyAckDeadline - with a 0 deadline. Note that client libraries may - automatically extend ack\_deadlines. This field will be - honored on a best effort basis. If this parameter is 0, a - default value of 5 is used. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.DeadLetterPolicy) - ), -) -_sym_db.RegisterMessage(DeadLetterPolicy) - -ExpirationPolicy = _reflection.GeneratedProtocolMessageType( - "ExpirationPolicy", - (_message.Message,), - dict( - DESCRIPTOR=_EXPIRATIONPOLICY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A policy that specifies the conditions for resource expiration (i.e., - automatic resource deletion). - - - Attributes: - ttl: - Specifies the "time-to-live" duration for an associated - resource. The resource expires if it is not active for a - period of ``ttl``. The definition of "activity" depends on the - type of the associated resource. The minimum and maximum - allowed values for ``ttl`` depend on the type of the - associated resource, as well. If ``ttl`` is not set, the - associated resource never expires. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ExpirationPolicy) - ), -) -_sym_db.RegisterMessage(ExpirationPolicy) - -PushConfig = _reflection.GeneratedProtocolMessageType( - "PushConfig", - (_message.Message,), - dict( - OidcToken=_reflection.GeneratedProtocolMessageType( - "OidcToken", - (_message.Message,), - dict( - DESCRIPTOR=_PUSHCONFIG_OIDCTOKEN, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Contains information needed for generating an `OpenID Connect - token `__. - - - Attributes: - service_account_email: - `Service account email - `__ to be - used for generating the OIDC token. The caller (for - CreateSubscription, UpdateSubscription, and ModifyPushConfig - RPCs) must have the iam.serviceAccounts.actAs permission for - the service account. - audience: - Audience to be used when generating OIDC token. The audience - claim identifies the recipients that the JWT is intended for. - The audience value is a single case-sensitive string. Having - multiple values (array) for the audience field is not - supported. More info about the OIDC JWT token audience here: - https://tools.ietf.org/html/rfc7519#section-4.1.3 Note: if not - specified, the Push endpoint URL will be used. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig.OidcToken) - ), - ), - AttributesEntry=_reflection.GeneratedProtocolMessageType( - "AttributesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_PUSHCONFIG_ATTRIBUTESENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig.AttributesEntry) - ), - ), - DESCRIPTOR=_PUSHCONFIG, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Configuration for a push delivery endpoint. - - - Attributes: - push_endpoint: - A URL locating the endpoint to which messages should be - pushed. For example, a Webhook endpoint might use - "https://example.com/push". - attributes: - Endpoint configuration attributes that can be used to control - different aspects of the message delivery. The only currently - supported attribute is ``x-goog-version``, which you can use - to change the format of the pushed message. This attribute - indicates the version of the data expected by the endpoint. - This controls the shape of the pushed message (i.e., its - fields and metadata). If not present during the - ``CreateSubscription`` call, it will default to the version of - the Pub/Sub API used to make such call. If not present in a - ``ModifyPushConfig`` call, its value will not be changed. - ``GetSubscription`` calls will always return a valid version, - even if the subscription was created without this attribute. - The only supported values for the ``x-goog-version`` attribute - are: - ``v1beta1``: uses the push format defined in the - v1beta1 Pub/Sub API. - ``v1`` or ``v1beta2``: uses the push - format defined in the v1 Pub/Sub API. For example: .. - raw:: html
attributes { "x-goog-version": "v1"
-          } 
- authentication_method: - An authentication method used by push endpoints to verify the - source of push requests. This can be used with push endpoints - that are private by default to allow requests only from the - Cloud Pub/Sub system, for example. This field is optional and - should be set only by users interested in authenticated push. - oidc_token: - If specified, Pub/Sub will generate and attach an OIDC JWT - token as an ``Authorization`` header in the HTTP request for - every pushed message. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PushConfig) - ), -) -_sym_db.RegisterMessage(PushConfig) -_sym_db.RegisterMessage(PushConfig.OidcToken) -_sym_db.RegisterMessage(PushConfig.AttributesEntry) - -ReceivedMessage = _reflection.GeneratedProtocolMessageType( - "ReceivedMessage", - (_message.Message,), - dict( - DESCRIPTOR=_RECEIVEDMESSAGE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A message and its corresponding acknowledgment ID. - - - Attributes: - ack_id: - This ID can be used to acknowledge the received message. - message: - The message. - delivery_attempt: - Delivery attempt counter is 1 + (the sum of number of NACKs - and number of ack\_deadline exceeds) for this message. A NACK - is any call to ModifyAckDeadline with a 0 deadline. An - ack\_deadline exceeds event is whenever a message is not - acknowledged within ack\_deadline. Note that ack\_deadline is - initially Subscription.ackDeadlineSeconds, but may get - extended automatically by the client library. The first - delivery of a given message will have this value as 1. The - value is calculated at best effort and is approximate. If a - DeadLetterPolicy is not set on the subscription, this will be - 0. EXPERIMENTAL: This feature is part of a closed alpha - release. This API might be changed in backward-incompatible - ways and is not recommended for production use. It is not - subject to any SLA or deprecation policy. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ReceivedMessage) - ), -) -_sym_db.RegisterMessage(ReceivedMessage) - -GetSubscriptionRequest = _reflection.GeneratedProtocolMessageType( - "GetSubscriptionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSUBSCRIPTIONREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the GetSubscription method. - - - Attributes: - subscription: - The name of the subscription to get. Format is - ``projects/{project}/subscriptions/{sub}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSubscriptionRequest) - ), -) -_sym_db.RegisterMessage(GetSubscriptionRequest) - -UpdateSubscriptionRequest = _reflection.GeneratedProtocolMessageType( - "UpdateSubscriptionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESUBSCRIPTIONREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the UpdateSubscription method. - - - Attributes: - subscription: - The updated subscription object. - update_mask: - Indicates which fields in the provided subscription to update. - Must be specified and non-empty. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateSubscriptionRequest) - ), -) -_sym_db.RegisterMessage(UpdateSubscriptionRequest) - -ListSubscriptionsRequest = _reflection.GeneratedProtocolMessageType( - "ListSubscriptionsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSUBSCRIPTIONSREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``ListSubscriptions`` method. - - - Attributes: - project: - The name of the project in which to list subscriptions. Format - is ``projects/{project-id}``. - page_size: - Maximum number of subscriptions to return. - page_token: - The value returned by the last ``ListSubscriptionsResponse``; - indicates that this is a continuation of a prior - ``ListSubscriptions`` call, and that the system should return - the next page of data. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsRequest) - ), -) -_sym_db.RegisterMessage(ListSubscriptionsRequest) - -ListSubscriptionsResponse = _reflection.GeneratedProtocolMessageType( - "ListSubscriptionsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSUBSCRIPTIONSRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``ListSubscriptions`` method. - - - Attributes: - subscriptions: - The subscriptions that match the request. - next_page_token: - If not empty, indicates that there may be more subscriptions - that match the request; this value should be passed in a new - ``ListSubscriptionsRequest`` to get more subscriptions. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSubscriptionsResponse) - ), -) -_sym_db.RegisterMessage(ListSubscriptionsResponse) - -DeleteSubscriptionRequest = _reflection.GeneratedProtocolMessageType( - "DeleteSubscriptionRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESUBSCRIPTIONREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the DeleteSubscription method. - - - Attributes: - subscription: - The subscription to delete. Format is - ``projects/{project}/subscriptions/{sub}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSubscriptionRequest) - ), -) -_sym_db.RegisterMessage(DeleteSubscriptionRequest) - -ModifyPushConfigRequest = _reflection.GeneratedProtocolMessageType( - "ModifyPushConfigRequest", - (_message.Message,), - dict( - DESCRIPTOR=_MODIFYPUSHCONFIGREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ModifyPushConfig method. - - - Attributes: - subscription: - The name of the subscription. Format is - ``projects/{project}/subscriptions/{sub}``. - push_config: - The push configuration for future deliveries. An empty - ``pushConfig`` indicates that the Pub/Sub system should stop - pushing messages from the given subscription and allow - messages to be pulled and acknowledged - effectively pausing - the subscription if ``Pull`` or ``StreamingPull`` is not - called. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyPushConfigRequest) - ), -) -_sym_db.RegisterMessage(ModifyPushConfigRequest) - -PullRequest = _reflection.GeneratedProtocolMessageType( - "PullRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PULLREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``Pull`` method. - - - Attributes: - subscription: - The subscription from which messages should be pulled. Format - is ``projects/{project}/subscriptions/{sub}``. - return_immediately: - If this field set to true, the system will respond immediately - even if it there are no messages available to return in the - ``Pull`` response. Otherwise, the system may wait (for a - bounded amount of time) until at least one message is - available, rather than returning no messages. - max_messages: - The maximum number of messages to return for this request. - Must be a positive integer. The Pub/Sub system may return - fewer than the number specified. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PullRequest) - ), -) -_sym_db.RegisterMessage(PullRequest) - -PullResponse = _reflection.GeneratedProtocolMessageType( - "PullResponse", - (_message.Message,), - dict( - DESCRIPTOR=_PULLRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``Pull`` method. - - - Attributes: - received_messages: - Received Pub/Sub messages. The list will be empty if there are - no more messages available in the backlog. For JSON, the - response can be entirely empty. The Pub/Sub system may return - fewer than the ``maxMessages`` requested even if there are - more messages available in the backlog. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.PullResponse) - ), -) -_sym_db.RegisterMessage(PullResponse) - -ModifyAckDeadlineRequest = _reflection.GeneratedProtocolMessageType( - "ModifyAckDeadlineRequest", - (_message.Message,), - dict( - DESCRIPTOR=_MODIFYACKDEADLINEREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ModifyAckDeadline method. - - - Attributes: - subscription: - The name of the subscription. Format is - ``projects/{project}/subscriptions/{sub}``. - ack_ids: - List of acknowledgment IDs. - ack_deadline_seconds: - The new ack deadline with respect to the time this request was - sent to the Pub/Sub system. For example, if the value is 10, - the new ack deadline will expire 10 seconds after the - ``ModifyAckDeadline`` call was made. Specifying zero might - immediately make the message available for delivery to another - subscriber client. This typically results in an increase in - the rate of message redeliveries (that is, duplicates). The - minimum deadline you can specify is 0 seconds. The maximum - deadline you can specify is 600 seconds (10 minutes). - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ModifyAckDeadlineRequest) - ), -) -_sym_db.RegisterMessage(ModifyAckDeadlineRequest) - -AcknowledgeRequest = _reflection.GeneratedProtocolMessageType( - "AcknowledgeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ACKNOWLEDGEREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the Acknowledge method. - - - Attributes: - subscription: - The subscription whose message is being acknowledged. Format - is ``projects/{project}/subscriptions/{sub}``. - ack_ids: - The acknowledgment ID for the messages being acknowledged that - was returned by the Pub/Sub system in the ``Pull`` response. - Must not be empty. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.AcknowledgeRequest) - ), -) -_sym_db.RegisterMessage(AcknowledgeRequest) - -StreamingPullRequest = _reflection.GeneratedProtocolMessageType( - "StreamingPullRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGPULLREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``StreamingPull`` streaming RPC method. This request is - used to establish the initial stream as well as to stream - acknowledgements and ack deadline modifications from the client to the - server. - - - Attributes: - subscription: - The subscription for which to initialize the new stream. This - must be provided in the first request on the stream, and must - not be set in subsequent requests from client to server. - Format is ``projects/{project}/subscriptions/{sub}``. - ack_ids: - List of acknowledgement IDs for acknowledging previously - received messages (received on this stream or a different - stream). If an ack ID has expired, the corresponding message - may be redelivered later. Acknowledging a message more than - once will not result in an error. If the acknowledgement ID is - malformed, the stream will be aborted with status - ``INVALID_ARGUMENT``. - modify_deadline_seconds: - The list of new ack deadlines for the IDs listed in - ``modify_deadline_ack_ids``. The size of this list must be the - same as the size of ``modify_deadline_ack_ids``. If it differs - the stream will be aborted with ``INVALID_ARGUMENT``. Each - element in this list is applied to the element in the same - position in ``modify_deadline_ack_ids``. The new ack deadline - is with respect to the time this request was sent to the - Pub/Sub system. Must be >= 0. For example, if the value is 10, - the new ack deadline will expire 10 seconds after this request - is received. If the value is 0, the message is immediately - made available for another streaming or non-streaming pull - request. If the value is < 0 (an error), the stream will be - aborted with status ``INVALID_ARGUMENT``. - modify_deadline_ack_ids: - List of acknowledgement IDs whose deadline will be modified - based on the corresponding element in - ``modify_deadline_seconds``. This field can be used to - indicate that more time is needed to process a message by the - subscriber, or to make the message available for redelivery if - the processing was interrupted. - stream_ack_deadline_seconds: - The ack deadline to use for the stream. This must be provided - in the first request on the stream, but it can also be updated - on subsequent requests from client to server. The minimum - deadline you can specify is 10 seconds. The maximum deadline - you can specify is 600 seconds (10 minutes). - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullRequest) - ), -) -_sym_db.RegisterMessage(StreamingPullRequest) - -StreamingPullResponse = _reflection.GeneratedProtocolMessageType( - "StreamingPullResponse", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGPULLRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``StreamingPull`` method. This response is used to - stream messages from the server to the client. - - - Attributes: - received_messages: - Received Pub/Sub messages. This will not be empty. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.StreamingPullResponse) - ), -) -_sym_db.RegisterMessage(StreamingPullResponse) - -CreateSnapshotRequest = _reflection.GeneratedProtocolMessageType( - "CreateSnapshotRequest", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_CREATESNAPSHOTREQUEST_LABELSENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.CreateSnapshotRequest.LabelsEntry) - ), - ), - DESCRIPTOR=_CREATESNAPSHOTREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``CreateSnapshot`` method. - - - Attributes: - name: - Optional user-provided name for this snapshot. If the name is - not provided in the request, the server will assign a random - name for this snapshot on the same project as the - subscription. Note that for REST API requests, you must - specify a name. See the resource name rules. Format is - ``projects/{project}/snapshots/{snap}``. - subscription: - The subscription whose backlog the snapshot retains. - Specifically, the created snapshot is guaranteed to retain: - (a) The existing backlog on the subscription. More precisely, - this is defined as the messages in the subscription's backlog - that are unacknowledged upon the successful completion of the - ``CreateSnapshot`` request; as well as: (b) Any messages - published to the subscription's topic following the successful - completion of the CreateSnapshot request. Format is - ``projects/{project}/subscriptions/{sub}``. - labels: - See Creating and managing labels. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.CreateSnapshotRequest) - ), -) -_sym_db.RegisterMessage(CreateSnapshotRequest) -_sym_db.RegisterMessage(CreateSnapshotRequest.LabelsEntry) - -UpdateSnapshotRequest = _reflection.GeneratedProtocolMessageType( - "UpdateSnapshotRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATESNAPSHOTREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the UpdateSnapshot method. - - - Attributes: - snapshot: - The updated snapshot object. - update_mask: - Indicates which fields in the provided snapshot to update. - Must be specified and non-empty. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.UpdateSnapshotRequest) - ), -) -_sym_db.RegisterMessage(UpdateSnapshotRequest) - -Snapshot = _reflection.GeneratedProtocolMessageType( - "Snapshot", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SNAPSHOT_LABELSENTRY, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2" - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Snapshot.LabelsEntry) - ), - ), - DESCRIPTOR=_SNAPSHOT, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""A snapshot resource. Snapshots are used in Seek operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the - state captured by a snapshot. - - - Attributes: - name: - The name of the snapshot. - topic: - The name of the topic from which this snapshot is retaining - messages. - expire_time: - The snapshot is guaranteed to exist up until this time. A - newly-created snapshot expires no later than 7 days from the - time of its creation. Its exact lifetime is determined at - creation by the existing backlog in the source subscription. - Specifically, the lifetime of the snapshot is ``7 days - (age - of oldest unacked message in the subscription)``. For example, - consider a subscription whose oldest unacked message is 3 days - old. If a snapshot is created from this subscription, the - snapshot -- which will always capture this 3-day-old backlog - as long as the snapshot exists -- will expire in 4 days. The - service will refuse to create a snapshot that would expire in - less than 1 hour after creation. - labels: - See Creating and managing labels. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.Snapshot) - ), -) -_sym_db.RegisterMessage(Snapshot) -_sym_db.RegisterMessage(Snapshot.LabelsEntry) - -GetSnapshotRequest = _reflection.GeneratedProtocolMessageType( - "GetSnapshotRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETSNAPSHOTREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the GetSnapshot method. - - - Attributes: - snapshot: - The name of the snapshot to get. Format is - ``projects/{project}/snapshots/{snap}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.GetSnapshotRequest) - ), -) -_sym_db.RegisterMessage(GetSnapshotRequest) - -ListSnapshotsRequest = _reflection.GeneratedProtocolMessageType( - "ListSnapshotsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSNAPSHOTSREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``ListSnapshots`` method. - - - Attributes: - project: - The name of the project in which to list snapshots. Format is - ``projects/{project-id}``. - page_size: - Maximum number of snapshots to return. - page_token: - The value returned by the last ``ListSnapshotsResponse``; - indicates that this is a continuation of a prior - ``ListSnapshots`` call, and that the system should return the - next page of data. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSnapshotsRequest) - ), -) -_sym_db.RegisterMessage(ListSnapshotsRequest) - -ListSnapshotsResponse = _reflection.GeneratedProtocolMessageType( - "ListSnapshotsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTSNAPSHOTSRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``ListSnapshots`` method. - - - Attributes: - snapshots: - The resulting snapshots. - next_page_token: - If not empty, indicates that there may be more snapshot that - match the request; this value should be passed in a new - ``ListSnapshotsRequest``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.ListSnapshotsResponse) - ), -) -_sym_db.RegisterMessage(ListSnapshotsResponse) - -DeleteSnapshotRequest = _reflection.GeneratedProtocolMessageType( - "DeleteSnapshotRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETESNAPSHOTREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``DeleteSnapshot`` method. - - - Attributes: - snapshot: - The name of the snapshot to delete. Format is - ``projects/{project}/snapshots/{snap}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.DeleteSnapshotRequest) - ), -) -_sym_db.RegisterMessage(DeleteSnapshotRequest) - -SeekRequest = _reflection.GeneratedProtocolMessageType( - "SeekRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEEKREQUEST, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Request for the ``Seek`` method. - - - Attributes: - subscription: - The subscription to affect. - time: - The time to seek to. Messages retained in the subscription - that were published before this time are marked as - acknowledged, and messages retained in the subscription that - were published after this time are marked as unacknowledged. - Note that this operation affects only those messages retained - in the subscription (configured by the combination of - ``message_retention_duration`` and ``retain_acked_messages``). - For example, if ``time`` corresponds to a point before the - message retention window (or to a point before the system's - notion of the subscription creation time), only retained - messages will be marked as unacknowledged, and already- - expunged messages will not be restored. - snapshot: - The snapshot to seek to. The snapshot's topic must be the same - as that of the provided subscription. Format is - ``projects/{project}/snapshots/{snap}``. - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.SeekRequest) - ), -) -_sym_db.RegisterMessage(SeekRequest) - -SeekResponse = _reflection.GeneratedProtocolMessageType( - "SeekResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SEEKRESPONSE, - __module__="google.cloud.pubsub_v1.proto.pubsub_pb2", - __doc__="""Response for the ``Seek`` method (this response is empty). - """, - # @@protoc_insertion_point(class_scope:google.pubsub.v1.SeekResponse) - ), -) -_sym_db.RegisterMessage(SeekResponse) - - -DESCRIPTOR._options = None -_TOPIC_LABELSENTRY._options = None -_PUBSUBMESSAGE_ATTRIBUTESENTRY._options = None -_SUBSCRIPTION_LABELSENTRY._options = None -_PUSHCONFIG_ATTRIBUTESENTRY._options = None -_CREATESNAPSHOTREQUEST_LABELSENTRY._options = None -_SNAPSHOT_LABELSENTRY._options = None - -_PUBLISHER = _descriptor.ServiceDescriptor( - name="Publisher", - full_name="google.pubsub.v1.Publisher", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025pubsub.googleapis.com\322AUhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - ), - serialized_start=4589, - serialized_end=5790, - methods=[ - _descriptor.MethodDescriptor( - name="CreateTopic", - full_name="google.pubsub.v1.Publisher.CreateTopic", - index=0, - containing_service=None, - input_type=_TOPIC, - output_type=_TOPIC, - serialized_options=_b( - "\202\323\344\223\002#\032\036/v1/{name=projects/*/topics/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTopic", - full_name="google.pubsub.v1.Publisher.UpdateTopic", - index=1, - containing_service=None, - input_type=_UPDATETOPICREQUEST, - output_type=_TOPIC, - serialized_options=_b( - "\202\323\344\223\002)2$/v1/{topic.name=projects/*/topics/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="Publish", - full_name="google.pubsub.v1.Publisher.Publish", - index=2, - containing_service=None, - input_type=_PUBLISHREQUEST, - output_type=_PUBLISHRESPONSE, - serialized_options=_b( - "\202\323\344\223\002,\"'/v1/{topic=projects/*/topics/*}:publish:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="GetTopic", - full_name="google.pubsub.v1.Publisher.GetTopic", - index=3, - containing_service=None, - input_type=_GETTOPICREQUEST, - output_type=_TOPIC, - serialized_options=_b( - "\202\323\344\223\002!\022\037/v1/{topic=projects/*/topics/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListTopics", - full_name="google.pubsub.v1.Publisher.ListTopics", - index=4, - containing_service=None, - input_type=_LISTTOPICSREQUEST, - output_type=_LISTTOPICSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002!\022\037/v1/{project=projects/*}/topics" - ), - ), - _descriptor.MethodDescriptor( - name="ListTopicSubscriptions", - full_name="google.pubsub.v1.Publisher.ListTopicSubscriptions", - index=5, - containing_service=None, - input_type=_LISTTOPICSUBSCRIPTIONSREQUEST, - output_type=_LISTTOPICSUBSCRIPTIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002/\022-/v1/{topic=projects/*/topics/*}/subscriptions" - ), - ), - _descriptor.MethodDescriptor( - name="ListTopicSnapshots", - full_name="google.pubsub.v1.Publisher.ListTopicSnapshots", - index=6, - containing_service=None, - input_type=_LISTTOPICSNAPSHOTSREQUEST, - output_type=_LISTTOPICSNAPSHOTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002+\022)/v1/{topic=projects/*/topics/*}/snapshots" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteTopic", - full_name="google.pubsub.v1.Publisher.DeleteTopic", - index=7, - containing_service=None, - input_type=_DELETETOPICREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002!*\037/v1/{topic=projects/*/topics/*}" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_PUBLISHER) - -DESCRIPTOR.services_by_name["Publisher"] = _PUBLISHER - - -_SUBSCRIBER = _descriptor.ServiceDescriptor( - name="Subscriber", - full_name="google.pubsub.v1.Subscriber", - file=DESCRIPTOR, - index=1, - serialized_options=_b( - "\312A\025pubsub.googleapis.com\322AUhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/pubsub" - ), - serialized_start=5793, - serialized_end=8204, - methods=[ - _descriptor.MethodDescriptor( - name="CreateSubscription", - full_name="google.pubsub.v1.Subscriber.CreateSubscription", - index=0, - containing_service=None, - input_type=_SUBSCRIPTION, - output_type=_SUBSCRIPTION, - serialized_options=_b( - "\202\323\344\223\002*\032%/v1/{name=projects/*/subscriptions/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="GetSubscription", - full_name="google.pubsub.v1.Subscriber.GetSubscription", - index=1, - containing_service=None, - input_type=_GETSUBSCRIPTIONREQUEST, - output_type=_SUBSCRIPTION, - serialized_options=_b( - "\202\323\344\223\002/\022-/v1/{subscription=projects/*/subscriptions/*}" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateSubscription", - full_name="google.pubsub.v1.Subscriber.UpdateSubscription", - index=2, - containing_service=None, - input_type=_UPDATESUBSCRIPTIONREQUEST, - output_type=_SUBSCRIPTION, - serialized_options=_b( - "\202\323\344\223\002722/v1/{subscription.name=projects/*/subscriptions/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="ListSubscriptions", - full_name="google.pubsub.v1.Subscriber.ListSubscriptions", - index=3, - containing_service=None, - input_type=_LISTSUBSCRIPTIONSREQUEST, - output_type=_LISTSUBSCRIPTIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002(\022&/v1/{project=projects/*}/subscriptions" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteSubscription", - full_name="google.pubsub.v1.Subscriber.DeleteSubscription", - index=4, - containing_service=None, - input_type=_DELETESUBSCRIPTIONREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002/*-/v1/{subscription=projects/*/subscriptions/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ModifyAckDeadline", - full_name="google.pubsub.v1.Subscriber.ModifyAckDeadline", - index=5, - containing_service=None, - input_type=_MODIFYACKDEADLINEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002D"?/v1/{subscription=projects/*/subscriptions/*}:modifyAckDeadline:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="Acknowledge", - full_name="google.pubsub.v1.Subscriber.Acknowledge", - index=6, - containing_service=None, - input_type=_ACKNOWLEDGEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002>"9/v1/{subscription=projects/*/subscriptions/*}:acknowledge:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="Pull", - full_name="google.pubsub.v1.Subscriber.Pull", - index=7, - containing_service=None, - input_type=_PULLREQUEST, - output_type=_PULLRESPONSE, - serialized_options=_b( - '\202\323\344\223\0027"2/v1/{subscription=projects/*/subscriptions/*}:pull:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="StreamingPull", - full_name="google.pubsub.v1.Subscriber.StreamingPull", - index=8, - containing_service=None, - input_type=_STREAMINGPULLREQUEST, - output_type=_STREAMINGPULLRESPONSE, - serialized_options=None, - ), - _descriptor.MethodDescriptor( - name="ModifyPushConfig", - full_name="google.pubsub.v1.Subscriber.ModifyPushConfig", - index=9, - containing_service=None, - input_type=_MODIFYPUSHCONFIGREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002C">/v1/{subscription=projects/*/subscriptions/*}:modifyPushConfig:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="GetSnapshot", - full_name="google.pubsub.v1.Subscriber.GetSnapshot", - index=10, - containing_service=None, - input_type=_GETSNAPSHOTREQUEST, - output_type=_SNAPSHOT, - serialized_options=_b( - "\202\323\344\223\002'\022%/v1/{snapshot=projects/*/snapshots/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListSnapshots", - full_name="google.pubsub.v1.Subscriber.ListSnapshots", - index=11, - containing_service=None, - input_type=_LISTSNAPSHOTSREQUEST, - output_type=_LISTSNAPSHOTSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002$\022"/v1/{project=projects/*}/snapshots' - ), - ), - _descriptor.MethodDescriptor( - name="CreateSnapshot", - full_name="google.pubsub.v1.Subscriber.CreateSnapshot", - index=12, - containing_service=None, - input_type=_CREATESNAPSHOTREQUEST, - output_type=_SNAPSHOT, - serialized_options=_b( - "\202\323\344\223\002&\032!/v1/{name=projects/*/snapshots/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateSnapshot", - full_name="google.pubsub.v1.Subscriber.UpdateSnapshot", - index=13, - containing_service=None, - input_type=_UPDATESNAPSHOTREQUEST, - output_type=_SNAPSHOT, - serialized_options=_b( - "\202\323\344\223\002/2*/v1/{snapshot.name=projects/*/snapshots/*}:\001*" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteSnapshot", - full_name="google.pubsub.v1.Subscriber.DeleteSnapshot", - index=14, - containing_service=None, - input_type=_DELETESNAPSHOTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002'*%/v1/{snapshot=projects/*/snapshots/*}" - ), - ), - _descriptor.MethodDescriptor( - name="Seek", - full_name="google.pubsub.v1.Subscriber.Seek", - index=15, - containing_service=None, - input_type=_SEEKREQUEST, - output_type=_SEEKRESPONSE, - serialized_options=_b( - '\202\323\344\223\0027"2/v1/{subscription=projects/*/subscriptions/*}:seek:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_SUBSCRIBER) - -DESCRIPTOR.services_by_name["Subscriber"] = _SUBSCRIBER - -# @@protoc_insertion_point(module_scope) diff --git a/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2_grpc.py b/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2_grpc.py deleted file mode 100644 index dd1a365877e1..000000000000 --- a/pubsub/google/cloud/pubsub_v1/proto/pubsub_pb2_grpc.py +++ /dev/null @@ -1,573 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.pubsub_v1.proto import ( - pubsub_pb2 as google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class PublisherStub(object): - """The service that an application uses to manipulate topics, and to send - messages to a topic. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateTopic = channel.unary_unary( - "/google.pubsub.v1.Publisher/CreateTopic", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.FromString, - ) - self.UpdateTopic = channel.unary_unary( - "/google.pubsub.v1.Publisher/UpdateTopic", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateTopicRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.FromString, - ) - self.Publish = channel.unary_unary( - "/google.pubsub.v1.Publisher/Publish", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PublishRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PublishResponse.FromString, - ) - self.GetTopic = channel.unary_unary( - "/google.pubsub.v1.Publisher/GetTopic", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetTopicRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.FromString, - ) - self.ListTopics = channel.unary_unary( - "/google.pubsub.v1.Publisher/ListTopics", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicsResponse.FromString, - ) - self.ListTopicSubscriptions = channel.unary_unary( - "/google.pubsub.v1.Publisher/ListTopicSubscriptions", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSubscriptionsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSubscriptionsResponse.FromString, - ) - self.ListTopicSnapshots = channel.unary_unary( - "/google.pubsub.v1.Publisher/ListTopicSnapshots", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSnapshotsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSnapshotsResponse.FromString, - ) - self.DeleteTopic = channel.unary_unary( - "/google.pubsub.v1.Publisher/DeleteTopic", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteTopicRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - - -class PublisherServicer(object): - """The service that an application uses to manipulate topics, and to send - messages to a topic. - """ - - def CreateTopic(self, request, context): - """Creates the given topic with the given name. See the - - resource name rules. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTopic(self, request, context): - """Updates an existing topic. Note that certain properties of a - topic are not modifiable. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def Publish(self, request, context): - """Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic - does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetTopic(self, request, context): - """Gets the configuration of a topic. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTopics(self, request, context): - """Lists matching topics. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTopicSubscriptions(self, request, context): - """Lists the names of the subscriptions on this topic. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTopicSnapshots(self, request, context): - """Lists the names of the snapshots on this topic. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteTopic(self, request, context): - """Deletes the topic with the given name. Returns `NOT_FOUND` if the topic - does not exist. After a topic is deleted, a new topic may be created with - the same name; this is an entirely new topic with none of the old - configuration or subscriptions. Existing subscriptions to this topic are - not deleted, but their `topic` field is set to `_deleted-topic_`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_PublisherServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateTopic": grpc.unary_unary_rpc_method_handler( - servicer.CreateTopic, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.SerializeToString, - ), - "UpdateTopic": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTopic, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateTopicRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.SerializeToString, - ), - "Publish": grpc.unary_unary_rpc_method_handler( - servicer.Publish, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PublishRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PublishResponse.SerializeToString, - ), - "GetTopic": grpc.unary_unary_rpc_method_handler( - servicer.GetTopic, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetTopicRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Topic.SerializeToString, - ), - "ListTopics": grpc.unary_unary_rpc_method_handler( - servicer.ListTopics, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicsRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicsResponse.SerializeToString, - ), - "ListTopicSubscriptions": grpc.unary_unary_rpc_method_handler( - servicer.ListTopicSubscriptions, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSubscriptionsRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSubscriptionsResponse.SerializeToString, - ), - "ListTopicSnapshots": grpc.unary_unary_rpc_method_handler( - servicer.ListTopicSnapshots, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSnapshotsRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListTopicSnapshotsResponse.SerializeToString, - ), - "DeleteTopic": grpc.unary_unary_rpc_method_handler( - servicer.DeleteTopic, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteTopicRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.pubsub.v1.Publisher", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -class SubscriberStub(object): - """The service that an application uses to manipulate subscriptions and to - consume messages from a subscription via the `Pull` method or by - establishing a bi-directional stream using the `StreamingPull` method. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateSubscription = channel.unary_unary( - "/google.pubsub.v1.Subscriber/CreateSubscription", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.FromString, - ) - self.GetSubscription = channel.unary_unary( - "/google.pubsub.v1.Subscriber/GetSubscription", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetSubscriptionRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.FromString, - ) - self.UpdateSubscription = channel.unary_unary( - "/google.pubsub.v1.Subscriber/UpdateSubscription", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateSubscriptionRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.FromString, - ) - self.ListSubscriptions = channel.unary_unary( - "/google.pubsub.v1.Subscriber/ListSubscriptions", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSubscriptionsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSubscriptionsResponse.FromString, - ) - self.DeleteSubscription = channel.unary_unary( - "/google.pubsub.v1.Subscriber/DeleteSubscription", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteSubscriptionRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ModifyAckDeadline = channel.unary_unary( - "/google.pubsub.v1.Subscriber/ModifyAckDeadline", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ModifyAckDeadlineRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.Acknowledge = channel.unary_unary( - "/google.pubsub.v1.Subscriber/Acknowledge", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.AcknowledgeRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.Pull = channel.unary_unary( - "/google.pubsub.v1.Subscriber/Pull", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PullRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PullResponse.FromString, - ) - self.StreamingPull = channel.stream_stream( - "/google.pubsub.v1.Subscriber/StreamingPull", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.StreamingPullRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.StreamingPullResponse.FromString, - ) - self.ModifyPushConfig = channel.unary_unary( - "/google.pubsub.v1.Subscriber/ModifyPushConfig", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ModifyPushConfigRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.GetSnapshot = channel.unary_unary( - "/google.pubsub.v1.Subscriber/GetSnapshot", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetSnapshotRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.FromString, - ) - self.ListSnapshots = channel.unary_unary( - "/google.pubsub.v1.Subscriber/ListSnapshots", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSnapshotsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSnapshotsResponse.FromString, - ) - self.CreateSnapshot = channel.unary_unary( - "/google.pubsub.v1.Subscriber/CreateSnapshot", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.CreateSnapshotRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.FromString, - ) - self.UpdateSnapshot = channel.unary_unary( - "/google.pubsub.v1.Subscriber/UpdateSnapshot", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateSnapshotRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.FromString, - ) - self.DeleteSnapshot = channel.unary_unary( - "/google.pubsub.v1.Subscriber/DeleteSnapshot", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteSnapshotRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.Seek = channel.unary_unary( - "/google.pubsub.v1.Subscriber/Seek", - request_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.SeekRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.SeekResponse.FromString, - ) - - -class SubscriberServicer(object): - """The service that an application uses to manipulate subscriptions and to - consume messages from a subscription via the `Pull` method or by - establishing a bi-directional stream using the `StreamingPull` method. - """ - - def CreateSubscription(self, request, context): - """Creates a subscription to a given topic. See the - - resource name rules. - If the subscription already exists, returns `ALREADY_EXISTS`. - If the corresponding topic doesn't exist, returns `NOT_FOUND`. - - If the name is not provided in the request, the server will assign a random - name for this subscription on the same project as the topic, conforming - to the - [resource name - format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - generated name is populated in the returned Subscription object. Note that - for REST API requests, you must specify a name in the request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetSubscription(self, request, context): - """Gets the configuration details of a subscription. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateSubscription(self, request, context): - """Updates an existing subscription. Note that certain properties of a - subscription, such as its topic, are not modifiable. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListSubscriptions(self, request, context): - """Lists matching subscriptions. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteSubscription(self, request, context): - """Deletes an existing subscription. All messages retained in the subscription - are immediately dropped. Calls to `Pull` after deletion will return - `NOT_FOUND`. After a subscription is deleted, a new one may be created with - the same name, but the new one has no association with the old - subscription or its topic unless the same topic is specified. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ModifyAckDeadline(self, request, context): - """Modifies the ack deadline for a specific message. This method is useful - to indicate that more time is needed to process a message by the - subscriber, or to make the message available for redelivery if the - processing was interrupted. Note that this does not modify the - subscription-level `ackDeadlineSeconds` used for subsequent messages. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def Acknowledge(self, request, context): - """Acknowledges the messages associated with the `ack_ids` in the - `AcknowledgeRequest`. The Pub/Sub system can remove the relevant messages - from the subscription. - - Acknowledging a message whose ack deadline has expired may succeed, - but such a message may be redelivered later. Acknowledging a message more - than once will not result in an error. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def Pull(self, request, context): - """Pulls messages from the server. The server may return `UNAVAILABLE` if - there are too many concurrent pull requests pending for the given - subscription. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StreamingPull(self, request_iterator, context): - """Establishes a stream with the server, which sends messages down to the - client. The client streams acknowledgements and ack deadline modifications - back to the server. The server will close the stream and return the status - on any error. The server may close the stream with status `UNAVAILABLE` to - reassign server-side resources, in which case, the client should - re-establish the stream. Flow control can be achieved by configuring the - underlying RPC channel. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ModifyPushConfig(self, request, context): - """Modifies the `PushConfig` for a specified subscription. - - This may be used to change a push subscription to a pull one (signified by - an empty `PushConfig`) or vice versa, or change the endpoint URL and other - attributes of a push subscription. Messages will accumulate for delivery - continuously through the call regardless of changes to the `PushConfig`. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetSnapshot(self, request, context): - """Gets the configuration details of a snapshot. Snapshots are used in - Seek - operations, which allow you to manage message acknowledgments in bulk. That - is, you can set the acknowledgment state of messages in an existing - subscription to the state captured by a snapshot. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListSnapshots(self, request, context): - """Lists the existing snapshots. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateSnapshot(self, request, context): - """Creates a snapshot from the requested subscription. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. -

If the snapshot already exists, returns `ALREADY_EXISTS`. - If the requested subscription doesn't exist, returns `NOT_FOUND`. - If the backlog in the subscription is too old -- and the resulting snapshot - would expire in less than 1 hour -- then `FAILED_PRECONDITION` is returned. - See also the `Snapshot.expire_time` field. If the name is not provided in - the request, the server will assign a random - name for this snapshot on the same project as the subscription, conforming - to the - [resource name - format](https://cloud.google.com/pubsub/docs/admin#resource_names). The - generated name is populated in the returned Snapshot object. Note that for - REST API requests, you must specify a name in the request. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateSnapshot(self, request, context): - """Updates an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteSnapshot(self, request, context): - """Removes an existing snapshot. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot.

- When the snapshot is deleted, all messages retained in the snapshot - are immediately dropped. After a snapshot is deleted, a new one may be - created with the same name, but the new one has no association with the old - snapshot or its subscription, unless the same subscription is specified. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def Seek(self, request, context): - """Seeks an existing subscription to a point in time or to a given snapshot, - whichever is provided in the request. Snapshots are used in - Seek - operations, which allow - you to manage message acknowledgments in bulk. That is, you can set the - acknowledgment state of messages in an existing subscription to the state - captured by a snapshot. Note that both the subscription and the snapshot - must be on the same topic. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_SubscriberServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateSubscription": grpc.unary_unary_rpc_method_handler( - servicer.CreateSubscription, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.SerializeToString, - ), - "GetSubscription": grpc.unary_unary_rpc_method_handler( - servicer.GetSubscription, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetSubscriptionRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.SerializeToString, - ), - "UpdateSubscription": grpc.unary_unary_rpc_method_handler( - servicer.UpdateSubscription, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateSubscriptionRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Subscription.SerializeToString, - ), - "ListSubscriptions": grpc.unary_unary_rpc_method_handler( - servicer.ListSubscriptions, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSubscriptionsRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSubscriptionsResponse.SerializeToString, - ), - "DeleteSubscription": grpc.unary_unary_rpc_method_handler( - servicer.DeleteSubscription, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteSubscriptionRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ModifyAckDeadline": grpc.unary_unary_rpc_method_handler( - servicer.ModifyAckDeadline, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ModifyAckDeadlineRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "Acknowledge": grpc.unary_unary_rpc_method_handler( - servicer.Acknowledge, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.AcknowledgeRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "Pull": grpc.unary_unary_rpc_method_handler( - servicer.Pull, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PullRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.PullResponse.SerializeToString, - ), - "StreamingPull": grpc.stream_stream_rpc_method_handler( - servicer.StreamingPull, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.StreamingPullRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.StreamingPullResponse.SerializeToString, - ), - "ModifyPushConfig": grpc.unary_unary_rpc_method_handler( - servicer.ModifyPushConfig, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ModifyPushConfigRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "GetSnapshot": grpc.unary_unary_rpc_method_handler( - servicer.GetSnapshot, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.GetSnapshotRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.SerializeToString, - ), - "ListSnapshots": grpc.unary_unary_rpc_method_handler( - servicer.ListSnapshots, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSnapshotsRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.ListSnapshotsResponse.SerializeToString, - ), - "CreateSnapshot": grpc.unary_unary_rpc_method_handler( - servicer.CreateSnapshot, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.CreateSnapshotRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.SerializeToString, - ), - "UpdateSnapshot": grpc.unary_unary_rpc_method_handler( - servicer.UpdateSnapshot, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.UpdateSnapshotRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.Snapshot.SerializeToString, - ), - "DeleteSnapshot": grpc.unary_unary_rpc_method_handler( - servicer.DeleteSnapshot, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.DeleteSnapshotRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "Seek": grpc.unary_unary_rpc_method_handler( - servicer.Seek, - request_deserializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.SeekRequest.FromString, - response_serializer=google_dot_cloud_dot_pubsub__v1_dot_proto_dot_pubsub__pb2.SeekResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.pubsub.v1.Subscriber", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/pubsub/google/cloud/pubsub_v1/publisher/__init__.py b/pubsub/google/cloud/pubsub_v1/publisher/__init__.py deleted file mode 100644 index 688ee744b7b4..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.pubsub_v1.publisher.client import Client - - -__all__ = ("Client",) diff --git a/pubsub/google/cloud/pubsub_v1/publisher/_batch/__init__.py b/pubsub/google/cloud/pubsub_v1/publisher/_batch/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/google/cloud/pubsub_v1/publisher/_batch/base.py b/pubsub/google/cloud/pubsub_v1/publisher/_batch/base.py deleted file mode 100644 index 75f430b09421..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/_batch/base.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import abc - -import six - - -@six.add_metaclass(abc.ABCMeta) -class Batch(object): - """The base batching class for Pub/Sub publishing. - - Although the :class:`~.pubsub_v1.publisher.batch.thread.Batch` class, based - on :class:`threading.Thread`, is fine for most cases, advanced - users may need to implement something based on a different concurrency - model. - - This class defines the interface for the Batch implementation; - subclasses may be passed as the ``batch_class`` argument to - :class:`~.pubsub_v1.client.PublisherClient`. - - The batching behavior works like this: When the - :class:`~.pubsub_v1.publisher.client.Client` is asked to publish a new - message, it requires a batch. The client will see if there is an - already-opened batch for the given topic; if there is, then the message - is sent to that batch. If there is not, then a new batch is created - and the message put there. - - When a new batch is created, it automatically starts a timer counting - down to the maximum latency before the batch should commit. - Essentially, if enough time passes, the batch automatically commits - regardless of how much is in it. However, if either the message count or - size thresholds are encountered first, then the batch will commit early. - """ - - def __len__(self): - """Return the number of messages currently in the batch.""" - return len(self.messages) - - @staticmethod - @abc.abstractmethod - def make_lock(): - """Return a lock in the chosen concurrency model. - - Returns: - ContextManager: A newly created lock. - """ - raise NotImplementedError - - @property - @abc.abstractmethod - def messages(self): - """Return the messages currently in the batch. - - Returns: - Sequence: The messages currently in the batch. - """ - raise NotImplementedError - - @property - @abc.abstractmethod - def size(self): - """Return the total size of all of the messages currently in the batch. - - The size includes any overhead of the actual ``PublishRequest`` that is - sent to the backend. - - Returns: - int: The total size of all of the messages currently - in the batch (including the request overhead), in bytes. - """ - raise NotImplementedError - - @property - @abc.abstractmethod - def settings(self): - """Return the batch settings. - - Returns: - ~.pubsub_v1.types.BatchSettings: The batch settings. These are - considered immutable once the batch has been opened. - """ - raise NotImplementedError - - @property - @abc.abstractmethod - def status(self): - """Return the status of this batch. - - Returns: - str: The status of this batch. All statuses are human-readable, - all-lowercase strings. The ones represented in the - :class:`BaseBatch.Status` enum are special, but other statuses - are permitted. - """ - raise NotImplementedError - - def will_accept(self, message): - """Return True if the batch is able to accept the message. - - In concurrent implementations, the attributes on the current batch - may be modified by other workers. With this in mind, the caller will - likely want to hold a lock that will make sure the state remains - the same after the "will accept?" question is answered. - - Args: - message (~.pubsub_v1.types.PubsubMessage): The Pub/Sub message. - - Returns: - bool: Whether this batch can accept the message. - """ - # If this batch is not accepting messages generally, return False. - if self.status != BatchStatus.ACCEPTING_MESSAGES: - return False - - # If this message will make the batch exceed the ``max_messages`` - # setting, return False. - if len(self.messages) >= self.settings.max_messages: - return False - - # Okay, everything is good. - return True - - @abc.abstractmethod - def publish(self, message): - """Publish a single message. - - Add the given message to this object; this will cause it to be - published once the batch either has enough messages or a sufficient - period of time has elapsed. - - This method is called by :meth:`~.PublisherClient.publish`. - - Args: - message (~.pubsub_v1.types.PubsubMessage): The Pub/Sub message. - - Returns: - ~google.api_core.future.Future: An object conforming to the - :class:`concurrent.futures.Future` interface. - """ - raise NotImplementedError - - -class BatchStatus(object): - """An enum-like class representing valid statuses for a batch. - - It is acceptable for a class to use a status that is not on this - class; this represents the list of statuses where the existing - library hooks in functionality. - """ - - ACCEPTING_MESSAGES = "accepting messages" - STARTING = "starting" - IN_PROGRESS = "in progress" - ERROR = "error" - SUCCESS = "success" diff --git a/pubsub/google/cloud/pubsub_v1/publisher/_batch/thread.py b/pubsub/google/cloud/pubsub_v1/publisher/_batch/thread.py deleted file mode 100644 index 4101bc518b0a..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/_batch/thread.py +++ /dev/null @@ -1,339 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import logging -import threading -import time - -import six - -import google.api_core.exceptions -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.publisher import exceptions -from google.cloud.pubsub_v1.publisher import futures -from google.cloud.pubsub_v1.publisher._batch import base - - -_LOGGER = logging.getLogger(__name__) -_CAN_COMMIT = (base.BatchStatus.ACCEPTING_MESSAGES, base.BatchStatus.STARTING) -_SERVER_PUBLISH_MAX_BYTES = 10 * 1000 * 1000 # max accepted size of PublishRequest - - -class Batch(base.Batch): - """A batch of messages. - - The batch is the internal group of messages which are either awaiting - publication or currently in progress. - - A batch is automatically created by the PublisherClient when the first - message to be published is received; subsequent messages are added to - that batch until the process of actual publishing _starts_. - - Once this occurs, any new messages sent to :meth:`publish` open a new - batch. - - If you are using this library, you most likely do not need to instantiate - batch objects directly; they will be created for you. If you want to - change the actual batching settings, see the ``batching`` argument on - :class:`~.pubsub_v1.PublisherClient`. - - Any properties or methods on this class which are not defined in - :class:`~.pubsub_v1.publisher.batch.BaseBatch` should be considered - implementation details. - - Args: - client (~.pubsub_v1.PublisherClient): The publisher client used to - create this batch. - topic (str): The topic. The format for this is - ``projects/{project}/topics/{topic}``. - settings (~.pubsub_v1.types.BatchSettings): The settings for batch - publishing. These should be considered immutable once the batch - has been opened. - autocommit (bool): Whether to autocommit the batch when the time - has elapsed. Defaults to True unless ``settings.max_latency`` is - inf. - """ - - def __init__(self, client, topic, settings, autocommit=True): - self._client = client - self._topic = topic - self._settings = settings - - self._state_lock = threading.Lock() - # These members are all communicated between threads; ensure that - # any writes to them use the "state lock" to remain atomic. - # _futures list should remain unchanged after batch - # status changed from ACCEPTING_MESSAGES to any other - # in order to avoid race conditions - self._futures = [] - self._messages = [] - self._status = base.BatchStatus.ACCEPTING_MESSAGES - - # The initial size is not zero, we need to account for the size overhead - # of the PublishRequest message itself. - self._base_request_size = types.PublishRequest(topic=topic).ByteSize() - self._size = self._base_request_size - - # If max latency is specified, start a thread to monitor the batch and - # commit when the max latency is reached. - self._thread = None - if autocommit and self.settings.max_latency < float("inf"): - self._thread = threading.Thread( - name="Thread-MonitorBatchPublisher", target=self.monitor - ) - self._thread.start() - - @staticmethod - def make_lock(): - """Return a threading lock. - - Returns: - _thread.Lock: A newly created lock. - """ - return threading.Lock() - - @property - def client(self): - """~.pubsub_v1.client.PublisherClient: A publisher client.""" - return self._client - - @property - def messages(self): - """Sequence: The messages currently in the batch.""" - return self._messages - - @property - def settings(self): - """Return the batch settings. - - Returns: - ~.pubsub_v1.types.BatchSettings: The batch settings. These are - considered immutable once the batch has been opened. - """ - return self._settings - - @property - def size(self): - """Return the total size of all of the messages currently in the batch. - - The size includes any overhead of the actual ``PublishRequest`` that is - sent to the backend. - - Returns: - int: The total size of all of the messages currently - in the batch (including the request overhead), in bytes. - """ - return self._size - - @property - def status(self): - """Return the status of this batch. - - Returns: - str: The status of this batch. All statuses are human-readable, - all-lowercase strings. - """ - return self._status - - def commit(self): - """Actually publish all of the messages on the active batch. - - .. note:: - - This method is non-blocking. It opens a new thread, which calls - :meth:`_commit`, which does block. - - This synchronously sets the batch status to "starting", and then opens - a new thread, which handles actually sending the messages to Pub/Sub. - - If the current batch is **not** accepting messages, this method - does nothing. - """ - # Set the status to "starting" synchronously, to ensure that - # this batch will necessarily not accept new messages. - with self._state_lock: - if self._status == base.BatchStatus.ACCEPTING_MESSAGES: - self._status = base.BatchStatus.STARTING - else: - return - - # Start a new thread to actually handle the commit. - commit_thread = threading.Thread( - name="Thread-CommitBatchPublisher", target=self._commit - ) - commit_thread.start() - - def _commit(self): - """Actually publish all of the messages on the active batch. - - This moves the batch out from being the active batch to an in progress - batch on the publisher, and then the batch is discarded upon - completion. - - .. note:: - - This method blocks. The :meth:`commit` method is the non-blocking - version, which calls this one. - """ - with self._state_lock: - if self._status in _CAN_COMMIT: - self._status = base.BatchStatus.IN_PROGRESS - else: - # If, in the intervening period between when this method was - # called and now, the batch started to be committed, or - # completed a commit, then no-op at this point. - _LOGGER.debug("Batch is already in progress, exiting commit") - return - - # Once in the IN_PROGRESS state, no other thread can publish additional - # messages or initiate a commit (those operations become a no-op), thus - # it is safe to release the state lock here. Releasing the lock avoids - # blocking other threads in case api.publish() below takes a long time - # to complete. - # https://github.com/googleapis/google-cloud-python/issues/8036 - - # Sanity check: If there are no messages, no-op. - if not self._messages: - _LOGGER.debug("No messages to publish, exiting commit") - self._status = base.BatchStatus.SUCCESS - return - - # Begin the request to publish these messages. - # Log how long the underlying request takes. - start = time.time() - - try: - response = self._client.api.publish(self._topic, self._messages) - except google.api_core.exceptions.GoogleAPIError as exc: - # We failed to publish, set the exception on all futures and - # exit. - self._status = base.BatchStatus.ERROR - - for future in self._futures: - future.set_exception(exc) - - _LOGGER.exception("Failed to publish %s messages.", len(self._futures)) - return - - end = time.time() - _LOGGER.debug("gRPC Publish took %s seconds.", end - start) - - if len(response.message_ids) == len(self._futures): - # Iterate over the futures on the queue and return the response - # IDs. We are trusting that there is a 1:1 mapping, and raise - # an exception if not. - self._status = base.BatchStatus.SUCCESS - zip_iter = six.moves.zip(response.message_ids, self._futures) - for message_id, future in zip_iter: - future.set_result(message_id) - else: - # Sanity check: If the number of message IDs is not equal to - # the number of futures I have, then something went wrong. - self._status = base.BatchStatus.ERROR - exception = exceptions.PublishError( - "Some messages were not successfully published." - ) - - for future in self._futures: - future.set_exception(exception) - - _LOGGER.error( - "Only %s of %s messages were published.", - len(response.message_ids), - len(self._futures), - ) - - def monitor(self): - """Commit this batch after sufficient time has elapsed. - - This simply sleeps for ``self.settings.max_latency`` seconds, - and then calls commit unless the batch has already been committed. - """ - # NOTE: This blocks; it is up to the calling code to call it - # in a separate thread. - - # Sleep for however long we should be waiting. - time.sleep(self.settings.max_latency) - - _LOGGER.debug("Monitor is waking up") - return self._commit() - - def publish(self, message): - """Publish a single message. - - Add the given message to this object; this will cause it to be - published once the batch either has enough messages or a sufficient - period of time has elapsed. If the batch is full or the commit is - already in progress, the method does not do anything. - - This method is called by :meth:`~.PublisherClient.publish`. - - Args: - message (~.pubsub_v1.types.PubsubMessage): The Pub/Sub message. - - Returns: - Optional[~google.api_core.future.Future]: An object conforming to - the :class:`~concurrent.futures.Future` interface or :data:`None`. - If :data:`None` is returned, that signals that the batch cannot - accept a message. - - Raises: - pubsub_v1.publisher.exceptions.MessageTooLargeError: If publishing - the ``message`` would exceed the max size limit on the backend. - """ - # Coerce the type, just in case. - if not isinstance(message, types.PubsubMessage): - message = types.PubsubMessage(**message) - - future = None - - with self._state_lock: - if not self.will_accept(message): - return future - - size_increase = types.PublishRequest(messages=[message]).ByteSize() - - if (self._base_request_size + size_increase) > _SERVER_PUBLISH_MAX_BYTES: - err_msg = ( - "The message being published would produce too large a publish " - "request that would exceed the maximum allowed size on the " - "backend ({} bytes).".format(_SERVER_PUBLISH_MAX_BYTES) - ) - raise exceptions.MessageTooLargeError(err_msg) - - new_size = self._size + size_increase - new_count = len(self._messages) + 1 - - size_limit = min(self.settings.max_bytes, _SERVER_PUBLISH_MAX_BYTES) - overflow = new_size > size_limit or new_count >= self.settings.max_messages - - if not self._messages or not overflow: - - # Store the actual message in the batch's message queue. - self._messages.append(message) - self._size = new_size - - # Track the future on this batch (so that the result of the - # future can be set). - future = futures.Future(completed=threading.Event()) - self._futures.append(future) - - # Try to commit, but it must be **without** the lock held, since - # ``commit()`` will try to obtain the lock. - if overflow: - self.commit() - - return future diff --git a/pubsub/google/cloud/pubsub_v1/publisher/client.py b/pubsub/google/cloud/pubsub_v1/publisher/client.py deleted file mode 100644 index 60a03bb652ab..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/client.py +++ /dev/null @@ -1,308 +0,0 @@ -# Copyright 2019, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import copy -import os -import pkg_resources - -import grpc -import six - -from google.api_core import grpc_helpers -from google.oauth2 import service_account - -from google.cloud.pubsub_v1 import _gapic -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.gapic import publisher_client -from google.cloud.pubsub_v1.gapic.transports import publisher_grpc_transport -from google.cloud.pubsub_v1.publisher._batch import thread - - -__version__ = pkg_resources.get_distribution("google-cloud-pubsub").version - -_BLACKLISTED_METHODS = ( - "publish", - "from_service_account_file", - "from_service_account_json", -) - - -@_gapic.add_methods(publisher_client.PublisherClient, blacklist=_BLACKLISTED_METHODS) -class Client(object): - """A publisher client for Google Cloud Pub/Sub. - - This creates an object that is capable of publishing messages. - Generally, you can instantiate this client with no arguments, and you - get sensible defaults. - - Args: - batch_settings (~google.cloud.pubsub_v1.types.BatchSettings): The - settings for batch publishing. - kwargs (dict): Any additional arguments provided are sent as keyword - arguments to the underlying - :class:`~google.cloud.pubsub_v1.gapic.publisher_client.PublisherClient`. - Generally you should not need to set additional keyword - arguments. Optionally, publish retry settings can be set via - ``client_config`` where user-provided retry configurations are - applied to default retry settings. And regional endpoints can be - set via ``client_options`` that takes a single key-value pair that - defines the endpoint. - - Example: - - .. code-block:: python - - from google.cloud import pubsub_v1 - - publisher_client = pubsub_v1.PublisherClient( - # Optional - batch_settings = pubsub_v1.types.BatchSettings( - max_bytes=1024, # One kilobyte - max_latency=1, # One second - ), - - # Optional - client_config = { - "interfaces": { - "google.pubsub.v1.Publisher": { - "retry_params": { - "messaging": { - 'total_timeout_millis': 650000, # default: 600000 - } - } - } - } - }, - - # Optional - client_options = { - "api_endpoint": REGIONAL_ENDPOINT - } - ) - """ - - _batch_class = thread.Batch - - def __init__(self, batch_settings=(), **kwargs): - # Sanity check: Is our goal to use the emulator? - # If so, create a grpc insecure channel with the emulator host - # as the target. - if os.environ.get("PUBSUB_EMULATOR_HOST"): - kwargs["channel"] = grpc.insecure_channel( - target=os.environ.get("PUBSUB_EMULATOR_HOST") - ) - - # Use a custom channel. - # We need this in order to set appropriate default message size and - # keepalive options. - if "transport" not in kwargs: - channel = kwargs.pop("channel", None) - if channel is None: - channel = grpc_helpers.create_channel( - credentials=kwargs.pop("credentials", None), - target=self.target, - scopes=publisher_client.PublisherClient._DEFAULT_SCOPES, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - # cannot pass both 'channel' and 'credentials' - kwargs.pop("credentials", None) - transport = publisher_grpc_transport.PublisherGrpcTransport(channel=channel) - kwargs["transport"] = transport - - # Add the metrics headers, and instantiate the underlying GAPIC - # client. - self.api = publisher_client.PublisherClient(**kwargs) - self.batch_settings = types.BatchSettings(*batch_settings) - - # The batches on the publisher client are responsible for holding - # messages. One batch exists for each topic. - self._batch_lock = self._batch_class.make_lock() - self._batches = {} - self._is_stopped = False - - @classmethod - def from_service_account_file(cls, filename, batch_settings=(), **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - batch_settings (~google.cloud.pubsub_v1.types.BatchSettings): The - settings for batch publishing. - kwargs: Additional arguments to pass to the constructor. - - Returns: - A Publisher :class:`~google.cloud.pubsub_v1.publisher.client.Client` - instance that is the constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(batch_settings, **kwargs) - - from_service_account_json = from_service_account_file - - @property - def target(self): - """Return the target (where the API is). - - Returns: - str: The location of the API. - """ - return publisher_client.PublisherClient.SERVICE_ADDRESS - - def _batch(self, topic, create=False, autocommit=True): - """Return the current batch for the provided topic. - - This will create a new batch if ``create=True`` or if no batch - currently exists. - - Args: - topic (str): A string representing the topic. - create (bool): Whether to create a new batch. Defaults to - :data:`False`. If :data:`True`, this will create a new batch - even if one already exists. - autocommit (bool): Whether to autocommit this batch. This is - primarily useful for debugging and testing, since it allows - the caller to avoid some side effects that batch creation - might have (e.g. spawning a worker to publish a batch). - - Returns: - ~.pubsub_v1._batch.Batch: The batch object. - """ - # If there is no matching batch yet, then potentially create one - # and place it on the batches dictionary. - if not create: - batch = self._batches.get(topic) - if batch is None: - create = True - - if create: - batch = self._batch_class( - autocommit=autocommit, - client=self, - settings=self.batch_settings, - topic=topic, - ) - self._batches[topic] = batch - - return batch - - def publish(self, topic, data, **attrs): - """Publish a single message. - - .. note:: - Messages in Pub/Sub are blobs of bytes. They are *binary* data, - not text. You must send data as a bytestring - (``bytes`` in Python 3; ``str`` in Python 2), and this library - will raise an exception if you send a text string. - - The reason that this is so important (and why we do not try to - coerce for you) is because Pub/Sub is also platform independent - and there is no way to know how to decode messages properly on - the other side; therefore, encoding and decoding is a required - exercise for the developer. - - Add the given message to this object; this will cause it to be - published once the batch either has enough messages or a sufficient - period of time has elapsed. - - Example: - >>> from google.cloud import pubsub_v1 - >>> client = pubsub_v1.PublisherClient() - >>> topic = client.topic_path('[PROJECT]', '[TOPIC]') - >>> data = b'The rain in Wales falls mainly on the snails.' - >>> response = client.publish(topic, data, username='guido') - - Args: - topic (str): The topic to publish messages to. - data (bytes): A bytestring representing the message body. This - must be a bytestring. - attrs (Mapping[str, str]): A dictionary of attributes to be - sent as metadata. (These may be text strings or byte strings.) - - Returns: - A :class:`~google.cloud.pubsub_v1.publisher.futures.Future` - instance that conforms to Python Standard library's - :class:`~concurrent.futures.Future` interface (but not an - instance of that class). - - Raises: - RuntimeError: - If called after publisher has been stopped - by a `stop()` method call. - """ - # Sanity check: Is the data being sent as a bytestring? - # If it is literally anything else, complain loudly about it. - if not isinstance(data, six.binary_type): - raise TypeError( - "Data being published to Pub/Sub must be sent as a bytestring." - ) - - # Coerce all attributes to text strings. - for k, v in copy.copy(attrs).items(): - if isinstance(v, six.text_type): - continue - if isinstance(v, six.binary_type): - attrs[k] = v.decode("utf-8") - continue - raise TypeError( - "All attributes being published to Pub/Sub must " - "be sent as text strings." - ) - - # Create the Pub/Sub message object. - message = types.PubsubMessage(data=data, attributes=attrs) - - # Delegate the publishing to the batch. - with self._batch_lock: - if self._is_stopped: - raise RuntimeError("Cannot publish on a stopped publisher.") - - batch = self._batch(topic) - future = None - while future is None: - future = batch.publish(message) - if future is None: - batch = self._batch(topic, create=True) - - return future - - def stop(self): - """Immediately publish all outstanding messages. - - Asynchronously sends all outstanding messages and - prevents future calls to `publish()`. Method should - be invoked prior to deleting this `Client()` object - in order to ensure that no pending messages are lost. - - .. note:: - - This method is non-blocking. Use `Future()` objects - returned by `publish()` to make sure all publish - requests completed, either in success or error. - """ - with self._batch_lock: - if self._is_stopped: - raise RuntimeError("Cannot stop a publisher already stopped.") - - self._is_stopped = True - - for batch in self._batches.values(): - batch.commit() diff --git a/pubsub/google/cloud/pubsub_v1/publisher/exceptions.py b/pubsub/google/cloud/pubsub_v1/publisher/exceptions.py deleted file mode 100644 index be176bac2dba..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/exceptions.py +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.api_core.exceptions import GoogleAPICallError -from google.cloud.pubsub_v1.exceptions import TimeoutError - - -class PublishError(GoogleAPICallError): - pass - - -class MessageTooLargeError(ValueError): - """Attempt to publish a message that would exceed the server max size limit.""" - - -__all__ = ("MessageTooLargeError", "PublishError", "TimeoutError") diff --git a/pubsub/google/cloud/pubsub_v1/publisher/futures.py b/pubsub/google/cloud/pubsub_v1/publisher/futures.py deleted file mode 100644 index fa8a79998617..000000000000 --- a/pubsub/google/cloud/pubsub_v1/publisher/futures.py +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright 2019, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.pubsub_v1 import futures - - -class Future(futures.Future): - """This future object is returned from asychronous Pub/Sub publishing - calls. - - Calling :meth:`result` will resolve the future by returning the message - ID, unless an error occurs. - """ - - def result(self, timeout=None): - """Return the message ID or raise an exception. - - This blocks until the message has been published successfully and - returns the message ID unless an exception is raised. - - Args: - timeout (Union[int, float]): The number of seconds before this call - times out and raises TimeoutError. - - Returns: - str: The message ID. - - Raises: - concurrent.futures.TimeoutError: If the request times out. - Exception: For undefined exceptions in the underlying - call execution. - """ - # Attempt to get the exception if there is one. - # If there is not one, then we know everything worked, and we can - # return an appropriate value. - err = self.exception(timeout=timeout) - if err is None: - return self._result - raise err diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/__init__.py b/pubsub/google/cloud/pubsub_v1/subscriber/__init__.py deleted file mode 100644 index a444c3ea7571..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/__init__.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.pubsub_v1.subscriber.client import Client - - -__all__ = ("Client",) diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/__init__.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py deleted file mode 100644 index b1d8429cba58..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/dispatcher.py +++ /dev/null @@ -1,197 +0,0 @@ -# Copyright 2017, 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. - -from __future__ import absolute_import -from __future__ import division - -import collections -import itertools -import logging -import math -import threading - -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber._protocol import helper_threads -from google.cloud.pubsub_v1.subscriber._protocol import requests - - -_LOGGER = logging.getLogger(__name__) -_CALLBACK_WORKER_NAME = "Thread-CallbackRequestDispatcher" - - -_MAX_BATCH_SIZE = 100 -"""The maximum number of requests to process and dispatch at a time.""" - -_MAX_BATCH_LATENCY = 0.01 -"""The maximum amount of time in seconds to wait for additional request items -before processing the next batch of requests.""" - -_ACK_IDS_BATCH_SIZE = 2500 -"""The maximum number of ACK IDs to send in a single StreamingPullRequest. - -The backend imposes a maximum request size limit of 524288 bytes (512 KiB) per -acknowledge / modifyAckDeadline request. ACK IDs have a maximum size of 164 -bytes, thus we cannot send more than o 524288/176 ~= 2979 ACK IDs in a single -StreamingPullRequest message. - -Accounting for some overhead, we should thus only send a maximum of 2500 ACK -IDs at a time. -""" - - -class Dispatcher(object): - def __init__(self, manager, queue): - self._manager = manager - self._queue = queue - self._thread = None - self._operational_lock = threading.Lock() - - def start(self): - """Start a thread to dispatch requests queued up by callbacks. - Spawns a thread to run :meth:`dispatch_callback`. - """ - with self._operational_lock: - if self._thread is not None: - raise ValueError("Dispatcher is already running.") - - worker = helper_threads.QueueCallbackWorker( - self._queue, - self.dispatch_callback, - max_items=_MAX_BATCH_SIZE, - max_latency=_MAX_BATCH_LATENCY, - ) - # Create and start the helper thread. - thread = threading.Thread(name=_CALLBACK_WORKER_NAME, target=worker) - thread.daemon = True - thread.start() - _LOGGER.debug("Started helper thread %s", thread.name) - self._thread = thread - - def stop(self): - with self._operational_lock: - if self._thread is not None: - # Signal the worker to stop by queueing a "poison pill" - self._queue.put(helper_threads.STOP) - self._thread.join() - - self._thread = None - - def dispatch_callback(self, items): - """Map the callback request to the appropriate gRPC request. - - Args: - action (str): The method to be invoked. - kwargs (Dict[str, Any]): The keyword arguments for the method - specified by ``action``. - - Raises: - ValueError: If ``action`` isn't one of the expected actions - "ack", "drop", "lease", "modify_ack_deadline" or "nack". - """ - if not self._manager.is_active: - return - - batched_commands = collections.defaultdict(list) - - for item in items: - batched_commands[item.__class__].append(item) - - _LOGGER.debug("Handling %d batched requests", len(items)) - - if batched_commands[requests.LeaseRequest]: - self.lease(batched_commands.pop(requests.LeaseRequest)) - if batched_commands[requests.ModAckRequest]: - self.modify_ack_deadline(batched_commands.pop(requests.ModAckRequest)) - # Note: Drop and ack *must* be after lease. It's possible to get both - # the lease the and ack/drop request in the same batch. - if batched_commands[requests.AckRequest]: - self.ack(batched_commands.pop(requests.AckRequest)) - if batched_commands[requests.NackRequest]: - self.nack(batched_commands.pop(requests.NackRequest)) - if batched_commands[requests.DropRequest]: - self.drop(batched_commands.pop(requests.DropRequest)) - - def ack(self, items): - """Acknowledge the given messages. - - Args: - items(Sequence[AckRequest]): The items to acknowledge. - """ - # If we got timing information, add it to the histogram. - for item in items: - time_to_ack = item.time_to_ack - if time_to_ack is not None: - self._manager.ack_histogram.add(time_to_ack) - - # We must potentially split the request into multiple smaller requests - # to avoid the server-side max request size limit. - ack_ids = (item.ack_id for item in items) - total_chunks = int(math.ceil(len(items) / _ACK_IDS_BATCH_SIZE)) - - for _ in range(total_chunks): - request = types.StreamingPullRequest( - ack_ids=itertools.islice(ack_ids, _ACK_IDS_BATCH_SIZE) - ) - self._manager.send(request) - - # Remove the message from lease management. - self.drop(items) - - def drop(self, items): - """Remove the given messages from lease management. - - Args: - items(Sequence[DropRequest]): The items to drop. - """ - self._manager.leaser.remove(items) - self._manager.maybe_resume_consumer() - - def lease(self, items): - """Add the given messages to lease management. - - Args: - items(Sequence[LeaseRequest]): The items to lease. - """ - self._manager.leaser.add(items) - self._manager.maybe_pause_consumer() - - def modify_ack_deadline(self, items): - """Modify the ack deadline for the given messages. - - Args: - items(Sequence[ModAckRequest]): The items to modify. - """ - # We must potentially split the request into multiple smaller requests - # to avoid the server-side max request size limit. - ack_ids = (item.ack_id for item in items) - seconds = (item.seconds for item in items) - total_chunks = int(math.ceil(len(items) / _ACK_IDS_BATCH_SIZE)) - - for _ in range(total_chunks): - request = types.StreamingPullRequest( - modify_deadline_ack_ids=itertools.islice(ack_ids, _ACK_IDS_BATCH_SIZE), - modify_deadline_seconds=itertools.islice(seconds, _ACK_IDS_BATCH_SIZE), - ) - self._manager.send(request) - - def nack(self, items): - """Explicitly deny receipt of messages. - - Args: - items(Sequence[NackRequest]): The items to deny. - """ - self.modify_ack_deadline( - [requests.ModAckRequest(ack_id=item.ack_id, seconds=0) for item in items] - ) - self.drop([requests.DropRequest(*item) for item in items]) diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py deleted file mode 100644 index 9cd84a1e2397..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/heartbeater.py +++ /dev/null @@ -1,70 +0,0 @@ -# Copyright 2018, 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. - -from __future__ import absolute_import - -import logging -import threading - - -_LOGGER = logging.getLogger(__name__) -_HEARTBEAT_WORKER_NAME = "Thread-Heartbeater" -# How often to send heartbeats in seconds. Determined as half the period of -# time where the Pub/Sub server will close the stream as inactive, which is -# 60 seconds. -_DEFAULT_PERIOD = 30 - - -class Heartbeater(object): - def __init__(self, manager, period=_DEFAULT_PERIOD): - self._thread = None - self._operational_lock = threading.Lock() - self._manager = manager - self._stop_event = threading.Event() - self._period = period - - def heartbeat(self): - """Periodically send heartbeats.""" - while self._manager.is_active and not self._stop_event.is_set(): - self._manager.heartbeat() - _LOGGER.debug("Sent heartbeat.") - self._stop_event.wait(timeout=self._period) - - _LOGGER.info("%s exiting.", _HEARTBEAT_WORKER_NAME) - - def start(self): - with self._operational_lock: - if self._thread is not None: - raise ValueError("Heartbeater is already running.") - - # Create and start the helper thread. - self._stop_event.clear() - thread = threading.Thread( - name=_HEARTBEAT_WORKER_NAME, target=self.heartbeat - ) - thread.daemon = True - thread.start() - _LOGGER.debug("Started helper thread %s", thread.name) - self._thread = thread - - def stop(self): - with self._operational_lock: - self._stop_event.set() - - if self._thread is not None: - # The thread should automatically exit when the consumer is - # inactive. - self._thread.join() - - self._thread = None diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py deleted file mode 100644 index 80ad58738cd1..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/helper_threads.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -import logging -import time -import uuid - -from six.moves import queue - - -__all__ = ("QueueCallbackWorker", "STOP") - -_LOGGER = logging.getLogger(__name__) - - -# Helper thread stop indicator. This could be a sentinel object or None, -# but the sentinel object's ID can change if the process is forked, and -# None has the possibility of a user accidentally killing the helper -# thread. -STOP = uuid.uuid4() - - -def _get_many(queue_, max_items=None, max_latency=0): - """Get multiple items from a Queue. - - Gets at least one (blocking) and at most ``max_items`` items - (non-blocking) from a given Queue. Does not mark the items as done. - - Args: - queue_ (~queue.Queue`): The Queue to get items from. - max_items (int): The maximum number of items to get. If ``None``, then - all available items in the queue are returned. - max_latency (float): The maximum number of seconds to wait for more - than one item from a queue. This number includes the time required - to retrieve the first item. - - Returns: - Sequence[Any]: A sequence of items retrieved from the queue. - """ - start = time.time() - # Always return at least one item. - items = [queue_.get()] - while max_items is None or len(items) < max_items: - try: - elapsed = time.time() - start - timeout = max(0, max_latency - elapsed) - items.append(queue_.get(timeout=timeout)) - except queue.Empty: - break - return items - - -class QueueCallbackWorker(object): - """A helper that executes a callback for items sent in a queue. - - Calls a blocking ``get()`` on the ``queue`` until it encounters - :attr:`STOP`. - - Args: - queue (~queue.Queue): A Queue instance, appropriate for crossing the - concurrency boundary implemented by ``executor``. Items will - be popped off (with a blocking ``get()``) until :attr:`STOP` - is encountered. - callback (Callable[Sequence[Any], Any]): A callback that can process - items pulled off of the queue. Multiple items will be passed to - the callback in batches. - max_items (int): The maximum amount of items that will be passed to the - callback at a time. - max_latency (float): The maximum amount of time in seconds to wait for - additional items before executing the callback. - """ - - def __init__(self, queue, callback, max_items=100, max_latency=0): - self.queue = queue - self._callback = callback - self.max_items = max_items - self.max_latency = max_latency - - def __call__(self): - continue_ = True - while continue_: - items = _get_many( - self.queue, max_items=self.max_items, max_latency=self.max_latency - ) - - # If stop is in the items, process all items up to STOP and then - # exit. - try: - items = items[: items.index(STOP)] - continue_ = False - except ValueError: - pass - - # Run the callback. If any exceptions occur, log them and - # continue. - try: - self._callback(items) - except Exception as exc: - _LOGGER.exception("Error in queue callback worker: %s", exc) - - _LOGGER.debug("Exiting the QueueCallbackWorker.") diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/histogram.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/histogram.py deleted file mode 100644 index 29ee6fc61685..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/histogram.py +++ /dev/null @@ -1,154 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import, division - - -class Histogram(object): - """Representation of a single histogram. - - The purpose of this class is to store actual ack timing information - in order to predict how long to renew leases. - - The default implementation uses the 99th percentile of previous ack - times to implicitly lease messages; however, custom - :class:`~.pubsub_v1.subscriber._consumer.Consumer` subclasses - are free to use a different formula. - - The precision of data stored is to the nearest integer. Additionally, - values outside the range of ``10 <= x <= 600`` are stored as ``10`` or - ``600``, since these are the boundaries of leases in the actual API. - """ - - def __init__(self, data=None): - """Instantiate the histogram. - - Args: - data (Mapping[str, int]): The data strucure to be used to store - the underlying data. The default is an empty dictionary. - This can be set to a dictionary-like object if required - (for example, if a special object is needed for - concurrency reasons). - """ - # The data is stored as a dictionary, with the keys being the - # value being added and the values being the number of times that - # value was added to the dictionary. - # - # This is depending on the Python interpreter's implicit ordering - # of dictionaries, which is a bitwise sort by the key's ``hash()`` - # value. Because ``hash(int i) -> i`` and all of our keys are - # positive integers (negatives would be a problem because the sort - # is bitwise), we can rely on this. - if data is None: - data = {} - self._data = data - self._len = 0 - - def __len__(self): - """Return the total number of data points in this histogram. - - This is cached on a separate counter (rather than computing it using - ``sum([v for v in self._data.values()])``) to optimize lookup. - - Returns: - int: The total number of data points in this histogram. - """ - return self._len - - def __contains__(self, needle): - """Return True if needle is present in the histogram, False otherwise. - - Returns: - bool: True or False - """ - return needle in self._data - - def __repr__(self): - return "".format( - len=len(self), max=self.max, min=self.min - ) - - @property - def max(self): - """Return the maximum value in this histogram. - - If there are no values in the histogram at all, return 600. - - Returns: - int: The maximum value in the histogram. - """ - if len(self._data) == 0: - return 600 - return next(iter(reversed(sorted(self._data.keys())))) - - @property - def min(self): - """Return the minimum value in this histogram. - - If there are no values in the histogram at all, return 10. - - Returns: - int: The minimum value in the histogram. - """ - if len(self._data) == 0: - return 10 - return next(iter(sorted(self._data.keys()))) - - def add(self, value): - """Add the value to this histogram. - - Args: - value (int): The value. Values outside of ``10 <= x <= 600`` - will be raised to ``10`` or reduced to ``600``. - """ - # If the value is out of bounds, bring it in bounds. - value = int(value) - if value < 10: - value = 10 - if value > 600: - value = 600 - - # Add the value to the histogram's data dictionary. - self._data.setdefault(value, 0) - self._data[value] += 1 - self._len += 1 - - def percentile(self, percent): - """Return the value that is the Nth precentile in the histogram. - - Args: - percent (Union[int, float]): The precentile being sought. The - default consumer implementations use consistently use ``99``. - - Returns: - int: The value corresponding to the requested percentile. - """ - # Sanity check: Any value over 100 should become 100. - if percent >= 100: - percent = 100 - - # Determine the actual target number. - target = len(self) - len(self) * (percent / 100) - - # Iterate over the values in reverse, dropping the target by the - # number of times each value has been seen. When the target passes - # 0, return the value we are currently viewing. - for k in reversed(sorted(self._data.keys())): - target -= self._data[k] - if target < 0: - return k - - # The only way to get here is if there was no data. - # In this case, just return 10 seconds. - return 10 diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py deleted file mode 100644 index 8a683e4e772d..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py +++ /dev/null @@ -1,193 +0,0 @@ -# Copyright 2017, 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. - -from __future__ import absolute_import - -import collections -import copy -import logging -import random -import threading -import time - -import six - -from google.cloud.pubsub_v1.subscriber._protocol import requests - - -_LOGGER = logging.getLogger(__name__) -_LEASE_WORKER_NAME = "Thread-LeaseMaintainer" - - -_LeasedMessage = collections.namedtuple("_LeasedMessage", ["added_time", "size"]) - - -class Leaser(object): - def __init__(self, manager): - self._thread = None - self._manager = manager - - # a lock used for start/stop operations, protecting the _thread attribute - self._operational_lock = threading.Lock() - - # A lock ensuring that add/remove operations are atomic and cannot be - # intertwined. Protects the _leased_messages and _bytes attributes. - self._add_remove_lock = threading.Lock() - - self._leased_messages = {} - """dict[str, float]: A mapping of ack IDs to the local time when the - ack ID was initially leased in seconds since the epoch.""" - self._bytes = 0 - """int: The total number of bytes consumed by leased messages.""" - - self._stop_event = threading.Event() - - @property - def message_count(self): - """int: The number of leased messages.""" - return len(self._leased_messages) - - @property - def ack_ids(self): - """Sequence[str]: The ack IDs of all leased messages.""" - return self._leased_messages.keys() - - @property - def bytes(self): - """int: The total size, in bytes, of all leased messages.""" - return self._bytes - - def add(self, items): - """Add messages to be managed by the leaser.""" - with self._add_remove_lock: - for item in items: - # Add the ack ID to the set of managed ack IDs, and increment - # the size counter. - if item.ack_id not in self._leased_messages: - self._leased_messages[item.ack_id] = _LeasedMessage( - added_time=time.time(), size=item.byte_size - ) - self._bytes += item.byte_size - else: - _LOGGER.debug("Message %s is already lease managed", item.ack_id) - - def remove(self, items): - """Remove messages from lease management.""" - with self._add_remove_lock: - # Remove the ack ID from lease management, and decrement the - # byte counter. - for item in items: - if self._leased_messages.pop(item.ack_id, None) is not None: - self._bytes -= item.byte_size - else: - _LOGGER.debug("Item %s was not managed.", item.ack_id) - - if self._bytes < 0: - _LOGGER.debug("Bytes was unexpectedly negative: %d", self._bytes) - self._bytes = 0 - - def maintain_leases(self): - """Maintain all of the leases being managed. - - This method modifies the ack deadline for all of the managed - ack IDs, then waits for most of that time (but with jitter), and - repeats. - """ - while self._manager.is_active and not self._stop_event.is_set(): - # Determine the appropriate duration for the lease. This is - # based off of how long previous messages have taken to ack, with - # a sensible default and within the ranges allowed by Pub/Sub. - p99 = self._manager.ack_histogram.percentile(99) - _LOGGER.debug("The current p99 value is %d seconds.", p99) - - # Make a copy of the leased messages. This is needed because it's - # possible for another thread to modify the dictionary while - # we're iterating over it. - leased_messages = copy.copy(self._leased_messages) - - # Drop any leases that are well beyond max lease time. This - # ensures that in the event of a badly behaving actor, we can - # drop messages and allow Pub/Sub to resend them. - cutoff = time.time() - self._manager.flow_control.max_lease_duration - to_drop = [ - requests.DropRequest(ack_id, item.size) - for ack_id, item in six.iteritems(leased_messages) - if item.added_time < cutoff - ] - - if to_drop: - _LOGGER.warning( - "Dropping %s items because they were leased too long.", len(to_drop) - ) - self._manager.dispatcher.drop(to_drop) - - # Remove dropped items from our copy of the leased messages (they - # have already been removed from the real one by - # self._manager.drop(), which calls self.remove()). - for item in to_drop: - leased_messages.pop(item.ack_id) - - # Create a streaming pull request. - # We do not actually call `modify_ack_deadline` over and over - # because it is more efficient to make a single request. - ack_ids = leased_messages.keys() - if ack_ids: - _LOGGER.debug("Renewing lease for %d ack IDs.", len(ack_ids)) - - # NOTE: This may not work as expected if ``consumer.active`` - # has changed since we checked it. An implementation - # without any sort of race condition would require a - # way for ``send_request`` to fail when the consumer - # is inactive. - self._manager.dispatcher.modify_ack_deadline( - [requests.ModAckRequest(ack_id, p99) for ack_id in ack_ids] - ) - - # Now wait an appropriate period of time and do this again. - # - # We determine the appropriate period of time based on a random - # period between 0 seconds and 90% of the lease. This use of - # jitter (http://bit.ly/2s2ekL7) helps decrease contention in cases - # where there are many clients. - snooze = random.uniform(0.0, p99 * 0.9) - _LOGGER.debug("Snoozing lease management for %f seconds.", snooze) - self._stop_event.wait(timeout=snooze) - - _LOGGER.info("%s exiting.", _LEASE_WORKER_NAME) - - def start(self): - with self._operational_lock: - if self._thread is not None: - raise ValueError("Leaser is already running.") - - # Create and start the helper thread. - self._stop_event.clear() - thread = threading.Thread( - name=_LEASE_WORKER_NAME, target=self.maintain_leases - ) - thread.daemon = True - thread.start() - _LOGGER.debug("Started helper thread %s", thread.name) - self._thread = thread - - def stop(self): - with self._operational_lock: - self._stop_event.set() - - if self._thread is not None: - # The thread should automatically exit when the consumer is - # inactive. - self._thread.join() - - self._thread = None diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/requests.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/requests.py deleted file mode 100644 index ac1df0af8eff..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/requests.py +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -"""Base class for concurrency policy.""" - -from __future__ import absolute_import, division - -import collections - -# Namedtuples for management requests. Used by the Message class to communicate -# items of work back to the policy. -AckRequest = collections.namedtuple( - "AckRequest", ["ack_id", "byte_size", "time_to_ack"] -) - -DropRequest = collections.namedtuple("DropRequest", ["ack_id", "byte_size"]) - -LeaseRequest = collections.namedtuple("LeaseRequest", ["ack_id", "byte_size"]) - -ModAckRequest = collections.namedtuple("ModAckRequest", ["ack_id", "seconds"]) - -NackRequest = collections.namedtuple("NackRequest", ["ack_id", "byte_size"]) diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py b/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py deleted file mode 100644 index 26764b1a9101..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/_protocol/streaming_pull_manager.py +++ /dev/null @@ -1,659 +0,0 @@ -# Copyright 2017, 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. - -from __future__ import division - -import collections -import functools -import logging -import threading - -import grpc -import six -from six.moves import queue - -from google.api_core import bidi -from google.api_core import exceptions -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber._protocol import dispatcher -from google.cloud.pubsub_v1.subscriber._protocol import heartbeater -from google.cloud.pubsub_v1.subscriber._protocol import histogram -from google.cloud.pubsub_v1.subscriber._protocol import leaser -from google.cloud.pubsub_v1.subscriber._protocol import requests -import google.cloud.pubsub_v1.subscriber.message -import google.cloud.pubsub_v1.subscriber.scheduler - -_LOGGER = logging.getLogger(__name__) -_RPC_ERROR_THREAD_NAME = "Thread-OnRpcTerminated" -_RETRYABLE_STREAM_ERRORS = ( - exceptions.DeadlineExceeded, - exceptions.ServiceUnavailable, - exceptions.InternalServerError, - exceptions.Unknown, - exceptions.GatewayTimeout, - exceptions.Aborted, -) -_TERMINATING_STREAM_ERRORS = (exceptions.Cancelled,) -_MAX_LOAD = 1.0 -"""The load threshold above which to pause the incoming message stream.""" - -_RESUME_THRESHOLD = 0.8 -"""The load threshold below which to resume the incoming message stream.""" - - -def _maybe_wrap_exception(exception): - """Wraps a gRPC exception class, if needed.""" - if isinstance(exception, grpc.RpcError): - return exceptions.from_grpc_error(exception) - return exception - - -def _wrap_callback_errors(callback, on_callback_error, message): - """Wraps a user callback so that if an exception occurs the message is - nacked. - - Args: - callback (Callable[None, Message]): The user callback. - message (~Message): The Pub/Sub message. - """ - try: - callback(message) - except Exception as exc: - # Note: the likelihood of this failing is extremely low. This just adds - # a message to a queue, so if this doesn't work the world is in an - # unrecoverable state and this thread should just bail. - _LOGGER.exception( - "Top-level exception occurred in callback while processing a message" - ) - message.nack() - on_callback_error(exc) - - -class StreamingPullManager(object): - """The streaming pull manager coordinates pulling messages from Pub/Sub, - leasing them, and scheduling them to be processed. - - Args: - client (~.pubsub_v1.subscriber.client): The subscriber client used - to create this instance. - subscription (str): The name of the subscription. The canonical - format for this is - ``projects/{project}/subscriptions/{subscription}``. - flow_control (~google.cloud.pubsub_v1.types.FlowControl): The flow - control settings. - scheduler (~google.cloud.pubsub_v1.scheduler.Scheduler): The scheduler - to use to process messages. If not provided, a thread pool-based - scheduler will be used. - """ - - _UNARY_REQUESTS = True - """If set to True, this class will make requests over a separate unary - RPC instead of over the streaming RPC.""" - - def __init__( - self, client, subscription, flow_control=types.FlowControl(), scheduler=None - ): - self._client = client - self._subscription = subscription - self._flow_control = flow_control - self._ack_histogram = histogram.Histogram() - self._last_histogram_size = 0 - self._ack_deadline = 10 - self._rpc = None - self._callback = None - self._closing = threading.Lock() - self._closed = False - self._close_callbacks = [] - - if scheduler is None: - self._scheduler = ( - google.cloud.pubsub_v1.subscriber.scheduler.ThreadScheduler() - ) - else: - self._scheduler = scheduler - - # A FIFO queue for the messages that have been received from the server, - # but not yet added to the lease management (and not sent to user callback), - # because the FlowControl limits have been hit. - self._messages_on_hold = queue.Queue() - - # the total number of bytes consumed by the messages currently on hold - self._on_hold_bytes = 0 - - # A lock ensuring that pausing / resuming the consumer are both atomic - # operations that cannot be executed concurrently. Needed for properly - # syncing these operations with the current leaser load. Additionally, - # the lock is used to protect modifications of internal data that - # affects the load computation, i.e. the count and size of the messages - # currently on hold. - self._pause_resume_lock = threading.Lock() - - # The threads created in ``.open()``. - self._dispatcher = None - self._leaser = None - self._consumer = None - self._heartbeater = None - - @property - def is_active(self): - """bool: True if this manager is actively streaming. - - Note that ``False`` does not indicate this is complete shut down, - just that it stopped getting new messages. - """ - return self._consumer is not None and self._consumer.is_active - - @property - def flow_control(self): - """google.cloud.pubsub_v1.types.FlowControl: The active flow control - settings.""" - return self._flow_control - - @property - def dispatcher(self): - """google.cloud.pubsub_v1.subscriber._protocol.dispatcher.Dispatcher: - The dispatcher helper. - """ - return self._dispatcher - - @property - def leaser(self): - """google.cloud.pubsub_v1.subscriber._protocol.leaser.Leaser: - The leaser helper. - """ - return self._leaser - - @property - def ack_histogram(self): - """google.cloud.pubsub_v1.subscriber._protocol.histogram.Histogram: - The histogram tracking time-to-acknowledge. - """ - return self._ack_histogram - - @property - def ack_deadline(self): - """Return the current ack deadline based on historical time-to-ack. - - This method is "sticky". It will only perform the computations to - check on the right ack deadline if the histogram has gained a - significant amount of new information. - - Returns: - int: The ack deadline. - """ - target = min([self._last_histogram_size * 2, self._last_histogram_size + 100]) - if len(self.ack_histogram) > target: - self._ack_deadline = self.ack_histogram.percentile(percent=99) - return self._ack_deadline - - @property - def load(self): - """Return the current load. - - The load is represented as a float, where 1.0 represents having - hit one of the flow control limits, and values between 0.0 and 1.0 - represent how close we are to them. (0.5 means we have exactly half - of what the flow control setting allows, for example.) - - There are (currently) two flow control settings; this property - computes how close the manager is to each of them, and returns - whichever value is higher. (It does not matter that we have lots of - running room on setting A if setting B is over.) - - Returns: - float: The load value. - """ - if self._leaser is None: - return 0.0 - - # Messages that are temporarily put on hold are not being delivered to - # user's callbacks, thus they should not contribute to the flow control - # load calculation. - # However, since these messages must still be lease-managed to avoid - # unnecessary ACK deadline expirations, their count and total size must - # be subtracted from the leaser's values. - return max( - [ - (self._leaser.message_count - self._messages_on_hold.qsize()) - / self._flow_control.max_messages, - (self._leaser.bytes - self._on_hold_bytes) - / self._flow_control.max_bytes, - ] - ) - - def add_close_callback(self, callback): - """Schedules a callable when the manager closes. - - Args: - callback (Callable): The method to call. - """ - self._close_callbacks.append(callback) - - def maybe_pause_consumer(self): - """Check the current load and pause the consumer if needed.""" - with self._pause_resume_lock: - if self.load >= _MAX_LOAD: - if self._consumer is not None and not self._consumer.is_paused: - _LOGGER.debug( - "Message backlog over load at %.2f, pausing.", self.load - ) - self._consumer.pause() - - def maybe_resume_consumer(self): - """Check the load and held messages and resume the consumer if needed. - - If there are messages held internally, release those messages before - resuming the consumer. That will avoid leaser overload. - """ - with self._pause_resume_lock: - # If we have been paused by flow control, check and see if we are - # back within our limits. - # - # In order to not thrash too much, require us to have passed below - # the resume threshold (80% by default) of each flow control setting - # before restarting. - if self._consumer is None or not self._consumer.is_paused: - return - - _LOGGER.debug("Current load: %.2f", self.load) - - # Before maybe resuming the background consumer, release any messages - # currently on hold, if the current load allows for it. - self._maybe_release_messages() - - if self.load < _RESUME_THRESHOLD: - _LOGGER.debug("Current load is %.2f, resuming consumer.", self.load) - self._consumer.resume() - else: - _LOGGER.debug("Did not resume, current load is %.2f.", self.load) - - def _maybe_release_messages(self): - """Release (some of) the held messages if the current load allows for it. - - The method tries to release as many messages as the current leaser load - would allow. Each released message is added to the lease management, - and the user callback is scheduled for it. - - If there are currently no messages on hold, or if the leaser is - already overloaded, this method is effectively a no-op. - - The method assumes the caller has acquired the ``_pause_resume_lock``. - """ - while True: - if self.load >= _MAX_LOAD: - break # already overloaded - - try: - msg = self._messages_on_hold.get_nowait() - except queue.Empty: - break - - self._on_hold_bytes -= msg.size - - if self._on_hold_bytes < 0: - _LOGGER.warning( - "On hold bytes was unexpectedly negative: %s", self._on_hold_bytes - ) - self._on_hold_bytes = 0 - - _LOGGER.debug( - "Released held message, scheduling callback for it, " - "still on hold %s (bytes %s).", - self._messages_on_hold.qsize(), - self._on_hold_bytes, - ) - self._scheduler.schedule(self._callback, msg) - - def _send_unary_request(self, request): - """Send a request using a separate unary request instead of over the - stream. - - Args: - request (types.StreamingPullRequest): The stream request to be - mapped into unary requests. - """ - if request.ack_ids: - self._client.acknowledge( - subscription=self._subscription, ack_ids=list(request.ack_ids) - ) - - if request.modify_deadline_ack_ids: - # Send ack_ids with the same deadline seconds together. - deadline_to_ack_ids = collections.defaultdict(list) - - for n, ack_id in enumerate(request.modify_deadline_ack_ids): - deadline = request.modify_deadline_seconds[n] - deadline_to_ack_ids[deadline].append(ack_id) - - for deadline, ack_ids in six.iteritems(deadline_to_ack_ids): - self._client.modify_ack_deadline( - subscription=self._subscription, - ack_ids=ack_ids, - ack_deadline_seconds=deadline, - ) - - _LOGGER.debug("Sent request(s) over unary RPC.") - - def send(self, request): - """Queue a request to be sent to the RPC. - - If a RetryError occurs, the manager shutdown is triggered, and the - error is re-raised. - """ - if self._UNARY_REQUESTS: - try: - self._send_unary_request(request) - except exceptions.GoogleAPICallError: - _LOGGER.debug( - "Exception while sending unary RPC. This is typically " - "non-fatal as stream requests are best-effort.", - exc_info=True, - ) - except exceptions.RetryError as exc: - _LOGGER.debug( - "RetryError while sending unary RPC. Waiting on a transient " - "error resolution for too long, will now trigger shutdown.", - exc_info=False, - ) - # The underlying channel has been suffering from a retryable error - # for too long, time to give up and shut the streaming pull down. - self._on_rpc_done(exc) - raise - - else: - self._rpc.send(request) - - def heartbeat(self): - """Sends an empty request over the streaming pull RPC. - - This always sends over the stream, regardless of if - ``self._UNARY_REQUESTS`` is set or not. - """ - if self._rpc is not None and self._rpc.is_active: - self._rpc.send(types.StreamingPullRequest()) - - def open(self, callback, on_callback_error): - """Begin consuming messages. - - Args: - callback (Callable[None, google.cloud.pubsub_v1.message.Message]): - A callback that will be called for each message received on the - stream. - on_callback_error (Callable[Exception]): - A callable that will be called if an exception is raised in - the provided `callback`. - """ - if self.is_active: - raise ValueError("This manager is already open.") - - if self._closed: - raise ValueError("This manager has been closed and can not be re-used.") - - self._callback = functools.partial( - _wrap_callback_errors, callback, on_callback_error - ) - - # Create the RPC - stream_ack_deadline_seconds = self.ack_histogram.percentile(99) - - get_initial_request = functools.partial( - self._get_initial_request, stream_ack_deadline_seconds - ) - self._rpc = bidi.ResumableBidiRpc( - start_rpc=self._client.api.streaming_pull, - initial_request=get_initial_request, - should_recover=self._should_recover, - should_terminate=self._should_terminate, - throttle_reopen=True, - ) - self._rpc.add_done_callback(self._on_rpc_done) - - _LOGGER.debug( - "Creating a stream, default ACK deadline set to {} seconds.".format( - stream_ack_deadline_seconds - ) - ) - - # Create references to threads - self._dispatcher = dispatcher.Dispatcher(self, self._scheduler.queue) - self._consumer = bidi.BackgroundConsumer(self._rpc, self._on_response) - self._leaser = leaser.Leaser(self) - self._heartbeater = heartbeater.Heartbeater(self) - - # Start the thread to pass the requests. - self._dispatcher.start() - - # Start consuming messages. - self._consumer.start() - - # Start the lease maintainer thread. - self._leaser.start() - - # Start the stream heartbeater thread. - self._heartbeater.start() - - def close(self, reason=None): - """Stop consuming messages and shutdown all helper threads. - - This method is idempotent. Additional calls will have no effect. - - Args: - reason (Any): The reason to close this. If None, this is considered - an "intentional" shutdown. This is passed to the callbacks - specified via :meth:`add_close_callback`. - """ - with self._closing: - if self._closed: - return - - # Stop consuming messages. - if self.is_active: - _LOGGER.debug("Stopping consumer.") - self._consumer.stop() - self._consumer = None - - # Shutdown all helper threads - _LOGGER.debug("Stopping scheduler.") - self._scheduler.shutdown() - self._scheduler = None - - # Leaser and dispatcher reference each other through the shared - # StreamingPullManager instance, i.e. "self", thus do not set their - # references to None until both have been shut down. - # - # NOTE: Even if the dispatcher operates on an inactive leaser using - # the latter's add() and remove() methods, these have no impact on - # the stopped leaser (the leaser is never again re-started). Ditto - # for the manager's maybe_resume_consumer() / maybe_pause_consumer(), - # because the consumer gets shut down first. - _LOGGER.debug("Stopping leaser.") - self._leaser.stop() - _LOGGER.debug("Stopping dispatcher.") - self._dispatcher.stop() - self._dispatcher = None - # dispatcher terminated, OK to dispose the leaser reference now - self._leaser = None - _LOGGER.debug("Stopping heartbeater.") - self._heartbeater.stop() - self._heartbeater = None - - self._rpc = None - self._closed = True - _LOGGER.debug("Finished stopping manager.") - - for callback in self._close_callbacks: - callback(self, reason) - - def _get_initial_request(self, stream_ack_deadline_seconds): - """Return the initial request for the RPC. - - This defines the initial request that must always be sent to Pub/Sub - immediately upon opening the subscription. - - Args: - stream_ack_deadline_seconds (int): - The default message acknowledge deadline for the stream. - - Returns: - google.cloud.pubsub_v1.types.StreamingPullRequest: A request - suitable for being the first request on the stream (and not - suitable for any other purpose). - """ - # Any ack IDs that are under lease management need to have their - # deadline extended immediately. - if self._leaser is not None: - # Explicitly copy the list, as it could be modified by another - # thread. - lease_ids = list(self._leaser.ack_ids) - else: - lease_ids = [] - - # Put the request together. - request = types.StreamingPullRequest( - modify_deadline_ack_ids=list(lease_ids), - modify_deadline_seconds=[self.ack_deadline] * len(lease_ids), - stream_ack_deadline_seconds=stream_ack_deadline_seconds, - subscription=self._subscription, - ) - - # Return the initial request. - return request - - def _on_response(self, response): - """Process all received Pub/Sub messages. - - For each message, send a modified acknowledgment request to the - server. This prevents expiration of the message due to buffering by - gRPC or proxy/firewall. This makes the server and client expiration - timer closer to each other thus preventing the message being - redelivered multiple times. - - After the messages have all had their ack deadline updated, execute - the callback for each message using the executor. - """ - if response is None: - _LOGGER.debug( - "Response callback invoked with None, likely due to a " - "transport shutdown." - ) - return - - _LOGGER.debug( - "Processing %s received message(s), currenty on hold %s (bytes %s).", - len(response.received_messages), - self._messages_on_hold.qsize(), - self._on_hold_bytes, - ) - - # Immediately (i.e. without waiting for the auto lease management) - # modack the messages we received, as this tells the server that we've - # received them. - items = [ - requests.ModAckRequest(message.ack_id, self._ack_histogram.percentile(99)) - for message in response.received_messages - ] - self._dispatcher.modify_ack_deadline(items) - - invoke_callbacks_for = [] - - for received_message in response.received_messages: - message = google.cloud.pubsub_v1.subscriber.message.Message( - received_message.message, - received_message.ack_id, - received_message.delivery_attempt, - self._scheduler.queue, - ) - # Making a decision based on the load, and modifying the data that - # affects the load -> needs a lock, as that state can be modified - # by different threads. - with self._pause_resume_lock: - if self.load < _MAX_LOAD: - invoke_callbacks_for.append(message) - else: - self._messages_on_hold.put(message) - self._on_hold_bytes += message.size - - req = requests.LeaseRequest(ack_id=message.ack_id, byte_size=message.size) - self.leaser.add([req]) - self.maybe_pause_consumer() - - _LOGGER.debug( - "Scheduling callbacks for %s new messages, new total on hold %s (bytes %s).", - len(invoke_callbacks_for), - self._messages_on_hold.qsize(), - self._on_hold_bytes, - ) - for msg in invoke_callbacks_for: - self._scheduler.schedule(self._callback, msg) - - def _should_recover(self, exception): - """Determine if an error on the RPC stream should be recovered. - - If the exception is one of the retryable exceptions, this will signal - to the consumer thread that it should "recover" from the failure. - - This will cause the stream to exit when it returns :data:`False`. - - Returns: - bool: Indicates if the caller should recover or shut down. - Will be :data:`True` if the ``exception`` is "acceptable", i.e. - in a list of retryable / idempotent exceptions. - """ - exception = _maybe_wrap_exception(exception) - # If this is in the list of idempotent exceptions, then we want to - # recover. - if isinstance(exception, _RETRYABLE_STREAM_ERRORS): - _LOGGER.info("Observed recoverable stream error %s", exception) - return True - _LOGGER.info("Observed non-recoverable stream error %s", exception) - return False - - def _should_terminate(self, exception): - """Determine if an error on the RPC stream should be terminated. - - If the exception is one of the terminating exceptions, this will signal - to the consumer thread that it should terminate. - - This will cause the stream to exit when it returns :data:`True`. - - Returns: - bool: Indicates if the caller should terminate or attempt recovery. - Will be :data:`True` if the ``exception`` is "acceptable", i.e. - in a list of terminating exceptions. - """ - exception = _maybe_wrap_exception(exception) - if isinstance(exception, _TERMINATING_STREAM_ERRORS): - _LOGGER.info("Observed terminating stream error %s", exception) - return True - _LOGGER.info("Observed non-terminating stream error %s", exception) - return False - - def _on_rpc_done(self, future): - """Triggered whenever the underlying RPC terminates without recovery. - - This is typically triggered from one of two threads: the background - consumer thread (when calling ``recv()`` produces a non-recoverable - error) or the grpc management thread (when cancelling the RPC). - - This method is *non-blocking*. It will start another thread to deal - with shutting everything down. This is to prevent blocking in the - background consumer and preventing it from being ``joined()``. - """ - _LOGGER.info("RPC termination has signaled streaming pull manager shutdown.") - future = _maybe_wrap_exception(future) - thread = threading.Thread( - name=_RPC_ERROR_THREAD_NAME, target=self.close, kwargs={"reason": future} - ) - thread.daemon = True - thread.start() diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/client.py b/pubsub/google/cloud/pubsub_v1/subscriber/client.py deleted file mode 100644 index b255fe4767ca..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/client.py +++ /dev/null @@ -1,230 +0,0 @@ -# Copyright 2019, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import os -import pkg_resources - -import grpc - -from google.api_core import grpc_helpers -from google.oauth2 import service_account - -from google.cloud.pubsub_v1 import _gapic -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.gapic import subscriber_client -from google.cloud.pubsub_v1.gapic.transports import subscriber_grpc_transport -from google.cloud.pubsub_v1.subscriber import futures -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager - - -__version__ = pkg_resources.get_distribution("google-cloud-pubsub").version - -_BLACKLISTED_METHODS = ( - "publish", - "from_service_account_file", - "from_service_account_json", -) - - -@_gapic.add_methods(subscriber_client.SubscriberClient, blacklist=_BLACKLISTED_METHODS) -class Client(object): - """A subscriber client for Google Cloud Pub/Sub. - - This creates an object that is capable of subscribing to messages. - Generally, you can instantiate this client with no arguments, and you - get sensible defaults. - - Args: - kwargs (dict): Any additional arguments provided are sent as keyword - keyword arguments to the underlying - :class:`~google.cloud.pubsub_v1.gapic.subscriber_client.SubscriberClient`. - Generally you should not need to set additional keyword - arguments. Optionally, regional endpoints can be set via - ``client_options`` that takes a single key-value pair that - defines the endpoint. - - Example: - - .. code-block:: python - - from google.cloud import pubsub_v1 - - subscriber_client = pubsub_v1.SubscriberClient( - # Optional - client_options = { - "api_endpoint": REGIONAL_ENDPOINT - } - ) - """ - - def __init__(self, **kwargs): - # Sanity check: Is our goal to use the emulator? - # If so, create a grpc insecure channel with the emulator host - # as the target. - if os.environ.get("PUBSUB_EMULATOR_HOST"): - kwargs["channel"] = grpc.insecure_channel( - target=os.environ.get("PUBSUB_EMULATOR_HOST") - ) - - # Use a custom channel. - # We need this in order to set appropriate default message size and - # keepalive options. - if "transport" not in kwargs: - channel = kwargs.pop("channel", None) - if channel is None: - channel = grpc_helpers.create_channel( - credentials=kwargs.pop("credentials", None), - target=self.target, - scopes=subscriber_client.SubscriberClient._DEFAULT_SCOPES, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - "grpc.keepalive_time_ms": 30000, - }.items(), - ) - # cannot pass both 'channel' and 'credentials' - kwargs.pop("credentials", None) - transport = subscriber_grpc_transport.SubscriberGrpcTransport( - channel=channel - ) - kwargs["transport"] = transport - - # Add the metrics headers, and instantiate the underlying GAPIC - # client. - self._api = subscriber_client.SubscriberClient(**kwargs) - - @classmethod - def from_service_account_file(cls, filename, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - kwargs: Additional arguments to pass to the constructor. - - Returns: - A Subscriber :class:`~google.cloud.pubsub_v1.subscriber.client.Client` - instance that is the constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(**kwargs) - - from_service_account_json = from_service_account_file - - @property - def target(self): - """Return the target (where the API is). - - Returns: - str: The location of the API. - """ - return subscriber_client.SubscriberClient.SERVICE_ADDRESS - - @property - def api(self): - """The underlying gapic API client.""" - return self._api - - def subscribe(self, subscription, callback, flow_control=(), scheduler=None): - """Asynchronously start receiving messages on a given subscription. - - This method starts a background thread to begin pulling messages from - a Pub/Sub subscription and scheduling them to be processed using the - provided ``callback``. - - The ``callback`` will be called with an individual - :class:`google.cloud.pubsub_v1.subscriber.message.Message`. It is the - responsibility of the callback to either call ``ack()`` or ``nack()`` - on the message when it finished processing. If an exception occurs in - the callback during processing, the exception is logged and the message - is ``nack()`` ed. - - The ``flow_control`` argument can be used to control the rate of at - which messages are pulled. The settings are relatively conservative by - default to prevent "message hoarding" - a situation where the client - pulls a large number of messages but can not process them fast enough - leading it to "starve" other clients of messages. Increasing these - settings may lead to faster throughput for messages that do not take - a long time to process. - - This method starts the receiver in the background and returns a - *Future* representing its execution. Waiting on the future (calling - ``result()``) will block forever or until a non-recoverable error - is encountered (such as loss of network connectivity). Cancelling the - future will signal the process to shutdown gracefully and exit. - - .. note:: This uses Pub/Sub's *streaming pull* feature. This feature - properties that may be surprising. Please take a look at - https://cloud.google.com/pubsub/docs/pull#streamingpull for - more details on how streaming pull behaves compared to the - synchronous pull method. - - Example: - - .. code-block:: python - - from google.cloud import pubsub_v1 - - subscriber_client = pubsub_v1.SubscriberClient() - - # existing subscription - subscription = subscriber_client.subscription_path( - 'my-project-id', 'my-subscription') - - def callback(message): - print(message) - message.ack() - - future = subscriber_client.subscribe( - subscription, callback) - - try: - future.result() - except KeyboardInterrupt: - future.cancel() - - Args: - subscription (str): The name of the subscription. The - subscription should have already been created (for example, - by using :meth:`create_subscription`). - callback (Callable[~google.cloud.pubsub_v1.subscriber.message.Message]): - The callback function. This function receives the message as - its only argument and will be called from a different thread/ - process depending on the scheduling strategy. - flow_control (~google.cloud.pubsub_v1.types.FlowControl): The flow control - settings. Use this to prevent situations where you are - inundated with too many messages at once. - scheduler (~google.cloud.pubsub_v1.subscriber.scheduler.Scheduler): An optional - *scheduler* to use when executing the callback. This controls - how callbacks are executed concurrently. - - Returns: - A :class:`~google.cloud.pubsub_v1.subscriber.futures.StreamingPullFuture` - instance that can be used to manage the background stream. - """ - flow_control = types.FlowControl(*flow_control) - - manager = streaming_pull_manager.StreamingPullManager( - self, subscription, flow_control=flow_control, scheduler=scheduler - ) - - future = futures.StreamingPullFuture(manager) - - manager.open(callback=callback, on_callback_error=future.set_exception) - - return future diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/futures.py b/pubsub/google/cloud/pubsub_v1/subscriber/futures.py deleted file mode 100644 index 12504c18b5df..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/futures.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.pubsub_v1 import futures - - -class StreamingPullFuture(futures.Future): - """Represents a process that asynchronously performs streaming pull and - schedules messages to be processed. - - This future is resolved when the process is stopped (via :meth:`cancel`) or - if it encounters an unrecoverable error. Calling `.result()` will cause - the calling thread to block indefinitely. - """ - - def __init__(self, manager): - super(StreamingPullFuture, self).__init__() - self._manager = manager - self._manager.add_close_callback(self._on_close_callback) - self._cancelled = False - - def _on_close_callback(self, manager, result): - if result is None: - self.set_result(True) - else: - self.set_exception(result) - - def cancel(self): - """Stops pulling messages and shutdowns the background thread consuming - messages. - """ - self._cancelled = True - return self._manager.close() - - def cancelled(self): - """ - returns: - bool: ``True`` if the subscription has been cancelled. - """ - return self._cancelled diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/message.py b/pubsub/google/cloud/pubsub_v1/subscriber/message.py deleted file mode 100644 index 6dc7bc443b59..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/message.py +++ /dev/null @@ -1,257 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import datetime -import json -import math -import time - -from google.api_core import datetime_helpers -from google.cloud.pubsub_v1.subscriber._protocol import requests - - -_MESSAGE_REPR = """\ -Message {{ - data: {!r} - attributes: {} -}}""" - - -def _indent(lines, prefix=" "): - """Indent some text. - - Note that this is present as ``textwrap.indent``, but not in Python 2. - - Args: - lines (str): The newline delimited string to be indented. - prefix (Optional[str]): The prefix to indent each line with. Default - to two spaces. - - Returns: - str: The newly indented content. - """ - indented = [] - for line in lines.split("\n"): - indented.append(prefix + line) - return "\n".join(indented) - - -class Message(object): - """A representation of a single Pub/Sub message. - - The common way to interact with - :class:`~.pubsub_v1.subscriber.message.Message` objects is to receive - them in callbacks on subscriptions; most users should never have a need - to instantiate them by hand. (The exception to this is if you are - implementing a custom subclass to - :class:`~.pubsub_v1.subscriber._consumer.Consumer`.) - - Attributes: - message_id (str): The message ID. In general, you should not need - to use this directly. - data (bytes): The data in the message. Note that this will be a - :class:`bytes`, not a text string. - attributes (.ScalarMapContainer): The attributes sent along with the - message. See :attr:`attributes` for more information on this type. - publish_time (datetime): The time that this message was originally - published. - """ - - def __init__(self, message, ack_id, delivery_attempt, request_queue): - """Construct the Message. - - .. note:: - - This class should not be constructed directly; it is the - responsibility of :class:`BasePolicy` subclasses to do so. - - Args: - message (~.pubsub_v1.types.PubsubMessage): The message received - from Pub/Sub. - ack_id (str): The ack_id received from Pub/Sub. - delivery_attempt (int): The delivery attempt counter received - from Pub/Sub if a DeadLetterPolicy is set on the subscription, - and zero otherwise. - request_queue (queue.Queue): A queue provided by the policy that - can accept requests; the policy is responsible for handling - those requests. - """ - self._message = message - self._ack_id = ack_id - self._delivery_attempt = delivery_attempt if delivery_attempt > 0 else None - self._request_queue = request_queue - self.message_id = message.message_id - - # The instantiation time is the time that this message - # was received. Tracking this provides us a way to be smart about - # the default lease deadline. - self._received_timestamp = time.time() - - def __repr__(self): - # Get an abbreviated version of the data. - abbv_data = self._message.data - if len(abbv_data) > 50: - abbv_data = abbv_data[:50] + b"..." - - pretty_attrs = json.dumps( - dict(self.attributes), indent=2, separators=(",", ": "), sort_keys=True - ) - pretty_attrs = _indent(pretty_attrs) - # We don't actually want the first line indented. - pretty_attrs = pretty_attrs.lstrip() - return _MESSAGE_REPR.format(abbv_data, pretty_attrs) - - @property - def attributes(self): - """Return the attributes of the underlying Pub/Sub Message. - - .. warning:: - - A ``ScalarMapContainer`` behaves slightly differently than a - ``dict``. For a Pub / Sub message this is a ``string->string`` map. - When trying to access a value via ``map['key']``, if the key is - not in the map, then the default value for the string type will - be returned, which is an empty string. It may be more intuitive - to just cast the map to a ``dict`` or to one use ``map.get``. - - Returns: - .ScalarMapContainer: The message's attributes. This is a - ``dict``-like object provided by ``google.protobuf``. - """ - return self._message.attributes - - @property - def data(self): - """Return the data for the underlying Pub/Sub Message. - - Returns: - bytes: The message data. This is always a bytestring; if you - want a text string, call :meth:`bytes.decode`. - """ - return self._message.data - - @property - def publish_time(self): - """Return the time that the message was originally published. - - Returns: - datetime: The date and time that the message was published. - """ - timestamp = self._message.publish_time - delta = datetime.timedelta( - seconds=timestamp.seconds, microseconds=timestamp.nanos // 1000 - ) - return datetime_helpers._UTC_EPOCH + delta - - @property - def size(self): - """Return the size of the underlying message, in bytes.""" - return self._message.ByteSize() - - @property - def ack_id(self): - """str: the ID used to ack the message.""" - return self._ack_id - - @property - def delivery_attempt(self): - """The delivery attempt counter is 1 + (the sum of number of NACKs - and number of ack_deadline exceeds) for this message. It is set to None - if a DeadLetterPolicy is not set on the subscription. - - A NACK is any call to ModifyAckDeadline with a 0 deadline. An ack_deadline - exceeds event is whenever a message is not acknowledged within - ack_deadline. Note that ack_deadline is initially - Subscription.ackDeadlineSeconds, but may get extended automatically by - the client library. - - The first delivery of a given message will have this value as 1. The value - is calculated at best effort and is approximate. - - EXPERIMENTAL: This feature is part of a closed alpha release. This - API might be changed in backward-incompatible ways and is not recommended - for production use. It is not subject to any SLA or deprecation policy. - - Returns: - Optional[int]: The delivery attempt counter or None. - """ - return self._delivery_attempt - - def ack(self): - """Acknowledge the given message. - - Acknowledging a message in Pub/Sub means that you are done - with it, and it will not be delivered to this subscription again. - You should avoid acknowledging messages until you have - *finished* processing them, so that in the event of a failure, - you receive the message again. - - .. warning:: - Acks in Pub/Sub are best effort. You should always - ensure that your processing code is idempotent, as you may - receive any given message more than once. - """ - time_to_ack = math.ceil(time.time() - self._received_timestamp) - self._request_queue.put( - requests.AckRequest( - ack_id=self._ack_id, byte_size=self.size, time_to_ack=time_to_ack - ) - ) - - def drop(self): - """Release the message from lease management. - - This informs the policy to no longer hold on to the lease for this - message. Pub/Sub will re-deliver the message if it is not acknowledged - before the existing lease expires. - - .. warning:: - For most use cases, the only reason to drop a message from - lease management is on :meth:`ack` or :meth:`nack`; these methods - both call this one. You probably do not want to call this method - directly. - """ - self._request_queue.put( - requests.DropRequest(ack_id=self._ack_id, byte_size=self.size) - ) - - def modify_ack_deadline(self, seconds): - """Resets the deadline for acknowledgement. - - New deadline will be the given value of seconds from now. - - The default implementation handles this for you; you should not need - to manually deal with setting ack deadlines. The exception case is - if you are implementing your own custom subclass of - :class:`~.pubsub_v1.subcriber._consumer.Consumer`. - - Args: - seconds (int): The number of seconds to set the lease deadline - to. This should be between 0 and 600. Due to network latency, - values below 10 are advised against. - """ - self._request_queue.put( - requests.ModAckRequest(ack_id=self._ack_id, seconds=seconds) - ) - - def nack(self): - """Decline to acknowldge the given message. - - This will cause the message to be re-delivered to the subscription. - """ - self._request_queue.put( - requests.NackRequest(ack_id=self._ack_id, byte_size=self.size) - ) diff --git a/pubsub/google/cloud/pubsub_v1/subscriber/scheduler.py b/pubsub/google/cloud/pubsub_v1/subscriber/scheduler.py deleted file mode 100644 index 42674c824c64..000000000000 --- a/pubsub/google/cloud/pubsub_v1/subscriber/scheduler.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 2018, 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. - -"""Schedulers provide means to *schedule* callbacks asynchronously. - -These are used by the subscriber to call the user-provided callback to process -each message. -""" - -import abc -import concurrent.futures -import sys - -import six -from six.moves import queue - - -@six.add_metaclass(abc.ABCMeta) -class Scheduler(object): - """Abstract base class for schedulers. - - Schedulers are used to schedule callbacks asynchronously. - """ - - @property - @abc.abstractmethod - def queue(self): - """Queue: A concurrency-safe queue specific to the underlying - concurrency implementation. - - This queue is used to send messages *back* to the scheduling actor. - """ - raise NotImplementedError - - @abc.abstractmethod - def schedule(self, callback, *args, **kwargs): - """Schedule the callback to be called asynchronously. - - Args: - callback (Callable): The function to call. - args: Positional arguments passed to the function. - kwargs: Key-word arguments passed to the function. - - Returns: - None - """ - raise NotImplementedError - - @abc.abstractmethod - def shutdown(self): - """Shuts down the scheduler and immediately end all pending callbacks. - """ - raise NotImplementedError - - -def _make_default_thread_pool_executor(): - # Python 2.7 and 3.6+ have the thread_name_prefix argument, which is useful - # for debugging. - executor_kwargs = {} - if sys.version_info[:2] == (2, 7) or sys.version_info >= (3, 6): - executor_kwargs["thread_name_prefix"] = "ThreadPoolExecutor-ThreadScheduler" - return concurrent.futures.ThreadPoolExecutor(max_workers=10, **executor_kwargs) - - -class ThreadScheduler(Scheduler): - """A thread pool-based scheduler. - - This scheduler is useful in typical I/O-bound message processing. - - Args: - executor(concurrent.futures.ThreadPoolExecutor): An optional executor - to use. If not specified, a default one will be created. - """ - - def __init__(self, executor=None): - self._queue = queue.Queue() - if executor is None: - self._executor = _make_default_thread_pool_executor() - else: - self._executor = executor - - @property - def queue(self): - """Queue: A thread-safe queue used for communication between callbacks - and the scheduling thread.""" - return self._queue - - def schedule(self, callback, *args, **kwargs): - """Schedule the callback to be called asynchronously in a thread pool. - - Args: - callback (Callable): The function to call. - args: Positional arguments passed to the function. - kwargs: Key-word arguments passed to the function. - - Returns: - None - """ - self._executor.submit(callback, *args, **kwargs) - - def shutdown(self): - """Shuts down the scheduler and immediately end all pending callbacks. - """ - # Drop all pending item from the executor. Without this, the executor - # will block until all pending items are complete, which is - # undesirable. - try: - while True: - self._executor._work_queue.get(block=False) - except queue.Empty: - pass - self._executor.shutdown() diff --git a/pubsub/google/cloud/pubsub_v1/types.py b/pubsub/google/cloud/pubsub_v1/types.py deleted file mode 100644 index 2d238b42f797..000000000000 --- a/pubsub/google/cloud/pubsub_v1/types.py +++ /dev/null @@ -1,128 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import -import collections -import sys - -from google.api import http_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 -from google.iam.v1.logging import audit_data_pb2 -from google.protobuf import descriptor_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 - -from google.api_core.protobuf_helpers import get_messages -from google.cloud.pubsub_v1.proto import pubsub_pb2 - - -# Define the default values for batching. -# -# This class is used when creating a publisher or subscriber client, and -# these settings can be altered to tweak Pub/Sub behavior. -# The defaults should be fine for most use cases. -BatchSettings = collections.namedtuple( - "BatchSettings", ["max_bytes", "max_latency", "max_messages"] -) -BatchSettings.__new__.__defaults__ = ( - 1 * 1000 * 1000, # max_bytes: 1 MB - 0.01, # max_latency: 10 ms - 100, # max_messages: 100 -) - -if sys.version_info >= (3, 5): - BatchSettings.__doc__ = "The settings for batch publishing the messages." - BatchSettings.max_bytes.__doc__ = ( - "The maximum total size of the messages to collect before automatically " - "publishing the batch, including any byte size overhead of the publish " - "request itself. The maximum value is bound by the server-side limit of " - "10_000_000 bytes." - ) - BatchSettings.max_latency.__doc__ = ( - "The maximum number of seconds to wait for additional messages before " - "automatically publishing the batch." - ) - BatchSettings.max_messages.__doc__ = ( - "The maximum number of messages to collect before automatically " - "publishing the batch." - ) - - -# Define the type class and default values for flow control settings. -# -# This class is used when creating a publisher or subscriber client, and -# these settings can be altered to tweak Pub/Sub behavior. -# The defaults should be fine for most use cases. -FlowControl = collections.namedtuple( - "FlowControl", ["max_bytes", "max_messages", "max_lease_duration"] -) -FlowControl.__new__.__defaults__ = ( - 100 * 1024 * 1024, # max_bytes: 100mb - 1000, # max_messages: 1000 - 1 * 60 * 60, # max_lease_duration: 1 hour. -) - -if sys.version_info >= (3, 5): - FlowControl.__doc__ = ( - "The settings for controlling the rate at which messages are pulled " - "with an asynchronous subscription." - ) - FlowControl.max_bytes.__doc__ = ( - "The maximum total size of received - but not yet processed - messages " - "before pausing the message stream." - ) - FlowControl.max_messages.__doc__ = ( - "The maximum number of received - but not yet processed - messages before " - "pausing the message stream." - ) - FlowControl.max_lease_duration.__doc__ = ( - "The maximum amount of time in seconds to hold a lease on a message " - "before dropping it from the lease management." - ) - - -_shared_modules = [ - http_pb2, - iam_policy_pb2, - policy_pb2, - audit_data_pb2, - descriptor_pb2, - duration_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, -] - -_local_modules = [pubsub_pb2] - - -names = ["BatchSettings", "FlowControl"] - - -for module in _shared_modules: - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) - -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.pubsub_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/pubsub/noxfile.py b/pubsub/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/pubsub/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/pubsub/pylint.config.py b/pubsub/pylint.config.py deleted file mode 100644 index 625e52cc9bbb..000000000000 --- a/pubsub/pylint.config.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -import copy - -from gcp_devrel.tools import pylint - -# Library configuration - -# library_additions = {} -# Ignore generated code -library_replacements = copy.deepcopy(pylint.DEFAULT_LIBRARY_RC_REPLACEMENTS) -library_replacements['MASTER']['ignore'].append('gapic') -library_replacements['MASTER']['ignore'].append('proto') - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/pubsub/setup.cfg b/pubsub/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/pubsub/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/pubsub/setup.py b/pubsub/setup.py deleted file mode 100644 index 69f19b3db72e..000000000000 --- a/pubsub/setup.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-pubsub" -description = "Google Cloud Pub/Sub API client library" -version = "1.1.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 5 - Production/Stable" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", - 'enum34; python_version < "3.4"', -] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*", - include_package_data=True, - zip_safe=False, -) diff --git a/pubsub/synth.metadata b/pubsub/synth.metadata deleted file mode 100644 index 48f9b92bf006..000000000000 --- a/pubsub/synth.metadata +++ /dev/null @@ -1,39 +0,0 @@ -{ - "updateTime": "2020-01-08T13:27:29.257325Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.43.0", - "dockerImage": "googleapis/artman@sha256:264654a37596a44b0668b8ce6ac41082d713f6ee150b3fc6425fa78cc64e4f20" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "08b488e0660c59842a7dee0e3e2b65d9e3a514a9", - "internalRef": "288625007" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "pubsub", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/pubsub/artman_pubsub.yaml" - } - } - ] -} \ No newline at end of file diff --git a/pubsub/synth.py b/pubsub/synth.py deleted file mode 100644 index 88ac4a8d4f7e..000000000000 --- a/pubsub/synth.py +++ /dev/null @@ -1,195 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import re -import textwrap - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -version = "v1" - -# ---------------------------------------------------------------------------- -# Generate pubsub GAPIC layer -# ---------------------------------------------------------------------------- -library = gapic.py_library( - "pubsub", - version, - config_path="/google/pubsub/artman_pubsub.yaml", - include_protos=True, -) -s.move( - library, - excludes=[ - "docs/**/*", - "nox.py", - "README.rst", - "setup.py", - "google/cloud/pubsub_v1/__init__.py", - "google/cloud/pubsub_v1/types.py", - ], -) - -# Adjust tests to import the clients directly. -s.replace( - "tests/unit/gapic/v1/test_publisher_client_v1.py", - "from google.cloud import pubsub_v1", - "from google.cloud.pubsub_v1.gapic import publisher_client", -) - -s.replace( - "tests/unit/gapic/v1/test_publisher_client_v1.py", " pubsub_v1", " publisher_client" -) - -s.replace( - "tests/unit/gapic/v1/test_subscriber_client_v1.py", - "from google.cloud import pubsub_v1", - "from google.cloud.pubsub_v1.gapic import subscriber_client", -) - -s.replace( - "tests/unit/gapic/v1/test_subscriber_client_v1.py", - " pubsub_v1", - " subscriber_client", -) - -# DEFAULT SCOPES are being used. so let's force them in. -s.replace( - "google/cloud/pubsub_v1/gapic/*er_client.py", - "# The name of the interface for this client. This is the key used to", - """# The scopes needed to make gRPC calls to all of the methods defined in - # this service - _DEFAULT_SCOPES = ( - 'https://www.googleapis.com/auth/cloud-platform', - 'https://www.googleapis.com/auth/pubsub', ) - - \g<0>""", -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "import google.api_core.gapic_v1.method\n", - "\g<0>import google.api_core.path_template\n", -) - -# Doc strings are formatted poorly -s.replace( - "google/cloud/pubsub_v1/proto/pubsub_pb2.py", - 'DESCRIPTOR = _MESSAGESTORAGEPOLICY,\n\s+__module__.*\n\s+,\n\s+__doc__ = """', - "\g<0>A message storage policy.\n\n\n ", -) - -s.replace( - "google/cloud/pubsub_v1/gapic/subscriber_client.py", - "subscription \(str\): The subscription whose backlog .*\n(.*\n)+?" - "\s+Format is .*", - """subscription (str): The subscription whose backlog the snapshot retains. - Specifically, the created snapshot is guaranteed to retain: \\ - (a) The existing backlog on the subscription. More precisely, this is \\ - defined as the messages in the subscription's backlog that are \\ - unacknowledged upon the successful completion of the \\ - `CreateSnapshot` request; as well as: \\ - (b) Any messages published to the subscription's topic following the \\ - successful completion of the CreateSnapshot request. \\ - - Format is ``projects/{project}/subscriptions/{sub}``.""", -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "import functools\n", - "import collections\n" - "from copy import deepcopy\n\g<0>" -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "import pkg_resources\n", - "\g<0>import six\n" -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "class PublisherClient", - """# TODO: remove conditional import after Python 2 support is dropped -if six.PY2: - from collections import Mapping -else: - from collections.abc import Mapping - - -def _merge_dict(d1, d2): - # Modifies d1 in-place to take values from d2 - # if the nested keys from d2 are present in d1. - # https://stackoverflow.com/a/10704003/4488789 - for k, v2 in d2.items(): - v1 = d1.get(k) # returns None if v1 has no such key - if v1 is None: - raise Exception("{} is not recognized by client_config".format(k)) - if isinstance(v1, Mapping) and isinstance(v2, Mapping): - _merge_dict(v1, v2) - else: - d1[k] = v2 - return d1 - \n\n\g<0>""" -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "client_config \(dict\): DEPRECATED.", - "client_config (dict):" -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "# Raise deprecation warnings .*\n.*\n.*\n.*\n.*\n.*\n", - """default_client_config = deepcopy(publisher_client_config.config) - - if client_config is None: - client_config = default_client_config - else: - client_config = _merge_dict(default_client_config, client_config) - """ -) - -s.replace( - "google/cloud/pubsub_v1/gapic/publisher_client.py", - "~google.api_core.page_iterator.PageIterator", - "~google.api_core.page_iterator.GRPCIterator" -) - -s.replace( - "google/cloud/pubsub_v1/gapic/subscriber_client.py", - "~google.api_core.page_iterator.PageIterator", - "~google.api_core.page_iterator.GRPCIterator" -) - -# Temporary fixup for 'grpc-google-iam-vi 0.12.4' (before generation). -s.replace( - "google/cloud/pubsub_v1/gapic/transports/*_grpc_transport.py", - "from google.iam.v1 import iam_policy_pb2", - "from google.iam.v1 import iam_policy_pb2_grpc as iam_policy_pb2", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = gcp.CommonTemplates().py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/pubsub/tests/system.py b/pubsub/tests/system.py deleted file mode 100644 index 65baaf016407..000000000000 --- a/pubsub/tests/system.py +++ /dev/null @@ -1,639 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import datetime -import itertools -import operator as op -import os -import threading -import time - -import mock -import pytest -import six - -import google.auth -from google.cloud import pubsub_v1 -from google.cloud.pubsub_v1 import exceptions -from google.cloud.pubsub_v1 import futures -from google.cloud.pubsub_v1 import types - - -from test_utils.system import unique_resource_id - - -@pytest.fixture(scope=u"module") -def project(): - _, default_project = google.auth.default() - yield default_project - - -@pytest.fixture(scope=u"module") -def publisher(): - yield pubsub_v1.PublisherClient() - - -@pytest.fixture(scope=u"module") -def subscriber(): - yield pubsub_v1.SubscriberClient() - - -@pytest.fixture -def topic_path(project, publisher): - topic_name = "t" + unique_resource_id("-") - yield publisher.topic_path(project, topic_name) - - -@pytest.fixture -def subscription_path(project, subscriber): - sub_name = "s" + unique_resource_id("-") - yield subscriber.subscription_path(project, sub_name) - - -@pytest.fixture -def cleanup(): - registry = [] - yield registry - - # Perform all clean up. - for to_call, argument in registry: - to_call(argument) - - -def test_publish_messages(publisher, topic_path, cleanup): - # Make sure the topic gets deleted. - cleanup.append((publisher.delete_topic, topic_path)) - - publisher.create_topic(topic_path) - - futures = [ - publisher.publish( - topic_path, b"The hail in Wales falls mainly on the snails.", num=str(i) - ) - for i in six.moves.range(500) - ] - - for future in futures: - result = future.result() - assert isinstance(result, six.string_types) - - -def test_publish_large_messages(publisher, topic_path, cleanup): - # Make sure the topic gets deleted. - cleanup.append((publisher.delete_topic, topic_path)) - - # Each message should be smaller than 10**7 bytes (the server side limit for - # PublishRequest), but all messages combined in a PublishRequest should - # slightly exceed that threshold to make sure the publish code handles these - # cases well. - # Mind that the total PublishRequest size must still be smaller than - # 10 * 1024 * 1024 bytes in order to not exceed the max request body size limit. - msg_data = b"x" * (2 * 10 ** 6) - - publisher.batch_settings = types.BatchSettings( - max_bytes=11 * 1000 * 1000, # more than the server limit of 10 ** 7 - max_latency=2.0, # so that autocommit happens after publishing all messages - max_messages=100, - ) - publisher.create_topic(topic_path) - - futures = [publisher.publish(topic_path, msg_data, num=str(i)) for i in range(5)] - - # If the publishing logic correctly split all messages into more than a - # single batch despite a high BatchSettings.max_bytes limit, there should - # be no "InvalidArgument: request_size is too large" error. - for future in futures: - result = future.result(timeout=10) - assert isinstance(result, six.string_types) # the message ID - - -def test_subscribe_to_messages( - publisher, topic_path, subscriber, subscription_path, cleanup -): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # Create a topic. - publisher.create_topic(topic_path) - - # Subscribe to the topic. This must happen before the messages - # are published. - subscriber.create_subscription(subscription_path, topic_path) - - # Publish some messages. - futures = [ - publisher.publish(topic_path, b"Wooooo! The claaaaaw!", num=str(index)) - for index in six.moves.range(50) - ] - - # Make sure the publish completes. - for future in futures: - future.result() - - # Actually open the subscription and hold it open for a few seconds. - # The callback should process the message numbers to prove - # that we got everything at least once. - callback = AckCallback() - future = subscriber.subscribe(subscription_path, callback) - for second in six.moves.range(10): - time.sleep(1) - - # The callback should have fired at least fifty times, but it - # may take some time. - if callback.calls >= 50: - return - - # Okay, we took too long; fail out. - assert callback.calls >= 50 - - future.cancel() - - -def test_subscribe_to_messages_async_callbacks( - publisher, topic_path, subscriber, subscription_path, cleanup -): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # Create a topic. - publisher.create_topic(topic_path) - - # Subscribe to the topic. This must happen before the messages - # are published. - subscriber.create_subscription(subscription_path, topic_path) - - # Publish some messages. - futures = [ - publisher.publish(topic_path, b"Wooooo! The claaaaaw!", num=str(index)) - for index in six.moves.range(2) - ] - - # Make sure the publish completes. - for future in futures: - future.result() - - # We want to make sure that the callback was called asynchronously. So - # track when each call happened and make sure below. - callback = TimesCallback(2) - - # Actually open the subscription and hold it open for a few seconds. - future = subscriber.subscribe(subscription_path, callback) - for second in six.moves.range(5): - time.sleep(4) - - # The callback should have fired at least two times, but it may - # take some time. - if callback.calls >= 2: - first, last = sorted(callback.call_times[:2]) - diff = last - first - # "Ensure" the first two callbacks were executed asynchronously - # (sequentially would have resulted in a difference of 2+ - # seconds). - assert diff.days == 0 - assert diff.seconds < callback.sleep_time - - # Okay, we took too long; fail out. - assert callback.calls >= 2 - - future.cancel() - - -def test_creating_subscriptions_with_non_default_settings( - publisher, subscriber, project, topic_path, subscription_path, cleanup -): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # create a topic and a subscription, customize the latter's policy - publisher.create_topic(topic_path) - - msg_retention_duration = {"seconds": 911} - expiration_policy = {"ttl": {"seconds": 90210}} - new_subscription = subscriber.create_subscription( - subscription_path, - topic_path, - ack_deadline_seconds=30, - retain_acked_messages=True, - message_retention_duration=msg_retention_duration, - expiration_policy=expiration_policy, - ) - - # fetch the subscription and check its settings - project_path = subscriber.project_path(project) - subscriptions = subscriber.list_subscriptions(project_path) - - subscriptions = [sub for sub in subscriptions if sub.topic == topic_path] - assert len(subscriptions) == 1 - subscription = subscriptions[0] - - assert subscription == new_subscription - assert subscription.ack_deadline_seconds == 30 - assert subscription.retain_acked_messages - assert subscription.message_retention_duration.seconds == 911 - assert subscription.expiration_policy.ttl.seconds == 90210 - - -def test_listing_project_topics(publisher, project, cleanup): - topic_paths = [ - publisher.topic_path(project, "topic-{}".format(i) + unique_resource_id(".")) - for i in range(1, 4) - ] - for topic in topic_paths: - cleanup.append((publisher.delete_topic, topic)) - publisher.create_topic(topic) - - project_path = publisher.project_path(project) - project_topics = publisher.list_topics(project_path) - project_topics = set(t.name for t in project_topics) - - # there might be other topics in the project, thus do a "is subset" check - assert set(topic_paths) <= project_topics - - -def test_listing_project_subscriptions(publisher, subscriber, project, cleanup): - # create topics - topic_paths = [ - publisher.topic_path(project, "topic-1" + unique_resource_id(".")), - publisher.topic_path(project, "topic-2" + unique_resource_id(".")), - ] - for topic in topic_paths: - cleanup.append((publisher.delete_topic, topic)) - publisher.create_topic(topic) - - # create subscriptions - subscription_paths = [ - subscriber.subscription_path( - project, "sub-{}".format(i) + unique_resource_id(".") - ) - for i in range(1, 4) - ] - for i, subscription in enumerate(subscription_paths): - topic = topic_paths[i % 2] - cleanup.append((subscriber.delete_subscription, subscription)) - subscriber.create_subscription(subscription, topic) - - # retrieve subscriptions and check that the list matches the expected - project_path = subscriber.project_path(project) - subscriptions = subscriber.list_subscriptions(project_path) - subscriptions = set(s.name for s in subscriptions) - - # there might be other subscriptions in the project, thus do a "is subset" check - assert set(subscription_paths) <= subscriptions - - -def test_listing_topic_subscriptions(publisher, subscriber, project, cleanup): - # create topics - topic_paths = [ - publisher.topic_path(project, "topic-1" + unique_resource_id(".")), - publisher.topic_path(project, "topic-2" + unique_resource_id(".")), - ] - for topic in topic_paths: - cleanup.append((publisher.delete_topic, topic)) - publisher.create_topic(topic) - - # create subscriptions - subscription_paths = [ - subscriber.subscription_path( - project, "sub-{}".format(i) + unique_resource_id(".") - ) - for i in range(1, 4) - ] - for i, subscription in enumerate(subscription_paths): - topic = topic_paths[i % 2] - cleanup.append((subscriber.delete_subscription, subscription)) - subscriber.create_subscription(subscription, topic) - - # retrieve subscriptions and check that the list matches the expected - subscriptions = publisher.list_topic_subscriptions(topic_paths[0]) - subscriptions = set(subscriptions) - - assert subscriptions == {subscription_paths[0], subscription_paths[2]} - - -def test_managing_topic_iam_policy(publisher, topic_path, cleanup): - cleanup.append((publisher.delete_topic, topic_path)) - - # create a topic and customize its policy - publisher.create_topic(topic_path) - topic_policy = publisher.get_iam_policy(topic_path) - - topic_policy.bindings.add(role="roles/pubsub.editor", members=["domain:google.com"]) - topic_policy.bindings.add( - role="roles/pubsub.viewer", members=["group:cloud-logs@google.com"] - ) - new_policy = publisher.set_iam_policy(topic_path, topic_policy) - - # fetch the topic policy again and check its values - topic_policy = publisher.get_iam_policy(topic_path) - assert topic_policy.bindings == new_policy.bindings - assert len(topic_policy.bindings) == 2 - - bindings = sorted(topic_policy.bindings, key=op.attrgetter("role")) - assert bindings[0].role == "roles/pubsub.editor" - assert bindings[0].members == ["domain:google.com"] - - assert bindings[1].role == "roles/pubsub.viewer" - assert bindings[1].members == ["group:cloud-logs@google.com"] - - -def test_managing_subscription_iam_policy( - publisher, subscriber, topic_path, subscription_path, cleanup -): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # create a topic and a subscription, customize the latter's policy - publisher.create_topic(topic_path) - subscriber.create_subscription(subscription_path, topic_path) - sub_policy = subscriber.get_iam_policy(subscription_path) - - sub_policy.bindings.add(role="roles/pubsub.editor", members=["domain:google.com"]) - sub_policy.bindings.add( - role="roles/pubsub.viewer", members=["group:cloud-logs@google.com"] - ) - new_policy = subscriber.set_iam_policy(subscription_path, sub_policy) - - # fetch the subscription policy again and check its values - sub_policy = subscriber.get_iam_policy(subscription_path) - assert sub_policy.bindings == new_policy.bindings - assert len(sub_policy.bindings) == 2 - - bindings = sorted(sub_policy.bindings, key=op.attrgetter("role")) - assert bindings[0].role == "roles/pubsub.editor" - assert bindings[0].members == ["domain:google.com"] - - assert bindings[1].role == "roles/pubsub.viewer" - assert bindings[1].members == ["group:cloud-logs@google.com"] - - -class TestStreamingPull(object): - def test_streaming_pull_callback_error_propagation( - self, publisher, topic_path, subscriber, subscription_path, cleanup - ): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # create a topic and subscribe to it - publisher.create_topic(topic_path) - subscriber.create_subscription(subscription_path, topic_path) - - # publish a messages and wait until published - future = publisher.publish(topic_path, b"hello!") - future.result(timeout=30) - - # Now subscribe to the topic and verify that an error in the callback - # is propagated through the streaming pull future. - class CallbackError(Exception): - pass - - callback = mock.Mock(side_effect=CallbackError) - future = subscriber.subscribe(subscription_path, callback) - - with pytest.raises(CallbackError): - future.result(timeout=30) - - def test_streaming_pull_ack_deadline( - self, publisher, subscriber, project, topic_path, subscription_path, cleanup - ): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # Create a topic and a subscription, then subscribe to the topic. This - # must happen before the messages are published. - publisher.create_topic(topic_path) - - # Subscribe to the topic. This must happen before the messages - # are published. - subscriber.create_subscription( - subscription_path, topic_path, ack_deadline_seconds=45 - ) - - # publish some messages and wait for completion - self._publish_messages(publisher, topic_path, batch_sizes=[2]) - - # subscribe to the topic - callback = StreamingPullCallback( - processing_time=13, # more than the default stream ACK deadline (10s) - resolve_at_msg_count=3, # one more than the published messages count - ) - flow_control = types.FlowControl(max_messages=1) - subscription_future = subscriber.subscribe( - subscription_path, callback, flow_control=flow_control - ) - - # We expect to process the first two messages in 2 * 13 seconds, and - # any duplicate message that is re-sent by the backend in additional - # 13 seconds, totalling 39 seconds (+ overhead) --> if there have been - # no duplicates in 60 seconds, we can reasonably assume that there - # won't be any. - try: - callback.done_future.result(timeout=60) - except exceptions.TimeoutError: - # future timed out, because we received no excessive messages - assert sorted(callback.seen_message_ids) == [1, 2] - else: - pytest.fail( - "Expected to receive 2 messages, but got at least {}.".format( - len(callback.seen_message_ids) - ) - ) - finally: - subscription_future.cancel() - - def test_streaming_pull_max_messages( - self, publisher, topic_path, subscriber, subscription_path, cleanup - ): - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # create a topic and subscribe to it - publisher.create_topic(topic_path) - subscriber.create_subscription(subscription_path, topic_path) - - batch_sizes = (7, 4, 8, 2, 10, 1, 3, 8, 6, 1) # total: 50 - self._publish_messages(publisher, topic_path, batch_sizes=batch_sizes) - - # now subscribe and do the main part, check for max pending messages - total_messages = sum(batch_sizes) - flow_control = types.FlowControl(max_messages=5) - callback = StreamingPullCallback( - processing_time=1, resolve_at_msg_count=total_messages - ) - - subscription_future = subscriber.subscribe( - subscription_path, callback, flow_control=flow_control - ) - - # Expected time to process all messages in ideal case: - # (total_messages / FlowControl.max_messages) * processing_time - # - # With total=50, max messages=5, and processing_time=1 this amounts to - # 10 seconds (+ overhead), thus a full minute should be more than enough - # for the processing to complete. If not, fail the test with a timeout. - try: - callback.done_future.result(timeout=60) - except exceptions.TimeoutError: - pytest.fail( - "Timeout: receiving/processing streamed messages took too long." - ) - - # The callback future gets resolved once total_messages have been processed, - # but we want to wait for just a little bit longer to possibly catch cases - # when the callback gets invoked *more* than total_messages times. - time.sleep(3) - - try: - # All messages should have been processed exactly once, and no more - # than max_messages simultaneously at any time. - assert callback.completed_calls == total_messages - assert sorted(callback.seen_message_ids) == list( - range(1, total_messages + 1) - ) - assert callback.max_pending_ack <= flow_control.max_messages - finally: - subscription_future.cancel() # trigger clean shutdown - - @pytest.mark.skipif( - "KOKORO_GFILE_DIR" not in os.environ, - reason="Requires Kokoro environment with a limited subscriber service account.", - ) - def test_streaming_pull_subscriber_permissions_sufficient( - self, publisher, topic_path, subscriber, subscription_path, cleanup - ): - - # Make sure the topic and subscription get deleted. - cleanup.append((publisher.delete_topic, topic_path)) - cleanup.append((subscriber.delete_subscription, subscription_path)) - - # create a topic and subscribe to it - publisher.create_topic(topic_path) - subscriber.create_subscription(subscription_path, topic_path) - - # A service account granting only the pubsub.subscriber role must be used. - filename = os.path.join( - os.environ["KOKORO_GFILE_DIR"], "pubsub-subscriber-service-account.json" - ) - streaming_pull_subscriber = type(subscriber).from_service_account_file(filename) - - # Subscribe to the topic, publish a message, and verify that subscriber - # successfully pulls and processes it. - callback = StreamingPullCallback(processing_time=0.01, resolve_at_msg_count=1) - future = streaming_pull_subscriber.subscribe(subscription_path, callback) - self._publish_messages(publisher, topic_path, batch_sizes=[1]) - - try: - callback.done_future.result(timeout=10) - except exceptions.TimeoutError: - pytest.fail( - "Timeout: receiving/processing streamed messages took too long." - ) - else: - assert 1 in callback.seen_message_ids - finally: - future.cancel() - - def _publish_messages(self, publisher, topic_path, batch_sizes): - """Publish ``count`` messages in batches and wait until completion.""" - publish_futures = [] - msg_counter = itertools.count(start=1) - - for batch_size in batch_sizes: - msg_batch = self._make_messages(count=batch_size) - for msg in msg_batch: - future = publisher.publish( - topic_path, msg, seq_num=str(next(msg_counter)) - ) - publish_futures.append(future) - time.sleep(0.1) - - # wait untill all messages have been successfully published - for future in publish_futures: - future.result(timeout=30) - - def _make_messages(self, count): - messages = [ - u"message {}/{}".format(i, count).encode("utf-8") - for i in range(1, count + 1) - ] - return messages - - -class AckCallback(object): - def __init__(self): - self.calls = 0 - self.lock = threading.Lock() - - def __call__(self, message): - message.ack() - # Only increment the number of calls **after** finishing. - with self.lock: - self.calls += 1 - - -class TimesCallback(object): - def __init__(self, sleep_time): - self.sleep_time = sleep_time - self.calls = 0 - self.call_times = [] - self.lock = threading.Lock() - - def __call__(self, message): - now = datetime.datetime.now() - time.sleep(self.sleep_time) - message.ack() - # Only increment the number of calls **after** finishing. - with self.lock: - # list.append() is thread-safe, but we still wait until - # ``calls`` is incremented to do it. - self.call_times.append(now) - self.calls += 1 - - -class StreamingPullCallback(object): - def __init__(self, processing_time, resolve_at_msg_count): - self._lock = threading.Lock() - self._processing_time = processing_time - self._pending_ack = 0 - self.max_pending_ack = 0 - self.completed_calls = 0 - self.seen_message_ids = [] - - self._resolve_at_msg_count = resolve_at_msg_count - self.done_future = futures.Future() - - def __call__(self, message): - with self._lock: - self._pending_ack += 1 - self.max_pending_ack = max(self.max_pending_ack, self._pending_ack) - self.seen_message_ids.append(int(message.attributes["seq_num"])) - - time.sleep(self._processing_time) - - with self._lock: - self._pending_ack -= 1 - message.ack() - self.completed_calls += 1 - - if self.completed_calls >= self._resolve_at_msg_count: - if not self.done_future.done(): - self.done_future.set_result(None) diff --git a/pubsub/tests/system/gapic/v1/test_system_publisher_v1.py b/pubsub/tests/system/gapic/v1/test_system_publisher_v1.py deleted file mode 100644 index 9c0d2b33ad11..000000000000 --- a/pubsub/tests/system/gapic/v1/test_system_publisher_v1.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -import os -import time - -from google.cloud import pubsub_v1 -from google.cloud.pubsub_v1.proto import pubsub_pb2 - - -class TestSystemPublisher(object): - def test_list_topics(self): - project_id = os.environ["PROJECT_ID"] - - client = pubsub_v1.PublisherClient() - project = client.project_path(project_id) - response = client.list_topics(project) diff --git a/pubsub/tests/unit/__init__.py b/pubsub/tests/unit/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/pubsub/tests/unit/gapic/v1/test_publisher_client_v1.py b/pubsub/tests/unit/gapic/v1/test_publisher_client_v1.py deleted file mode 100644 index 6c64cf5a9ba2..000000000000 --- a/pubsub/tests/unit/gapic/v1/test_publisher_client_v1.py +++ /dev/null @@ -1,478 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud.pubsub_v1.gapic import publisher_client -from google.cloud.pubsub_v1.proto import pubsub_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestPublisherClient(object): - def test_create_topic(self): - # Setup Expected Response - name_2 = "name2-1052831874" - kms_key_name = "kmsKeyName2094986649" - expected_response = {"name": name_2, "kms_key_name": kms_key_name} - expected_response = pubsub_pb2.Topic(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - name = client.topic_path("[PROJECT]", "[TOPIC]") - - response = client.create_topic(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.Topic(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_topic_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - name = client.topic_path("[PROJECT]", "[TOPIC]") - - with pytest.raises(CustomException): - client.create_topic(name) - - def test_update_topic(self): - # Setup Expected Response - name = "name3373707" - kms_key_name = "kmsKeyName2094986649" - expected_response = {"name": name, "kms_key_name": kms_key_name} - expected_response = pubsub_pb2.Topic(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - topic = {} - update_mask = {} - - response = client.update_topic(topic, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.UpdateTopicRequest( - topic=topic, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_topic_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - topic = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_topic(topic, update_mask) - - def test_publish(self): - # Setup Expected Response - message_ids_element = "messageIdsElement-744837059" - message_ids = [message_ids_element] - expected_response = {"message_ids": message_ids} - expected_response = pubsub_pb2.PublishResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - data = b"-86" - messages_element = {"data": data} - messages = [messages_element] - - response = client.publish(topic, messages) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.PublishRequest(topic=topic, messages=messages) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_publish_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - data = b"-86" - messages_element = {"data": data} - messages = [messages_element] - - with pytest.raises(CustomException): - client.publish(topic, messages) - - def test_get_topic(self): - # Setup Expected Response - name = "name3373707" - kms_key_name = "kmsKeyName2094986649" - expected_response = {"name": name, "kms_key_name": kms_key_name} - expected_response = pubsub_pb2.Topic(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - response = client.get_topic(topic) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.GetTopicRequest(topic=topic) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_topic_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - with pytest.raises(CustomException): - client.get_topic(topic) - - def test_list_topics(self): - # Setup Expected Response - next_page_token = "" - topics_element = {} - topics = [topics_element] - expected_response = {"next_page_token": next_page_token, "topics": topics} - expected_response = pubsub_pb2.ListTopicsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_topics(project) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.topics[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ListTopicsRequest(project=project) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_topics_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_topics(project) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_list_topic_subscriptions(self): - # Setup Expected Response - next_page_token = "" - subscriptions_element = "subscriptionsElement1698708147" - subscriptions = [subscriptions_element] - expected_response = { - "next_page_token": next_page_token, - "subscriptions": subscriptions, - } - expected_response = pubsub_pb2.ListTopicSubscriptionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - paged_list_response = client.list_topic_subscriptions(topic) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.subscriptions[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ListTopicSubscriptionsRequest(topic=topic) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_topic_subscriptions_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - paged_list_response = client.list_topic_subscriptions(topic) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_topic(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - client.delete_topic(topic) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.DeleteTopicRequest(topic=topic) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_topic_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - with pytest.raises(CustomException): - client.delete_topic(topic) - - def test_set_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - policy = {} - - response = client.set_iam_policy(resource, policy) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.SetIamPolicyRequest( - resource=resource, policy=policy - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - policy = {} - - with pytest.raises(CustomException): - client.set_iam_policy(resource, policy) - - def test_get_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - - response = client.get_iam_policy(resource) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.GetIamPolicyRequest(resource=resource) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - - with pytest.raises(CustomException): - client.get_iam_policy(resource) - - def test_test_iam_permissions(self): - # Setup Expected Response - expected_response = {} - expected_response = iam_policy_pb2.TestIamPermissionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup Request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - permissions = [] - - response = client.test_iam_permissions(resource, permissions) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_test_iam_permissions_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = publisher_client.PublisherClient() - - # Setup request - resource = client.topic_path("[PROJECT]", "[TOPIC]") - permissions = [] - - with pytest.raises(CustomException): - client.test_iam_permissions(resource, permissions) diff --git a/pubsub/tests/unit/gapic/v1/test_subscriber_client_v1.py b/pubsub/tests/unit/gapic/v1/test_subscriber_client_v1.py deleted file mode 100644 index b1d7f52fad5f..000000000000 --- a/pubsub/tests/unit/gapic/v1/test_subscriber_client_v1.py +++ /dev/null @@ -1,843 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud.pubsub_v1.gapic import subscriber_client -from google.cloud.pubsub_v1.proto import pubsub_pb2 -from google.iam.v1 import iam_policy_pb2 -from google.iam.v1 import policy_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - def stream_stream( - self, method, request_serializer=None, response_deserializer=None - ): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestSubscriberClient(object): - def test_create_subscription(self): - # Setup Expected Response - name_2 = "name2-1052831874" - topic_2 = "topic2-1139259102" - ack_deadline_seconds = 2135351438 - retain_acked_messages = False - enable_message_ordering = True - expected_response = { - "name": name_2, - "topic": topic_2, - "ack_deadline_seconds": ack_deadline_seconds, - "retain_acked_messages": retain_acked_messages, - "enable_message_ordering": enable_message_ordering, - } - expected_response = pubsub_pb2.Subscription(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - name = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - response = client.create_subscription(name, topic) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.Subscription(name=name, topic=topic) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_subscription_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - name = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - topic = client.topic_path("[PROJECT]", "[TOPIC]") - - with pytest.raises(CustomException): - client.create_subscription(name, topic) - - def test_get_subscription(self): - # Setup Expected Response - name = "name3373707" - topic = "topic110546223" - ack_deadline_seconds = 2135351438 - retain_acked_messages = False - enable_message_ordering = True - expected_response = { - "name": name, - "topic": topic, - "ack_deadline_seconds": ack_deadline_seconds, - "retain_acked_messages": retain_acked_messages, - "enable_message_ordering": enable_message_ordering, - } - expected_response = pubsub_pb2.Subscription(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - response = client.get_subscription(subscription) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.GetSubscriptionRequest(subscription=subscription) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_subscription_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - with pytest.raises(CustomException): - client.get_subscription(subscription) - - def test_update_subscription(self): - # Setup Expected Response - name = "name3373707" - topic = "topic110546223" - ack_deadline_seconds_2 = 921632575 - retain_acked_messages = False - enable_message_ordering = True - expected_response = { - "name": name, - "topic": topic, - "ack_deadline_seconds": ack_deadline_seconds_2, - "retain_acked_messages": retain_acked_messages, - "enable_message_ordering": enable_message_ordering, - } - expected_response = pubsub_pb2.Subscription(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - ack_deadline_seconds = 42 - subscription = {"ack_deadline_seconds": ack_deadline_seconds} - paths_element = "ack_deadline_seconds" - paths = [paths_element] - update_mask = {"paths": paths} - - response = client.update_subscription(subscription, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.UpdateSubscriptionRequest( - subscription=subscription, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_subscription_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - ack_deadline_seconds = 42 - subscription = {"ack_deadline_seconds": ack_deadline_seconds} - paths_element = "ack_deadline_seconds" - paths = [paths_element] - update_mask = {"paths": paths} - - with pytest.raises(CustomException): - client.update_subscription(subscription, update_mask) - - def test_list_subscriptions(self): - # Setup Expected Response - next_page_token = "" - subscriptions_element = {} - subscriptions = [subscriptions_element] - expected_response = { - "next_page_token": next_page_token, - "subscriptions": subscriptions, - } - expected_response = pubsub_pb2.ListSubscriptionsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_subscriptions(project) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.subscriptions[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ListSubscriptionsRequest(project=project) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_subscriptions_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_subscriptions(project) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_delete_subscription(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - client.delete_subscription(subscription) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.DeleteSubscriptionRequest( - subscription=subscription - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_subscription_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - with pytest.raises(CustomException): - client.delete_subscription(subscription) - - def test_modify_ack_deadline(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - ack_ids = [] - ack_deadline_seconds = 2135351438 - - client.modify_ack_deadline(subscription, ack_ids, ack_deadline_seconds) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ModifyAckDeadlineRequest( - subscription=subscription, - ack_ids=ack_ids, - ack_deadline_seconds=ack_deadline_seconds, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_modify_ack_deadline_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - ack_ids = [] - ack_deadline_seconds = 2135351438 - - with pytest.raises(CustomException): - client.modify_ack_deadline(subscription, ack_ids, ack_deadline_seconds) - - def test_acknowledge(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - ack_ids = [] - - client.acknowledge(subscription, ack_ids) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.AcknowledgeRequest( - subscription=subscription, ack_ids=ack_ids - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_acknowledge_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - ack_ids = [] - - with pytest.raises(CustomException): - client.acknowledge(subscription, ack_ids) - - def test_pull(self): - # Setup Expected Response - expected_response = {} - expected_response = pubsub_pb2.PullResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - max_messages = 496131527 - - response = client.pull(subscription, max_messages) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.PullRequest( - subscription=subscription, max_messages=max_messages - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_pull_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - max_messages = 496131527 - - with pytest.raises(CustomException): - client.pull(subscription, max_messages) - - def test_streaming_pull(self): - # Setup Expected Response - received_messages_element = {} - received_messages = [received_messages_element] - expected_response = {"received_messages": received_messages} - expected_response = pubsub_pb2.StreamingPullResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - stream_ack_deadline_seconds = 1875467245 - request = { - "subscription": subscription, - "stream_ack_deadline_seconds": stream_ack_deadline_seconds, - } - request = pubsub_pb2.StreamingPullRequest(**request) - requests = [request] - - response = client.streaming_pull(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] - - assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request - - def test_streaming_pull_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - stream_ack_deadline_seconds = 1875467245 - request = { - "subscription": subscription, - "stream_ack_deadline_seconds": stream_ack_deadline_seconds, - } - - request = pubsub_pb2.StreamingPullRequest(**request) - requests = [request] - - with pytest.raises(CustomException): - client.streaming_pull(requests) - - def test_modify_push_config(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - push_config = {} - - client.modify_push_config(subscription, push_config) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ModifyPushConfigRequest( - subscription=subscription, push_config=push_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_modify_push_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - push_config = {} - - with pytest.raises(CustomException): - client.modify_push_config(subscription, push_config) - - def test_list_snapshots(self): - # Setup Expected Response - next_page_token = "" - snapshots_element = {} - snapshots = [snapshots_element] - expected_response = {"next_page_token": next_page_token, "snapshots": snapshots} - expected_response = pubsub_pb2.ListSnapshotsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_snapshots(project) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.snapshots[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.ListSnapshotsRequest(project=project) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_snapshots_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - project = client.project_path("[PROJECT]") - - paged_list_response = client.list_snapshots(project) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_create_snapshot(self): - # Setup Expected Response - name_2 = "name2-1052831874" - topic = "topic110546223" - expected_response = {"name": name_2, "topic": topic} - expected_response = pubsub_pb2.Snapshot(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - name = client.snapshot_path("[PROJECT]", "[SNAPSHOT]") - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - response = client.create_snapshot(name, subscription) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.CreateSnapshotRequest( - name=name, subscription=subscription - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_snapshot_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - name = client.snapshot_path("[PROJECT]", "[SNAPSHOT]") - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - with pytest.raises(CustomException): - client.create_snapshot(name, subscription) - - def test_update_snapshot(self): - # Setup Expected Response - name = "name3373707" - topic = "topic110546223" - expected_response = {"name": name, "topic": topic} - expected_response = pubsub_pb2.Snapshot(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - seconds = 123456 - expire_time = {"seconds": seconds} - snapshot = {"expire_time": expire_time} - paths_element = "expire_time" - paths = [paths_element] - update_mask = {"paths": paths} - - response = client.update_snapshot(snapshot, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.UpdateSnapshotRequest( - snapshot=snapshot, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_snapshot_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - seconds = 123456 - expire_time = {"seconds": seconds} - snapshot = {"expire_time": expire_time} - paths_element = "expire_time" - paths = [paths_element] - update_mask = {"paths": paths} - - with pytest.raises(CustomException): - client.update_snapshot(snapshot, update_mask) - - def test_delete_snapshot(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - snapshot = client.snapshot_path("[PROJECT]", "[SNAPSHOT]") - - client.delete_snapshot(snapshot) - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.DeleteSnapshotRequest(snapshot=snapshot) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_snapshot_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - snapshot = client.snapshot_path("[PROJECT]", "[SNAPSHOT]") - - with pytest.raises(CustomException): - client.delete_snapshot(snapshot) - - def test_seek(self): - # Setup Expected Response - expected_response = {} - expected_response = pubsub_pb2.SeekResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - response = client.seek(subscription) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = pubsub_pb2.SeekRequest(subscription=subscription) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_seek_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - subscription = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - with pytest.raises(CustomException): - client.seek(subscription) - - def test_set_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - policy = {} - - response = client.set_iam_policy(resource, policy) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.SetIamPolicyRequest( - resource=resource, policy=policy - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_set_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - policy = {} - - with pytest.raises(CustomException): - client.set_iam_policy(resource, policy) - - def test_get_iam_policy(self): - # Setup Expected Response - version = 351608024 - etag = b"21" - expected_response = {"version": version, "etag": etag} - expected_response = policy_pb2.Policy(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - response = client.get_iam_policy(resource) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.GetIamPolicyRequest(resource=resource) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_iam_policy_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - - with pytest.raises(CustomException): - client.get_iam_policy(resource) - - def test_test_iam_permissions(self): - # Setup Expected Response - expected_response = {} - expected_response = iam_policy_pb2.TestIamPermissionsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup Request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - permissions = [] - - response = client.test_iam_permissions(resource, permissions) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_test_iam_permissions_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = subscriber_client.SubscriberClient() - - # Setup request - resource = client.subscription_path("[PROJECT]", "[SUBSCRIPTION]") - permissions = [] - - with pytest.raises(CustomException): - client.test_iam_permissions(resource, permissions) diff --git a/pubsub/tests/unit/pubsub_v1/publisher/batch/test_base.py b/pubsub/tests/unit/pubsub_v1/publisher/batch/test_base.py deleted file mode 100644 index b19a5a1f1504..000000000000 --- a/pubsub/tests/unit/pubsub_v1/publisher/batch/test_base.py +++ /dev/null @@ -1,78 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import mock - -from google.auth import credentials -from google.cloud.pubsub_v1 import publisher -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.publisher._batch.base import BatchStatus -from google.cloud.pubsub_v1.publisher._batch.thread import Batch - - -def create_batch(status=None, settings=types.BatchSettings()): - """Create a batch object, which does not commit. - - Args: - status (str): If provided, the batch's internal status will be set - to the provided status. - - Returns: - ~.pubsub_v1.publisher.batch.thread.Batch: The batch object - """ - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - batch = Batch(client, "topic_name", settings, autocommit=False) - if status: - batch._status = status - return batch - - -def test_len(): - batch = create_batch(status=BatchStatus.ACCEPTING_MESSAGES) - assert len(batch) == 0 - batch.publish(types.PubsubMessage(data=b"foo")) - assert len(batch) == 1 - - -def test_will_accept(): - batch = create_batch(status=BatchStatus.ACCEPTING_MESSAGES) - message = types.PubsubMessage() - assert batch.will_accept(message) is True - - -def test_will_accept_oversize(): - batch = create_batch( - settings=types.BatchSettings(max_bytes=10), - status=BatchStatus.ACCEPTING_MESSAGES, - ) - message = types.PubsubMessage(data=b"abcdefghijklmnopqrstuvwxyz") - assert batch.will_accept(message) is True - - -def test_will_not_accept_status(): - batch = create_batch(status="talk to the hand") - message = types.PubsubMessage() - assert batch.will_accept(message) is False - - -def test_will_not_accept_number(): - batch = create_batch( - settings=types.BatchSettings(max_messages=-1), - status=BatchStatus.ACCEPTING_MESSAGES, - ) - message = types.PubsubMessage(data=b"abc") - assert batch.will_accept(message) is False diff --git a/pubsub/tests/unit/pubsub_v1/publisher/batch/test_thread.py b/pubsub/tests/unit/pubsub_v1/publisher/batch/test_thread.py deleted file mode 100644 index f51b314af6df..000000000000 --- a/pubsub/tests/unit/pubsub_v1/publisher/batch/test_thread.py +++ /dev/null @@ -1,421 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -import datetime -import threading -import time - -import mock -import pytest - -import google.api_core.exceptions -from google.auth import credentials -from google.cloud.pubsub_v1 import publisher -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.publisher import exceptions -from google.cloud.pubsub_v1.publisher._batch.base import BatchStatus -from google.cloud.pubsub_v1.publisher._batch import thread -from google.cloud.pubsub_v1.publisher._batch.thread import Batch - - -def create_client(): - creds = mock.Mock(spec=credentials.Credentials) - return publisher.Client(credentials=creds) - - -def create_batch(autocommit=False, topic="topic_name", **batch_settings): - """Return a batch object suitable for testing. - - Args: - autocommit (bool): Whether the batch should commit after - ``max_latency`` seconds. By default, this is ``False`` - for unit testing. - topic (str): The name of the topic the batch should publish - the messages to. - batch_settings (dict): Arguments passed on to the - :class:``~.pubsub_v1.types.BatchSettings`` constructor. - - Returns: - ~.pubsub_v1.publisher.batch.thread.Batch: A batch object. - """ - client = create_client() - settings = types.BatchSettings(**batch_settings) - return Batch(client, topic, settings, autocommit=autocommit) - - -def test_init(): - """Establish that a monitor thread is usually created on init.""" - client = create_client() - - # Do not actually create a thread, but do verify that one was created; - # it should be running the batch's "monitor" method (which commits the - # batch once time elapses). - with mock.patch.object(threading, "Thread", autospec=True) as Thread: - batch = Batch(client, "topic_name", types.BatchSettings()) - Thread.assert_called_once_with( - name="Thread-MonitorBatchPublisher", target=batch.monitor - ) - - # New batches start able to accept messages by default. - assert batch.status == BatchStatus.ACCEPTING_MESSAGES - - -def test_init_infinite_latency(): - batch = create_batch(max_latency=float("inf")) - assert batch._thread is None - - -@mock.patch.object(threading, "Lock") -def test_make_lock(Lock): - lock = Batch.make_lock() - assert lock is Lock.return_value - Lock.assert_called_once_with() - - -def test_client(): - client = create_client() - settings = types.BatchSettings() - batch = Batch(client, "topic_name", settings, autocommit=False) - assert batch.client is client - - -def test_commit(): - batch = create_batch() - with mock.patch.object(threading, "Thread", autospec=True) as Thread: - batch.commit() - - # A thread should have been created to do the actual commit. - Thread.assert_called_once_with( - name="Thread-CommitBatchPublisher", target=batch._commit - ) - Thread.return_value.start.assert_called_once_with() - - # The batch's status needs to be something other than "accepting messages", - # since the commit started. - assert batch.status != BatchStatus.ACCEPTING_MESSAGES - assert batch.status == BatchStatus.STARTING - - -def test_commit_no_op(): - batch = create_batch() - batch._status = BatchStatus.IN_PROGRESS - with mock.patch.object(threading, "Thread", autospec=True) as Thread: - batch.commit() - - # Make sure a thread was not created. - Thread.assert_not_called() - - # Check that batch status is unchanged. - assert batch.status == BatchStatus.IN_PROGRESS - - -def test_blocking__commit(): - batch = create_batch() - futures = ( - batch.publish({"data": b"This is my message."}), - batch.publish({"data": b"This is another message."}), - ) - - # Set up the underlying API publish method to return a PublishResponse. - publish_response = types.PublishResponse(message_ids=["a", "b"]) - patch = mock.patch.object( - type(batch.client.api), "publish", return_value=publish_response - ) - with patch as publish: - batch._commit() - - # Establish that the underlying API call was made with expected - # arguments. - publish.assert_called_once_with( - "topic_name", - [ - types.PubsubMessage(data=b"This is my message."), - types.PubsubMessage(data=b"This is another message."), - ], - ) - - # Establish that all of the futures are done, and that they have the - # expected values. - assert futures[0].done() - assert futures[0].result() == "a" - assert futures[1].done() - assert futures[1].result() == "b" - - -def test_client_api_publish_not_blocking_additional_publish_calls(): - batch = create_batch(max_messages=1) - api_publish_called = threading.Event() - - def api_publish_delay(_, messages): - api_publish_called.set() - time.sleep(1.0) - message_ids = [str(i) for i in range(len(messages))] - return types.PublishResponse(message_ids=message_ids) - - api_publish_patch = mock.patch.object( - type(batch.client.api), "publish", side_effect=api_publish_delay - ) - - with api_publish_patch: - batch.publish({"data": b"first message"}) - - start = datetime.datetime.now() - event_set = api_publish_called.wait(timeout=1.0) - if not event_set: - pytest.fail("API publish was not called in time") - batch.publish({"data": b"second message"}) - end = datetime.datetime.now() - - # While a batch commit in progress, waiting for the API publish call to - # complete should not unnecessariliy delay other calls to batch.publish(). - assert (end - start).total_seconds() < 1.0 - - -@mock.patch.object(thread, "_LOGGER") -def test_blocking__commit_starting(_LOGGER): - batch = create_batch() - batch._status = BatchStatus.STARTING - - batch._commit() - assert batch._status == BatchStatus.SUCCESS - - _LOGGER.debug.assert_called_once_with("No messages to publish, exiting commit") - - -@mock.patch.object(thread, "_LOGGER") -def test_blocking__commit_already_started(_LOGGER): - batch = create_batch() - batch._status = BatchStatus.IN_PROGRESS - - batch._commit() - assert batch._status == BatchStatus.IN_PROGRESS - - _LOGGER.debug.assert_called_once_with( - "Batch is already in progress, exiting commit" - ) - - -def test_blocking__commit_no_messages(): - batch = create_batch() - with mock.patch.object(type(batch.client.api), "publish") as publish: - batch._commit() - - assert publish.call_count == 0 - - -def test_blocking__commit_wrong_messageid_length(): - batch = create_batch() - futures = ( - batch.publish({"data": b"blah blah blah"}), - batch.publish({"data": b"blah blah blah blah"}), - ) - - # Set up a PublishResponse that only returns one message ID. - publish_response = types.PublishResponse(message_ids=["a"]) - patch = mock.patch.object( - type(batch.client.api), "publish", return_value=publish_response - ) - - with patch: - batch._commit() - - for future in futures: - assert future.done() - assert isinstance(future.exception(), exceptions.PublishError) - - -def test_block__commmit_api_error(): - batch = create_batch() - futures = ( - batch.publish({"data": b"blah blah blah"}), - batch.publish({"data": b"blah blah blah blah"}), - ) - - # Make the API throw an error when publishing. - error = google.api_core.exceptions.InternalServerError("uh oh") - patch = mock.patch.object(type(batch.client.api), "publish", side_effect=error) - - with patch: - batch._commit() - - for future in futures: - assert future.done() - assert future.exception() == error - - -def test_block__commmit_retry_error(): - batch = create_batch() - futures = ( - batch.publish({"data": b"blah blah blah"}), - batch.publish({"data": b"blah blah blah blah"}), - ) - - # Make the API throw an error when publishing. - error = google.api_core.exceptions.RetryError("uh oh", None) - patch = mock.patch.object(type(batch.client.api), "publish", side_effect=error) - - with patch: - batch._commit() - - for future in futures: - assert future.done() - assert future.exception() == error - - -def test_monitor(): - batch = create_batch(max_latency=5.0) - with mock.patch.object(time, "sleep") as sleep: - with mock.patch.object(type(batch), "_commit") as _commit: - batch.monitor() - - # The monitor should have waited the given latency. - sleep.assert_called_once_with(5.0) - - # Since `monitor` runs in its own thread, it should call - # the blocking commit implementation. - _commit.assert_called_once_with() - - -def test_monitor_already_committed(): - batch = create_batch(max_latency=5.0) - status = "something else" - batch._status = status - with mock.patch.object(time, "sleep") as sleep: - batch.monitor() - - # The monitor should have waited the given latency. - sleep.assert_called_once_with(5.0) - - # The status should not have changed. - assert batch._status == status - - -def test_publish_updating_batch_size(): - batch = create_batch(topic="topic_foo") - messages = ( - types.PubsubMessage(data=b"foobarbaz"), - types.PubsubMessage(data=b"spameggs"), - types.PubsubMessage(data=b"1335020400"), - ) - - # Publish each of the messages, which should save them to the batch. - futures = [batch.publish(message) for message in messages] - - # There should be three messages on the batch, and three futures. - assert len(batch.messages) == 3 - assert batch._futures == futures - - # The size should have been incremented by the sum of the size - # contributions of each message to the PublishRequest. - base_request_size = types.PublishRequest(topic="topic_foo").ByteSize() - expected_request_size = base_request_size + sum( - types.PublishRequest(messages=[msg]).ByteSize() for msg in messages - ) - - assert batch.size == expected_request_size - assert batch.size > 0 # I do not always trust protobuf. - - -def test_publish_not_will_accept(): - batch = create_batch(topic="topic_foo", max_messages=0) - base_request_size = types.PublishRequest(topic="topic_foo").ByteSize() - - # Publish the message. - message = types.PubsubMessage(data=b"foobarbaz") - future = batch.publish(message) - - assert future is None - assert batch.size == base_request_size - assert batch.messages == [] - assert batch._futures == [] - - -def test_publish_exceed_max_messages(): - max_messages = 4 - batch = create_batch(max_messages=max_messages) - messages = ( - types.PubsubMessage(data=b"foobarbaz"), - types.PubsubMessage(data=b"spameggs"), - types.PubsubMessage(data=b"1335020400"), - ) - - # Publish each of the messages, which should save them to the batch. - with mock.patch.object(batch, "commit") as commit: - futures = [batch.publish(message) for message in messages] - assert batch._futures == futures - assert len(futures) == max_messages - 1 - - # Commit should not yet have been called. - assert commit.call_count == 0 - - # When a fourth message is published, commit should be called. - # No future will be returned in this case. - future = batch.publish(types.PubsubMessage(data=b"last one")) - commit.assert_called_once_with() - - assert future is None - assert batch._futures == futures - - -@mock.patch.object(thread, "_SERVER_PUBLISH_MAX_BYTES", 1000) -def test_publish_single_message_size_exceeds_server_size_limit(): - batch = create_batch( - topic="topic_foo", - max_messages=1000, - max_bytes=1000 * 1000, # way larger than (mocked) server side limit - ) - - big_message = types.PubsubMessage(data=b"x" * 984) - - request_size = types.PublishRequest( - topic="topic_foo", messages=[big_message] - ).ByteSize() - assert request_size == 1001 # sanity check, just above the (mocked) server limit - - with pytest.raises(exceptions.MessageTooLargeError): - batch.publish(big_message) - - -@mock.patch.object(thread, "_SERVER_PUBLISH_MAX_BYTES", 1000) -def test_publish_total_messages_size_exceeds_server_size_limit(): - batch = create_batch(topic="topic_foo", max_messages=10, max_bytes=1500) - - messages = ( - types.PubsubMessage(data=b"x" * 500), - types.PubsubMessage(data=b"x" * 600), - ) - - # Sanity check - request size is still below BatchSettings.max_bytes, - # but it exceeds the server-side size limit. - request_size = types.PublishRequest(topic="topic_foo", messages=messages).ByteSize() - assert 1000 < request_size < 1500 - - with mock.patch.object(batch, "commit") as fake_commit: - batch.publish(messages[0]) - batch.publish(messages[1]) - - # The server side limit should kick in and cause a commit. - fake_commit.assert_called_once() - - -def test_publish_dict(): - batch = create_batch() - future = batch.publish({"data": b"foobarbaz", "attributes": {"spam": "eggs"}}) - - # There should be one message on the batch. - expected_message = types.PubsubMessage( - data=b"foobarbaz", attributes={"spam": "eggs"} - ) - assert batch.messages == [expected_message] - assert batch._futures == [future] diff --git a/pubsub/tests/unit/pubsub_v1/publisher/test_futures_publisher.py b/pubsub/tests/unit/pubsub_v1/publisher/test_futures_publisher.py deleted file mode 100644 index eb32d05185b6..000000000000 --- a/pubsub/tests/unit/pubsub_v1/publisher/test_futures_publisher.py +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright 2019, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import pytest - -from google.cloud.pubsub_v1.publisher import futures - - -class TestFuture(object): - def test_result_on_success(self): - future = futures.Future() - future.set_result("570307942214048") - assert future.result() == "570307942214048" - - def test_result_on_failure(self): - future = futures.Future() - future.set_exception(RuntimeError("Something bad happened.")) - with pytest.raises(RuntimeError): - future.result() diff --git a/pubsub/tests/unit/pubsub_v1/publisher/test_publisher_client.py b/pubsub/tests/unit/pubsub_v1/publisher/test_publisher_client.py deleted file mode 100644 index a06d2d0cf697..000000000000 --- a/pubsub/tests/unit/pubsub_v1/publisher/test_publisher_client.py +++ /dev/null @@ -1,267 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.auth import credentials - -import mock -import pytest - -from google.cloud.pubsub_v1.gapic import publisher_client -from google.cloud.pubsub_v1 import publisher -from google.cloud.pubsub_v1 import types - - -def test_init(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - # A plain client should have an `api` (the underlying GAPIC) and a - # batch settings object, which should have the defaults. - assert isinstance(client.api, publisher_client.PublisherClient) - assert client.batch_settings.max_bytes == 1 * 1000 * 1000 - assert client.batch_settings.max_latency == 0.01 - assert client.batch_settings.max_messages == 100 - - -def test_init_w_custom_transport(): - transport = object() - client = publisher.Client(transport=transport) - - # A plain client should have an `api` (the underlying GAPIC) and a - # batch settings object, which should have the defaults. - assert isinstance(client.api, publisher_client.PublisherClient) - assert client.api.transport is transport - assert client.batch_settings.max_bytes == 1 * 1000 * 1000 - assert client.batch_settings.max_latency == 0.01 - assert client.batch_settings.max_messages == 100 - - -def test_init_emulator(monkeypatch): - monkeypatch.setenv("PUBSUB_EMULATOR_HOST", "/foo/bar/") - # NOTE: When the emulator host is set, a custom channel will be used, so - # no credentials (mock ot otherwise) can be passed in. - client = publisher.Client() - - # Establish that a gRPC request would attempt to hit the emulator host. - # - # Sadly, there seems to be no good way to do this without poking at - # the private API of gRPC. - channel = client.api.transport.publish._channel - assert channel.target().decode("utf8") == "/foo/bar/" - - -def test_batch_create(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - assert len(client._batches) == 0 - topic = "topic/path" - batch = client._batch(topic, autocommit=False) - assert client._batches == {topic: batch} - - -def test_batch_exists(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - topic = "topic/path" - client._batches[topic] = mock.sentinel.batch - - # A subsequent request should return the same batch. - batch = client._batch(topic, autocommit=False) - assert batch is mock.sentinel.batch - assert client._batches == {topic: batch} - - -def test_batch_create_and_exists(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - topic = "topic/path" - client._batches[topic] = mock.sentinel.batch - - # A subsequent request should return the same batch. - batch = client._batch(topic, create=True, autocommit=False) - assert batch is not mock.sentinel.batch - assert client._batches == {topic: batch} - - -def test_publish(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - # Use a mock in lieu of the actual batch class. - batch = mock.Mock(spec=client._batch_class) - # Set the mock up to claim indiscriminately that it accepts all messages. - batch.will_accept.return_value = True - batch.publish.side_effect = (mock.sentinel.future1, mock.sentinel.future2) - - topic = "topic/path" - client._batches[topic] = batch - - # Begin publishing. - future1 = client.publish(topic, b"spam") - future2 = client.publish(topic, b"foo", bar="baz") - - assert future1 is mock.sentinel.future1 - assert future2 is mock.sentinel.future2 - - # Check mock. - batch.publish.assert_has_calls( - [ - mock.call(types.PubsubMessage(data=b"spam")), - mock.call(types.PubsubMessage(data=b"foo", attributes={"bar": "baz"})), - ] - ) - - -def test_publish_data_not_bytestring_error(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - topic = "topic/path" - with pytest.raises(TypeError): - client.publish(topic, u"This is a text string.") - with pytest.raises(TypeError): - client.publish(topic, 42) - - -def test_publish_attrs_bytestring(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - # Use a mock in lieu of the actual batch class. - batch = mock.Mock(spec=client._batch_class) - # Set the mock up to claim indiscriminately that it accepts all messages. - batch.will_accept.return_value = True - - topic = "topic/path" - client._batches[topic] = batch - - # Begin publishing. - future = client.publish(topic, b"foo", bar=b"baz") - - assert future is batch.publish.return_value - - # The attributes should have been sent as text. - batch.publish.assert_called_once_with( - types.PubsubMessage(data=b"foo", attributes={"bar": u"baz"}) - ) - - -def test_publish_new_batch_needed(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - # Use mocks in lieu of the actual batch class. - batch1 = mock.Mock(spec=client._batch_class) - batch2 = mock.Mock(spec=client._batch_class) - # Set the first mock up to claim indiscriminately that it rejects all - # messages and the second accepts all. - batch1.publish.return_value = None - batch2.publish.return_value = mock.sentinel.future - - topic = "topic/path" - client._batches[topic] = batch1 - - # Actually mock the batch class now. - batch_class = mock.Mock(spec=(), return_value=batch2) - client._batch_class = batch_class - - # Publish a message. - future = client.publish(topic, b"foo", bar=b"baz") - assert future is mock.sentinel.future - - # Check the mocks. - batch_class.assert_called_once_with( - autocommit=True, client=client, settings=client.batch_settings, topic=topic - ) - message_pb = types.PubsubMessage(data=b"foo", attributes={"bar": u"baz"}) - batch1.publish.assert_called_once_with(message_pb) - batch2.publish.assert_called_once_with(message_pb) - - -def test_publish_attrs_type_error(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - topic = "topic/path" - with pytest.raises(TypeError): - client.publish(topic, b"foo", answer=42) - - -def test_stop(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - batch = client._batch("topic1", autocommit=False) - batch2 = client._batch("topic2", autocommit=False) - - pubsub_msg = types.PubsubMessage(data=b"msg") - - patch = mock.patch.object(batch, "commit") - patch2 = mock.patch.object(batch2, "commit") - - with patch as commit_mock, patch2 as commit_mock2: - batch.publish(pubsub_msg) - batch2.publish(pubsub_msg) - - client.stop() - - # check if commit() called - commit_mock.assert_called() - commit_mock2.assert_called() - - # check that closed publisher doesn't accept new messages - with pytest.raises(RuntimeError): - client.publish("topic1", b"msg2") - - with pytest.raises(RuntimeError): - client.stop() - - -def test_gapic_instance_method(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - - ct = mock.Mock() - client.api._inner_api_calls["create_topic"] = ct - - client.create_topic("projects/foo/topics/bar") - assert ct.call_count == 1 - _, args, _ = ct.mock_calls[0] - assert args[0] == types.Topic(name="projects/foo/topics/bar") - - -def test_gapic_class_method_on_class(): - answer = publisher.Client.topic_path("foo", "bar") - assert answer == "projects/foo/topics/bar" - - -def test_class_method_factory(): - patch = mock.patch( - "google.oauth2.service_account.Credentials.from_service_account_file" - ) - - with patch: - client = publisher.Client.from_service_account_file("filename.json") - - assert isinstance(client, publisher.Client) - - -def test_gapic_class_method_on_instance(): - creds = mock.Mock(spec=credentials.Credentials) - client = publisher.Client(credentials=creds) - answer = client.topic_path("foo", "bar") - assert answer == "projects/foo/topics/bar" diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_dispatcher.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_dispatcher.py deleted file mode 100644 index 592a03c6422c..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_dispatcher.py +++ /dev/null @@ -1,261 +0,0 @@ -# Copyright 2017, 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. - -import collections -import threading - -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber._protocol import dispatcher -from google.cloud.pubsub_v1.subscriber._protocol import helper_threads -from google.cloud.pubsub_v1.subscriber._protocol import requests -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager - -import mock -from six.moves import queue -import pytest - - -@pytest.mark.parametrize( - "item,method_name", - [ - (requests.AckRequest(0, 0, 0), "ack"), - (requests.DropRequest(0, 0), "drop"), - (requests.LeaseRequest(0, 0), "lease"), - (requests.ModAckRequest(0, 0), "modify_ack_deadline"), - (requests.NackRequest(0, 0), "nack"), - ], -) -def test_dispatch_callback(item, method_name): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [item] - - with mock.patch.object(dispatcher_, method_name) as method: - dispatcher_.dispatch_callback(items) - - method.assert_called_once_with([item]) - - -def test_dispatch_callback_inactive(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - manager.is_active = False - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - dispatcher_.dispatch_callback([requests.AckRequest(0, 0, 0)]) - - manager.send.assert_not_called() - - -def test_ack(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.AckRequest(ack_id="ack_id_string", byte_size=0, time_to_ack=20)] - dispatcher_.ack(items) - - manager.send.assert_called_once_with( - types.StreamingPullRequest(ack_ids=["ack_id_string"]) - ) - - manager.leaser.remove.assert_called_once_with(items) - manager.maybe_resume_consumer.assert_called_once() - manager.ack_histogram.add.assert_called_once_with(20) - - -def test_ack_no_time(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.AckRequest(ack_id="ack_id_string", byte_size=0, time_to_ack=None)] - dispatcher_.ack(items) - - manager.send.assert_called_once_with( - types.StreamingPullRequest(ack_ids=["ack_id_string"]) - ) - - manager.ack_histogram.add.assert_not_called() - - -def test_ack_splitting_large_payload(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [ - # use realistic lengths for ACK IDs (max 176 bytes) - requests.AckRequest(ack_id=str(i).zfill(176), byte_size=0, time_to_ack=20) - for i in range(5001) - ] - dispatcher_.ack(items) - - calls = manager.send.call_args_list - assert len(calls) == 3 - - all_ack_ids = {item.ack_id for item in items} - sent_ack_ids = collections.Counter() - - for call in calls: - message = call.args[0] - assert message.ByteSize() <= 524288 # server-side limit (2**19) - sent_ack_ids.update(message.ack_ids) - - assert set(sent_ack_ids) == all_ack_ids # all messages should have been ACK-ed - assert sent_ack_ids.most_common(1)[0][1] == 1 # each message ACK-ed exactly once - - -def test_lease(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.LeaseRequest(ack_id="ack_id_string", byte_size=10)] - dispatcher_.lease(items) - - manager.leaser.add.assert_called_once_with(items) - manager.maybe_pause_consumer.assert_called_once() - - -def test_drop(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.DropRequest(ack_id="ack_id_string", byte_size=10)] - dispatcher_.drop(items) - - manager.leaser.remove.assert_called_once_with(items) - manager.maybe_resume_consumer.assert_called_once() - - -def test_nack(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.NackRequest(ack_id="ack_id_string", byte_size=10)] - dispatcher_.nack(items) - - manager.send.assert_called_once_with( - types.StreamingPullRequest( - modify_deadline_ack_ids=["ack_id_string"], modify_deadline_seconds=[0] - ) - ) - - -def test_modify_ack_deadline(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [requests.ModAckRequest(ack_id="ack_id_string", seconds=60)] - dispatcher_.modify_ack_deadline(items) - - manager.send.assert_called_once_with( - types.StreamingPullRequest( - modify_deadline_ack_ids=["ack_id_string"], modify_deadline_seconds=[60] - ) - ) - - -def test_modify_ack_deadline_splitting_large_payload(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - items = [ - # use realistic lengths for ACK IDs (max 176 bytes) - requests.ModAckRequest(ack_id=str(i).zfill(176), seconds=60) - for i in range(5001) - ] - dispatcher_.modify_ack_deadline(items) - - calls = manager.send.call_args_list - assert len(calls) == 3 - - all_ack_ids = {item.ack_id for item in items} - sent_ack_ids = collections.Counter() - - for call in calls: - message = call.args[0] - assert message.ByteSize() <= 524288 # server-side limit (2**19) - sent_ack_ids.update(message.modify_deadline_ack_ids) - - assert set(sent_ack_ids) == all_ack_ids # all messages should have been MODACK-ed - assert sent_ack_ids.most_common(1)[0][1] == 1 # each message MODACK-ed exactly once - - -@mock.patch("threading.Thread", autospec=True) -def test_start(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - - dispatcher_.start() - - thread.assert_called_once_with( - name=dispatcher._CALLBACK_WORKER_NAME, target=mock.ANY - ) - - thread.return_value.start.assert_called_once() - - assert dispatcher_._thread is not None - - -@mock.patch("threading.Thread", autospec=True) -def test_start_already_started(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - dispatcher_ = dispatcher.Dispatcher(manager, mock.sentinel.queue) - dispatcher_._thread = mock.sentinel.thread - - with pytest.raises(ValueError): - dispatcher_.start() - - thread.assert_not_called() - - -def test_stop(): - queue_ = queue.Queue() - dispatcher_ = dispatcher.Dispatcher(mock.sentinel.manager, queue_) - thread = mock.create_autospec(threading.Thread, instance=True) - dispatcher_._thread = thread - - dispatcher_.stop() - - assert queue_.get() is helper_threads.STOP - thread.join.assert_called_once() - assert dispatcher_._thread is None - - -def test_stop_no_join(): - dispatcher_ = dispatcher.Dispatcher(mock.sentinel.manager, mock.sentinel.queue) - - dispatcher_.stop() diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_futures_subscriber.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_futures_subscriber.py deleted file mode 100644 index 2b4566018f7f..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_futures_subscriber.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import mock -import pytest - -from google.cloud.pubsub_v1.subscriber import futures -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager - - -class TestStreamingPullFuture(object): - def make_future(self): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - future = futures.StreamingPullFuture(manager) - return future - - def test_default_state(self): - future = self.make_future() - - assert future.running() - assert not future.done() - assert not future.cancelled() - future._manager.add_close_callback.assert_called_once_with( - future._on_close_callback - ) - - def test__on_close_callback_success(self): - future = self.make_future() - - future._on_close_callback(mock.sentinel.manager, None) - - assert future.result() is True - assert not future.running() - - def test__on_close_callback_failure(self): - future = self.make_future() - - future._on_close_callback(mock.sentinel.manager, ValueError("meep")) - - with pytest.raises(ValueError): - future.result() - - assert not future.running() - - def test_cancel(self): - future = self.make_future() - - future.cancel() - - future._manager.close.assert_called_once() - assert future.cancelled() diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_heartbeater.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_heartbeater.py deleted file mode 100644 index 8f5049691a9d..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_heartbeater.py +++ /dev/null @@ -1,125 +0,0 @@ -# Copyright 2018, 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. - -import logging -import threading - -from google.cloud.pubsub_v1.subscriber._protocol import heartbeater -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager - -import mock -import pytest - - -def test_heartbeat_inactive(caplog): - caplog.set_level(logging.INFO) - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - manager.is_active = False - - heartbeater_ = heartbeater.Heartbeater(manager) - - heartbeater_.heartbeat() - - assert "exiting" in caplog.text - - -def test_heartbeat_stopped(caplog): - caplog.set_level(logging.INFO) - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - - heartbeater_ = heartbeater.Heartbeater(manager) - heartbeater_.stop() - - heartbeater_.heartbeat() - - assert "exiting" in caplog.text - - -def make_sleep_mark_manager_as_inactive(heartbeater): - # Make sleep mark the manager as inactive so that heartbeat() - # exits at the end of the first run. - def trigger_inactive(timeout): - assert timeout - heartbeater._manager.is_active = False - - heartbeater._stop_event.wait = trigger_inactive - - -def test_heartbeat_once(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - heartbeater_ = heartbeater.Heartbeater(manager) - make_sleep_mark_manager_as_inactive(heartbeater_) - - heartbeater_.heartbeat() - - manager.heartbeat.assert_called_once() - - -@mock.patch("threading.Thread", autospec=True) -def test_start(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - heartbeater_ = heartbeater.Heartbeater(manager) - - heartbeater_.start() - - thread.assert_called_once_with( - name=heartbeater._HEARTBEAT_WORKER_NAME, target=heartbeater_.heartbeat - ) - - thread.return_value.start.assert_called_once() - - assert heartbeater_._thread is not None - - -@mock.patch("threading.Thread", autospec=True) -def test_start_already_started(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - heartbeater_ = heartbeater.Heartbeater(manager) - heartbeater_._thread = mock.sentinel.thread - - with pytest.raises(ValueError): - heartbeater_.start() - - thread.assert_not_called() - - -def test_stop(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - heartbeater_ = heartbeater.Heartbeater(manager) - thread = mock.create_autospec(threading.Thread, instance=True) - heartbeater_._thread = thread - - heartbeater_.stop() - - assert heartbeater_._stop_event.is_set() - thread.join.assert_called_once() - assert heartbeater_._thread is None - - -def test_stop_no_join(): - heartbeater_ = heartbeater.Heartbeater(mock.sentinel.manager) - - heartbeater_.stop() diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_helper_threads.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_helper_threads.py deleted file mode 100644 index 6e1bcc813c89..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_helper_threads.py +++ /dev/null @@ -1,118 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -import mock -from six.moves import queue - -from google.cloud.pubsub_v1.subscriber._protocol import helper_threads - - -def test_queue_callback_worker(): - queue_ = queue.Queue() - callback = mock.Mock(spec=()) - qct = helper_threads.QueueCallbackWorker(queue_, callback) - - # Set up an appropriate mock for the queue, and call the queue callback - # thread. - with mock.patch.object(queue.Queue, "get") as get: - get.side_effect = (mock.sentinel.A, helper_threads.STOP, queue.Empty()) - qct() - - # Assert that we got the expected calls. - assert get.call_count == 3 - callback.assert_called_once_with([mock.sentinel.A]) - - -def test_queue_callback_worker_stop_with_extra_items(): - queue_ = queue.Queue() - callback = mock.Mock(spec=()) - qct = helper_threads.QueueCallbackWorker(queue_, callback) - - # Set up an appropriate mock for the queue, and call the queue callback - # thread. - with mock.patch.object(queue.Queue, "get") as get: - get.side_effect = ( - mock.sentinel.A, - helper_threads.STOP, - mock.sentinel.B, - queue.Empty(), - ) - qct() - - # Assert that we got the expected calls. - assert get.call_count == 4 - callback.assert_called_once_with([mock.sentinel.A]) - - -def test_queue_callback_worker_get_many(): - queue_ = queue.Queue() - callback = mock.Mock(spec=()) - qct = helper_threads.QueueCallbackWorker(queue_, callback) - - # Set up an appropriate mock for the queue, and call the queue callback - # thread. - with mock.patch.object(queue.Queue, "get") as get: - get.side_effect = ( - mock.sentinel.A, - queue.Empty(), - mock.sentinel.B, - helper_threads.STOP, - queue.Empty(), - ) - qct() - - # Assert that we got the expected calls. - assert get.call_count == 5 - callback.assert_has_calls( - [mock.call([(mock.sentinel.A)]), mock.call([(mock.sentinel.B)])] - ) - - -def test_queue_callback_worker_max_items(): - queue_ = queue.Queue() - callback = mock.Mock(spec=()) - qct = helper_threads.QueueCallbackWorker(queue_, callback, max_items=1) - - # Set up an appropriate mock for the queue, and call the queue callback - # thread. - with mock.patch.object(queue.Queue, "get") as get: - get.side_effect = ( - mock.sentinel.A, - mock.sentinel.B, - helper_threads.STOP, - queue.Empty(), - ) - qct() - - # Assert that we got the expected calls. - assert get.call_count == 3 - callback.assert_has_calls( - [mock.call([(mock.sentinel.A)]), mock.call([(mock.sentinel.B)])] - ) - - -def test_queue_callback_worker_exception(): - queue_ = queue.Queue() - callback = mock.Mock(spec=(), side_effect=(Exception,)) - qct = helper_threads.QueueCallbackWorker(queue_, callback) - - # Set up an appropriate mock for the queue, and call the queue callback - # thread. - with mock.patch.object(queue.Queue, "get") as get: - get.side_effect = (mock.sentinel.A, helper_threads.STOP, queue.Empty()) - qct() - - # Assert that we got the expected calls. - assert get.call_count == 3 - callback.assert_called_once_with([mock.sentinel.A]) diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_histogram.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_histogram.py deleted file mode 100644 index d3c15cdcee9c..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_histogram.py +++ /dev/null @@ -1,84 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from google.cloud.pubsub_v1.subscriber._protocol import histogram - - -def test_init(): - data = {} - histo = histogram.Histogram(data=data) - assert histo._data is data - assert len(histo) == 0 - - -def test_contains(): - histo = histogram.Histogram() - histo.add(10) - histo.add(20) - assert 10 in histo - assert 20 in histo - assert 30 not in histo - - -def test_max(): - histo = histogram.Histogram() - assert histo.max == 600 - histo.add(120) - assert histo.max == 120 - histo.add(150) - assert histo.max == 150 - histo.add(20) - assert histo.max == 150 - - -def test_min(): - histo = histogram.Histogram() - assert histo.min == 10 - histo.add(60) - assert histo.min == 60 - histo.add(30) - assert histo.min == 30 - histo.add(120) - assert histo.min == 30 - - -def test_add(): - histo = histogram.Histogram() - histo.add(60) - assert histo._data[60] == 1 - histo.add(60) - assert histo._data[60] == 2 - - -def test_add_lower_limit(): - histo = histogram.Histogram() - histo.add(5) - assert 5 not in histo - assert 10 in histo - - -def test_add_upper_limit(): - histo = histogram.Histogram() - histo.add(12000) - assert 12000 not in histo - assert 600 in histo - - -def test_percentile(): - histo = histogram.Histogram() - [histo.add(i) for i in range(101, 201)] - assert histo.percentile(100) == 200 - assert histo.percentile(101) == 200 - assert histo.percentile(99) == 199 - assert histo.percentile(1) == 101 diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_leaser.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_leaser.py deleted file mode 100644 index c8b217473d40..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_leaser.py +++ /dev/null @@ -1,225 +0,0 @@ -# Copyright 2017, 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. - -import logging -import threading - -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber._protocol import dispatcher -from google.cloud.pubsub_v1.subscriber._protocol import histogram -from google.cloud.pubsub_v1.subscriber._protocol import leaser -from google.cloud.pubsub_v1.subscriber._protocol import requests -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager - -import mock -import pytest - - -def test_add_and_remove(): - leaser_ = leaser.Leaser(mock.sentinel.manager) - - leaser_.add([requests.LeaseRequest(ack_id="ack1", byte_size=50)]) - leaser_.add([requests.LeaseRequest(ack_id="ack2", byte_size=25)]) - - assert leaser_.message_count == 2 - assert set(leaser_.ack_ids) == set(["ack1", "ack2"]) - assert leaser_.bytes == 75 - - leaser_.remove([requests.DropRequest(ack_id="ack1", byte_size=50)]) - - assert leaser_.message_count == 1 - assert set(leaser_.ack_ids) == set(["ack2"]) - assert leaser_.bytes == 25 - - -def test_add_already_managed(caplog): - caplog.set_level(logging.DEBUG) - - leaser_ = leaser.Leaser(mock.sentinel.manager) - - leaser_.add([requests.LeaseRequest(ack_id="ack1", byte_size=50)]) - leaser_.add([requests.LeaseRequest(ack_id="ack1", byte_size=50)]) - - assert "already lease managed" in caplog.text - - -def test_remove_not_managed(caplog): - caplog.set_level(logging.DEBUG) - - leaser_ = leaser.Leaser(mock.sentinel.manager) - - leaser_.remove([requests.DropRequest(ack_id="ack1", byte_size=50)]) - - assert "not managed" in caplog.text - - -def test_remove_negative_bytes(caplog): - caplog.set_level(logging.DEBUG) - - leaser_ = leaser.Leaser(mock.sentinel.manager) - - leaser_.add([requests.LeaseRequest(ack_id="ack1", byte_size=50)]) - leaser_.remove([requests.DropRequest(ack_id="ack1", byte_size=75)]) - - assert leaser_.bytes == 0 - assert "unexpectedly negative" in caplog.text - - -def create_manager(flow_control=types.FlowControl()): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - manager.dispatcher = mock.create_autospec(dispatcher.Dispatcher, instance=True) - manager.is_active = True - manager.flow_control = flow_control - manager.ack_histogram = histogram.Histogram() - return manager - - -def test_maintain_leases_inactive(caplog): - caplog.set_level(logging.INFO) - manager = create_manager() - manager.is_active = False - - leaser_ = leaser.Leaser(manager) - - leaser_.maintain_leases() - - assert "exiting" in caplog.text - - -def test_maintain_leases_stopped(caplog): - caplog.set_level(logging.INFO) - manager = create_manager() - - leaser_ = leaser.Leaser(manager) - leaser_.stop() - - leaser_.maintain_leases() - - assert "exiting" in caplog.text - - -def make_sleep_mark_manager_as_inactive(leaser): - # Make sleep mark the manager as inactive so that maintain_leases - # exits at the end of the first run. - def trigger_inactive(timeout): - assert 0 < timeout < 10 - leaser._manager.is_active = False - - leaser._stop_event.wait = trigger_inactive - - -def test_maintain_leases_ack_ids(): - manager = create_manager() - leaser_ = leaser.Leaser(manager) - make_sleep_mark_manager_as_inactive(leaser_) - leaser_.add([requests.LeaseRequest(ack_id="my ack id", byte_size=50)]) - - leaser_.maintain_leases() - - manager.dispatcher.modify_ack_deadline.assert_called_once_with( - [requests.ModAckRequest(ack_id="my ack id", seconds=10)] - ) - - -def test_maintain_leases_no_ack_ids(): - manager = create_manager() - leaser_ = leaser.Leaser(manager) - make_sleep_mark_manager_as_inactive(leaser_) - - leaser_.maintain_leases() - - manager.dispatcher.modify_ack_deadline.assert_not_called() - - -@mock.patch("time.time", autospec=True) -def test_maintain_leases_outdated_items(time): - manager = create_manager() - leaser_ = leaser.Leaser(manager) - make_sleep_mark_manager_as_inactive(leaser_) - - # Add these items at the beginning of the timeline - time.return_value = 0 - leaser_.add([requests.LeaseRequest(ack_id="ack1", byte_size=50)]) - - # Add another item at towards end of the timeline - time.return_value = manager.flow_control.max_lease_duration - 1 - leaser_.add([requests.LeaseRequest(ack_id="ack2", byte_size=50)]) - - # Now make sure time reports that we are at the end of our timeline. - time.return_value = manager.flow_control.max_lease_duration + 1 - - leaser_.maintain_leases() - - # Only ack2 should be renewed. ack1 should've been dropped - manager.dispatcher.modify_ack_deadline.assert_called_once_with( - [requests.ModAckRequest(ack_id="ack2", seconds=10)] - ) - manager.dispatcher.drop.assert_called_once_with( - [requests.DropRequest(ack_id="ack1", byte_size=50)] - ) - - -@mock.patch("threading.Thread", autospec=True) -def test_start(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - leaser_ = leaser.Leaser(manager) - - leaser_.start() - - thread.assert_called_once_with( - name=leaser._LEASE_WORKER_NAME, target=leaser_.maintain_leases - ) - - thread.return_value.start.assert_called_once() - - assert leaser_._thread is not None - - -@mock.patch("threading.Thread", autospec=True) -def test_start_already_started(thread): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - leaser_ = leaser.Leaser(manager) - leaser_._thread = mock.sentinel.thread - - with pytest.raises(ValueError): - leaser_.start() - - thread.assert_not_called() - - -def test_stop(): - manager = mock.create_autospec( - streaming_pull_manager.StreamingPullManager, instance=True - ) - leaser_ = leaser.Leaser(manager) - thread = mock.create_autospec(threading.Thread, instance=True) - leaser_._thread = thread - - leaser_.stop() - - assert leaser_._stop_event.is_set() - thread.join.assert_called_once() - assert leaser_._thread is None - - -def test_stop_no_join(): - leaser_ = leaser.Leaser(mock.sentinel.manager) - - leaser_.stop() diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_message.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_message.py deleted file mode 100644 index fd23deef06c9..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_message.py +++ /dev/null @@ -1,172 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -import datetime -import time - -import mock -import pytz -from six.moves import queue -from google.protobuf import timestamp_pb2 - -from google.api_core import datetime_helpers -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber import message -from google.cloud.pubsub_v1.subscriber._protocol import requests - - -RECEIVED = datetime.datetime(2012, 4, 21, 15, 0, tzinfo=pytz.utc) -RECEIVED_SECONDS = datetime_helpers.to_milliseconds(RECEIVED) // 1000 -PUBLISHED_MICROS = 123456 -PUBLISHED = RECEIVED + datetime.timedelta(days=1, microseconds=PUBLISHED_MICROS) -PUBLISHED_SECONDS = datetime_helpers.to_milliseconds(PUBLISHED) // 1000 - - -def create_message(data, ack_id="ACKID", delivery_attempt=0, **attrs): - with mock.patch.object(time, "time") as time_: - time_.return_value = RECEIVED_SECONDS - msg = message.Message( - message=types.PubsubMessage( - attributes=attrs, - data=data, - message_id="message_id", - publish_time=timestamp_pb2.Timestamp( - seconds=PUBLISHED_SECONDS, nanos=PUBLISHED_MICROS * 1000 - ), - ), - ack_id=ack_id, - delivery_attempt=delivery_attempt, - request_queue=queue.Queue(), - ) - return msg - - -def test_attributes(): - msg = create_message(b"foo", baz="bacon", spam="eggs") - assert msg.attributes == {"baz": "bacon", "spam": "eggs"} - - -def test_data(): - msg = create_message(b"foo") - assert msg.data == b"foo" - - -def test_size(): - msg = create_message(b"foo") - assert msg.size == 30 # payload + protobuf overhead - - -def test_ack_id(): - ack_id = "MY-ACK-ID" - msg = create_message(b"foo", ack_id=ack_id) - assert msg.ack_id == ack_id - - -def test_delivery_attempt(): - delivery_attempt = 10 - msg = create_message(b"foo", delivery_attempt=delivery_attempt) - assert msg.delivery_attempt == delivery_attempt - - -def test_delivery_attempt_is_none(): - msg = create_message(b"foo", delivery_attempt=0) - assert msg.delivery_attempt is None - - -def test_publish_time(): - msg = create_message(b"foo") - assert msg.publish_time == PUBLISHED - - -def check_call_types(mock, *args, **kwargs): - """Checks a mock's call types. - - Args: - mock: The mock to check. - args: The types of the positional arguments. - kwargs: The names of the keyword args to check and their respective - types. - - Raises: - AssertionError: if any of the types don't match, or if the number of - arguments does not match. - """ - for call in mock.mock_calls: - _, call_args, call_kwargs = call - assert len(call_args) == len(args) - for n, argtype in enumerate(args): - assert isinstance(call_args[n], argtype) - for argname, argtype in kwargs: - assert argname in call_kwargs - assert isinstance(call_kwargs[argname], argtype) - - -def test_ack(): - msg = create_message(b"foo", ack_id="bogus_ack_id") - with mock.patch.object(msg._request_queue, "put") as put: - msg.ack() - put.assert_called_once_with( - requests.AckRequest( - ack_id="bogus_ack_id", byte_size=30, time_to_ack=mock.ANY - ) - ) - check_call_types(put, requests.AckRequest) - - -def test_drop(): - msg = create_message(b"foo", ack_id="bogus_ack_id") - with mock.patch.object(msg._request_queue, "put") as put: - msg.drop() - put.assert_called_once_with( - requests.DropRequest(ack_id="bogus_ack_id", byte_size=30) - ) - check_call_types(put, requests.DropRequest) - - -def test_modify_ack_deadline(): - msg = create_message(b"foo", ack_id="bogus_ack_id") - with mock.patch.object(msg._request_queue, "put") as put: - msg.modify_ack_deadline(60) - put.assert_called_once_with( - requests.ModAckRequest(ack_id="bogus_ack_id", seconds=60) - ) - check_call_types(put, requests.ModAckRequest) - - -def test_nack(): - msg = create_message(b"foo", ack_id="bogus_ack_id") - with mock.patch.object(msg._request_queue, "put") as put: - msg.nack() - put.assert_called_once_with( - requests.NackRequest(ack_id="bogus_ack_id", byte_size=30) - ) - check_call_types(put, requests.NackRequest) - - -def test_repr(): - data = b"foo" - msg = create_message(data, snow="cones", orange="juice") - data_line = " data: {!r}".format(data) - expected_repr = "\n".join( - ( - "Message {", - data_line, - " attributes: {", - ' "orange": "juice",', - ' "snow": "cones"', - " }", - "}", - ) - ) - assert repr(msg) == expected_repr diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_scheduler.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_scheduler.py deleted file mode 100644 index 774d0d63e2a2..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_scheduler.py +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright 2018, 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. - -import concurrent.futures -import threading - -import mock -from six.moves import queue - -from google.cloud.pubsub_v1.subscriber import scheduler - - -def test_subclasses_base_abc(): - assert issubclass(scheduler.ThreadScheduler, scheduler.Scheduler) - - -def test_constructor_defaults(): - scheduler_ = scheduler.ThreadScheduler() - - assert isinstance(scheduler_.queue, queue.Queue) - assert isinstance(scheduler_._executor, concurrent.futures.Executor) - - -def test_constructor_options(): - scheduler_ = scheduler.ThreadScheduler(executor=mock.sentinel.executor) - - assert scheduler_._executor == mock.sentinel.executor - - -def test_schedule(): - called_with = [] - called = threading.Event() - - def callback(*args, **kwargs): - called_with.append((args, kwargs)) - called.set() - - scheduler_ = scheduler.ThreadScheduler() - - scheduler_.schedule(callback, "arg1", kwarg1="meep") - - called.wait() - scheduler_.shutdown() - - assert called_with == [(("arg1",), {"kwarg1": "meep"})] diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py deleted file mode 100644 index 6f8a04ac9935..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_streaming_pull_manager.py +++ /dev/null @@ -1,826 +0,0 @@ -# Copyright 2018, 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. - -import logging -import threading -import time -import types as stdlib_types - -import mock -import pytest -from six.moves import queue - -from google.api_core import bidi -from google.api_core import exceptions -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.gapic import subscriber_client_config -from google.cloud.pubsub_v1.subscriber import client -from google.cloud.pubsub_v1.subscriber import message -from google.cloud.pubsub_v1.subscriber import scheduler -from google.cloud.pubsub_v1.subscriber._protocol import dispatcher -from google.cloud.pubsub_v1.subscriber._protocol import heartbeater -from google.cloud.pubsub_v1.subscriber._protocol import leaser -from google.cloud.pubsub_v1.subscriber._protocol import requests -from google.cloud.pubsub_v1.subscriber._protocol import streaming_pull_manager -import grpc - - -@pytest.mark.parametrize( - "exception,expected_cls", - [ - (ValueError("meep"), ValueError), - ( - mock.create_autospec(grpc.RpcError, instance=True), - exceptions.GoogleAPICallError, - ), - ], -) -def test__maybe_wrap_exception(exception, expected_cls): - assert isinstance( - streaming_pull_manager._maybe_wrap_exception(exception), expected_cls - ) - - -def test__wrap_callback_errors_no_error(): - msg = mock.create_autospec(message.Message, instance=True) - callback = mock.Mock() - on_callback_error = mock.Mock() - - streaming_pull_manager._wrap_callback_errors(callback, on_callback_error, msg) - - callback.assert_called_once_with(msg) - msg.nack.assert_not_called() - on_callback_error.assert_not_called() - - -def test__wrap_callback_errors_error(): - callback_error = ValueError("meep") - - msg = mock.create_autospec(message.Message, instance=True) - callback = mock.Mock(side_effect=callback_error) - on_callback_error = mock.Mock() - - streaming_pull_manager._wrap_callback_errors(callback, on_callback_error, msg) - - msg.nack.assert_called_once() - on_callback_error.assert_called_once_with(callback_error) - - -def test_constructor_and_default_state(): - manager = streaming_pull_manager.StreamingPullManager( - mock.sentinel.client, mock.sentinel.subscription - ) - - # Public state - assert manager.is_active is False - assert manager.flow_control == types.FlowControl() - assert manager.dispatcher is None - assert manager.leaser is None - assert manager.ack_histogram is not None - assert manager.ack_deadline == 10 - assert manager.load == 0 - - # Private state - assert manager._client == mock.sentinel.client - assert manager._subscription == mock.sentinel.subscription - assert manager._scheduler is not None - - -def test_constructor_with_options(): - manager = streaming_pull_manager.StreamingPullManager( - mock.sentinel.client, - mock.sentinel.subscription, - flow_control=mock.sentinel.flow_control, - scheduler=mock.sentinel.scheduler, - ) - - assert manager.flow_control == mock.sentinel.flow_control - assert manager._scheduler == mock.sentinel.scheduler - - -def make_manager(**kwargs): - client_ = mock.create_autospec(client.Client, instance=True) - scheduler_ = mock.create_autospec(scheduler.Scheduler, instance=True) - return streaming_pull_manager.StreamingPullManager( - client_, "subscription-name", scheduler=scheduler_, **kwargs - ) - - -def fake_leaser_add(leaser, init_msg_count=0, assumed_msg_size=10): - """Add a simplified fake add() method to a leaser instance. - - The fake add() method actually increases the leaser's internal message count - by one for each message, and the total bytes by ``assumed_msg_size`` for - each message (regardless of the actual message size). - """ - - def fake_add(self, items): - self.message_count += len(items) - self.bytes += len(items) * assumed_msg_size - - leaser.message_count = init_msg_count - leaser.bytes = init_msg_count * assumed_msg_size - leaser.add = stdlib_types.MethodType(fake_add, leaser) - - -def test_ack_deadline(): - manager = make_manager() - assert manager.ack_deadline == 10 - manager.ack_histogram.add(20) - assert manager.ack_deadline == 20 - manager.ack_histogram.add(10) - assert manager.ack_deadline == 20 - - -def test_maybe_pause_consumer_wo_consumer_set(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - manager.maybe_pause_consumer() # no raise - # Ensure load > 1 - _leaser = manager._leaser = mock.create_autospec(leaser.Leaser) - _leaser.message_count = 100 - _leaser.bytes = 10000 - manager.maybe_pause_consumer() # no raise - - -def test_lease_load_and_pause(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - manager._leaser = leaser.Leaser(manager) - manager._consumer = mock.create_autospec(bidi.BackgroundConsumer, instance=True) - manager._consumer.is_paused = False - - # This should mean that our messages count is at 10%, and our bytes - # are at 15%; load should return the higher (0.15), and shouldn't cause - # the consumer to pause. - manager.leaser.add([requests.LeaseRequest(ack_id="one", byte_size=150)]) - assert manager.load == 0.15 - manager.maybe_pause_consumer() - manager._consumer.pause.assert_not_called() - - # After this message is added, the messages should be higher at 20% - # (versus 16% for bytes). - manager.leaser.add([requests.LeaseRequest(ack_id="two", byte_size=10)]) - assert manager.load == 0.2 - - # Returning a number above 100% is fine, and it should cause this to pause. - manager.leaser.add([requests.LeaseRequest(ack_id="three", byte_size=1000)]) - assert manager.load == 1.16 - manager.maybe_pause_consumer() - manager._consumer.pause.assert_called_once() - - -def test_drop_and_resume(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - manager._leaser = leaser.Leaser(manager) - manager._consumer = mock.create_autospec(bidi.BackgroundConsumer, instance=True) - manager._consumer.is_paused = True - - # Add several messages until we're over the load threshold. - manager.leaser.add( - [ - requests.LeaseRequest(ack_id="one", byte_size=750), - requests.LeaseRequest(ack_id="two", byte_size=250), - ] - ) - - assert manager.load == 1.0 - - # Trying to resume now should have no effect as we're over the threshold. - manager.maybe_resume_consumer() - manager._consumer.resume.assert_not_called() - - # Drop the 200 byte message, which should put us under the resume - # threshold. - manager.leaser.remove([requests.DropRequest(ack_id="two", byte_size=250)]) - manager.maybe_resume_consumer() - manager._consumer.resume.assert_called_once() - - -def test_resume_not_paused(): - manager = make_manager() - manager._consumer = mock.create_autospec(bidi.BackgroundConsumer, instance=True) - manager._consumer.is_paused = False - - # Resuming should have no effect is the consumer is not actually paused. - manager.maybe_resume_consumer() - manager._consumer.resume.assert_not_called() - - -def test_maybe_resume_consumer_wo_consumer_set(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - manager.maybe_resume_consumer() # no raise - - -def test__maybe_release_messages_on_overload(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - - msg = mock.create_autospec(message.Message, instance=True, ack_id="ack", size=11) - manager._messages_on_hold.put(msg) - manager._on_hold_bytes = msg.size - - # Ensure load is exactly 1.0 (to verify that >= condition is used) - _leaser = manager._leaser = mock.create_autospec(leaser.Leaser) - _leaser.message_count = 10 - _leaser.bytes = 1000 + msg.size - - manager._maybe_release_messages() - - assert manager._messages_on_hold.qsize() == 1 - manager._leaser.add.assert_not_called() - manager._scheduler.schedule.assert_not_called() - - -def test__maybe_release_messages_below_overload(): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - manager._callback = mock.sentinel.callback - - # Init leaser message count to 11, so that when subtracting the 3 messages - # that are on hold, there is still room for another 2 messages before the - # max load is hit. - _leaser = manager._leaser = mock.create_autospec(leaser.Leaser) - fake_leaser_add(_leaser, init_msg_count=11, assumed_msg_size=10) - - messages = [ - mock.create_autospec(message.Message, instance=True, ack_id="ack_foo", size=10), - mock.create_autospec(message.Message, instance=True, ack_id="ack_bar", size=10), - mock.create_autospec(message.Message, instance=True, ack_id="ack_baz", size=10), - ] - for msg in messages: - manager._messages_on_hold.put(msg) - manager._on_hold_bytes = 3 * 10 - - # the actual call of MUT - manager._maybe_release_messages() - - assert manager._messages_on_hold.qsize() == 1 - msg = manager._messages_on_hold.get_nowait() - assert msg.ack_id == "ack_baz" - - schedule_calls = manager._scheduler.schedule.mock_calls - assert len(schedule_calls) == 2 - for _, call_args, _ in schedule_calls: - assert call_args[0] == mock.sentinel.callback - assert isinstance(call_args[1], message.Message) - assert call_args[1].ack_id in ("ack_foo", "ack_bar") - - -def test__maybe_release_messages_negative_on_hold_bytes_warning(caplog): - manager = make_manager( - flow_control=types.FlowControl(max_messages=10, max_bytes=1000) - ) - - msg = mock.create_autospec(message.Message, instance=True, ack_id="ack", size=17) - manager._messages_on_hold.put(msg) - manager._on_hold_bytes = 5 # too low for some reason - - _leaser = manager._leaser = mock.create_autospec(leaser.Leaser) - _leaser.message_count = 3 - _leaser.bytes = 150 - - with caplog.at_level(logging.WARNING): - manager._maybe_release_messages() - - expected_warnings = [ - record.message.lower() - for record in caplog.records - if "unexpectedly negative" in record.message - ] - assert len(expected_warnings) == 1 - assert "on hold bytes" in expected_warnings[0] - assert "-12" in expected_warnings[0] - - assert manager._on_hold_bytes == 0 # should be auto-corrected - - -def test_send_unary(): - manager = make_manager() - manager._UNARY_REQUESTS = True - - manager.send( - types.StreamingPullRequest( - ack_ids=["ack_id1", "ack_id2"], - modify_deadline_ack_ids=["ack_id3", "ack_id4", "ack_id5"], - modify_deadline_seconds=[10, 20, 20], - ) - ) - - manager._client.acknowledge.assert_called_once_with( - subscription=manager._subscription, ack_ids=["ack_id1", "ack_id2"] - ) - - manager._client.modify_ack_deadline.assert_has_calls( - [ - mock.call( - subscription=manager._subscription, - ack_ids=["ack_id3"], - ack_deadline_seconds=10, - ), - mock.call( - subscription=manager._subscription, - ack_ids=["ack_id4", "ack_id5"], - ack_deadline_seconds=20, - ), - ], - any_order=True, - ) - - -def test_send_unary_empty(): - manager = make_manager() - manager._UNARY_REQUESTS = True - - manager.send(types.StreamingPullRequest()) - - manager._client.acknowledge.assert_not_called() - manager._client.modify_ack_deadline.assert_not_called() - - -def test_send_unary_api_call_error(caplog): - caplog.set_level(logging.DEBUG) - - manager = make_manager() - manager._UNARY_REQUESTS = True - - error = exceptions.GoogleAPICallError("The front fell off") - manager._client.acknowledge.side_effect = error - - manager.send(types.StreamingPullRequest(ack_ids=["ack_id1", "ack_id2"])) - - assert "The front fell off" in caplog.text - - -def test_send_unary_retry_error(caplog): - caplog.set_level(logging.DEBUG) - - manager, _, _, _, _, _ = make_running_manager() - manager._UNARY_REQUESTS = True - - error = exceptions.RetryError( - "Too long a transient error", cause=Exception("Out of time!") - ) - manager._client.acknowledge.side_effect = error - - with pytest.raises(exceptions.RetryError): - manager.send(types.StreamingPullRequest(ack_ids=["ack_id1", "ack_id2"])) - - assert "RetryError while sending unary RPC" in caplog.text - assert "signaled streaming pull manager shutdown" in caplog.text - - -def test_send_streaming(): - manager = make_manager() - manager._UNARY_REQUESTS = False - manager._rpc = mock.create_autospec(bidi.BidiRpc, instance=True) - - manager.send(mock.sentinel.request) - - manager._rpc.send.assert_called_once_with(mock.sentinel.request) - - -def test_heartbeat(): - manager = make_manager() - manager._rpc = mock.create_autospec(bidi.BidiRpc, instance=True) - manager._rpc.is_active = True - - manager.heartbeat() - - manager._rpc.send.assert_called_once_with(types.StreamingPullRequest()) - - -def test_heartbeat_inactive(): - manager = make_manager() - manager._rpc = mock.create_autospec(bidi.BidiRpc, instance=True) - manager._rpc.is_active = False - - manager.heartbeat() - - manager._rpc.send.assert_not_called() - - -@mock.patch("google.api_core.bidi.ResumableBidiRpc", autospec=True) -@mock.patch("google.api_core.bidi.BackgroundConsumer", autospec=True) -@mock.patch("google.cloud.pubsub_v1.subscriber._protocol.leaser.Leaser", autospec=True) -@mock.patch( - "google.cloud.pubsub_v1.subscriber._protocol.dispatcher.Dispatcher", autospec=True -) -@mock.patch( - "google.cloud.pubsub_v1.subscriber._protocol.heartbeater.Heartbeater", autospec=True -) -def test_open(heartbeater, dispatcher, leaser, background_consumer, resumable_bidi_rpc): - manager = make_manager() - - manager.open(mock.sentinel.callback, mock.sentinel.on_callback_error) - - heartbeater.assert_called_once_with(manager) - heartbeater.return_value.start.assert_called_once() - assert manager._heartbeater == heartbeater.return_value - - dispatcher.assert_called_once_with(manager, manager._scheduler.queue) - dispatcher.return_value.start.assert_called_once() - assert manager._dispatcher == dispatcher.return_value - - leaser.assert_called_once_with(manager) - leaser.return_value.start.assert_called_once() - assert manager.leaser == leaser.return_value - - background_consumer.assert_called_once_with(manager._rpc, manager._on_response) - background_consumer.return_value.start.assert_called_once() - assert manager._consumer == background_consumer.return_value - - resumable_bidi_rpc.assert_called_once_with( - start_rpc=manager._client.api.streaming_pull, - initial_request=mock.ANY, - should_recover=manager._should_recover, - should_terminate=manager._should_terminate, - throttle_reopen=True, - ) - initial_request_arg = resumable_bidi_rpc.call_args.kwargs["initial_request"] - assert initial_request_arg.func == manager._get_initial_request - assert initial_request_arg.args[0] == 10 # the default stream ACK timeout - assert not manager._client.api.get_subscription.called - - resumable_bidi_rpc.return_value.add_done_callback.assert_called_once_with( - manager._on_rpc_done - ) - assert manager._rpc == resumable_bidi_rpc.return_value - - manager._consumer.is_active = True - assert manager.is_active is True - - -def test_open_already_active(): - manager = make_manager() - manager._consumer = mock.create_autospec(bidi.BackgroundConsumer, instance=True) - manager._consumer.is_active = True - - with pytest.raises(ValueError, match="already open"): - manager.open(mock.sentinel.callback, mock.sentinel.on_callback_error) - - -def test_open_has_been_closed(): - manager = make_manager() - manager._closed = True - - with pytest.raises(ValueError, match="closed"): - manager.open(mock.sentinel.callback, mock.sentinel.on_callback_error) - - -def make_running_manager(): - manager = make_manager() - manager._consumer = mock.create_autospec(bidi.BackgroundConsumer, instance=True) - manager._consumer.is_active = True - manager._dispatcher = mock.create_autospec(dispatcher.Dispatcher, instance=True) - manager._leaser = mock.create_autospec(leaser.Leaser, instance=True) - manager._heartbeater = mock.create_autospec(heartbeater.Heartbeater, instance=True) - - return ( - manager, - manager._consumer, - manager._dispatcher, - manager._leaser, - manager._heartbeater, - manager._scheduler, - ) - - -def test_close(): - manager, consumer, dispatcher, leaser, heartbeater, scheduler = ( - make_running_manager() - ) - - manager.close() - - consumer.stop.assert_called_once() - leaser.stop.assert_called_once() - dispatcher.stop.assert_called_once() - heartbeater.stop.assert_called_once() - scheduler.shutdown.assert_called_once() - - assert manager.is_active is False - - -def test_close_inactive_consumer(): - manager, consumer, dispatcher, leaser, heartbeater, scheduler = ( - make_running_manager() - ) - consumer.is_active = False - - manager.close() - - consumer.stop.assert_not_called() - leaser.stop.assert_called_once() - dispatcher.stop.assert_called_once() - heartbeater.stop.assert_called_once() - scheduler.shutdown.assert_called_once() - - -def test_close_idempotent(): - manager, _, _, _, _, scheduler = make_running_manager() - - manager.close() - manager.close() - - assert scheduler.shutdown.call_count == 1 - - -class FakeDispatcher(object): - def __init__(self, manager, error_callback): - self._manager = manager - self._error_callback = error_callback - self._thread = None - self._stop = False - - def start(self): - self._thread = threading.Thread(target=self._do_work) - self._thread.daemon = True - self._thread.start() - - def stop(self): - self._stop = True - self._thread.join() - self._thread = None - - def _do_work(self): - while not self._stop: - try: - self._manager.leaser.add([mock.Mock()]) - except Exception as exc: - self._error_callback(exc) - time.sleep(0.1) - - # also try to interact with the leaser after the stop flag has been set - try: - self._manager.leaser.remove([mock.Mock()]) - except Exception as exc: - self._error_callback(exc) - - -def test_close_no_dispatcher_error(): - manager, _, _, _, _, _ = make_running_manager() - error_callback = mock.Mock(name="error_callback") - dispatcher = FakeDispatcher(manager=manager, error_callback=error_callback) - manager._dispatcher = dispatcher - dispatcher.start() - - manager.close() - - error_callback.assert_not_called() - - -def test_close_callbacks(): - manager, _, _, _, _, _ = make_running_manager() - - callback = mock.Mock() - - manager.add_close_callback(callback) - manager.close(reason="meep") - - callback.assert_called_once_with(manager, "meep") - - -def test__get_initial_request(): - manager = make_manager() - manager._leaser = mock.create_autospec(leaser.Leaser, instance=True) - manager._leaser.ack_ids = ["1", "2"] - - initial_request = manager._get_initial_request(123) - - assert isinstance(initial_request, types.StreamingPullRequest) - assert initial_request.subscription == "subscription-name" - assert initial_request.stream_ack_deadline_seconds == 123 - assert initial_request.modify_deadline_ack_ids == ["1", "2"] - assert initial_request.modify_deadline_seconds == [10, 10] - - -def test__get_initial_request_wo_leaser(): - manager = make_manager() - manager._leaser = None - - initial_request = manager._get_initial_request(123) - - assert isinstance(initial_request, types.StreamingPullRequest) - assert initial_request.subscription == "subscription-name" - assert initial_request.stream_ack_deadline_seconds == 123 - assert initial_request.modify_deadline_ack_ids == [] - assert initial_request.modify_deadline_seconds == [] - - -def test__on_response_delivery_attempt(): - manager, _, dispatcher, leaser, _, scheduler = make_running_manager() - manager._callback = mock.sentinel.callback - - # Set up the messages. - response = types.StreamingPullResponse( - received_messages=[ - types.ReceivedMessage( - ack_id="fack", message=types.PubsubMessage(data=b"foo", message_id="1") - ), - types.ReceivedMessage( - ack_id="back", - message=types.PubsubMessage(data=b"bar", message_id="2"), - delivery_attempt=6, - ), - ] - ) - - # adjust message bookkeeping in leaser - fake_leaser_add(leaser, init_msg_count=0, assumed_msg_size=42) - - manager._on_response(response) - - schedule_calls = scheduler.schedule.mock_calls - assert len(schedule_calls) == 2 - msg1 = schedule_calls[0][1][1] - assert msg1.delivery_attempt is None - msg2 = schedule_calls[1][1][1] - assert msg2.delivery_attempt == 6 - - -def test__on_response_no_leaser_overload(): - manager, _, dispatcher, leaser, _, scheduler = make_running_manager() - manager._callback = mock.sentinel.callback - - # Set up the messages. - response = types.StreamingPullResponse( - received_messages=[ - types.ReceivedMessage( - ack_id="fack", message=types.PubsubMessage(data=b"foo", message_id="1") - ), - types.ReceivedMessage( - ack_id="back", message=types.PubsubMessage(data=b"bar", message_id="2") - ), - ] - ) - - # adjust message bookkeeping in leaser - fake_leaser_add(leaser, init_msg_count=0, assumed_msg_size=42) - - # Actually run the method and prove that modack and schedule - # are called in the expected way. - manager._on_response(response) - - dispatcher.modify_ack_deadline.assert_called_once_with( - [requests.ModAckRequest("fack", 10), requests.ModAckRequest("back", 10)] - ) - - schedule_calls = scheduler.schedule.mock_calls - assert len(schedule_calls) == 2 - for call in schedule_calls: - assert call[1][0] == mock.sentinel.callback - assert isinstance(call[1][1], message.Message) - - # the leaser load limit not hit, no messages had to be put on hold - assert manager._messages_on_hold.qsize() == 0 - - -def test__on_response_with_leaser_overload(): - manager, _, dispatcher, leaser, _, scheduler = make_running_manager() - manager._callback = mock.sentinel.callback - - # Set up the messages. - response = types.StreamingPullResponse( - received_messages=[ - types.ReceivedMessage( - ack_id="fack", message=types.PubsubMessage(data=b"foo", message_id="1") - ), - types.ReceivedMessage( - ack_id="back", message=types.PubsubMessage(data=b"bar", message_id="2") - ), - types.ReceivedMessage( - ack_id="zack", message=types.PubsubMessage(data=b"baz", message_id="3") - ), - ] - ) - - # Adjust message bookkeeping in leaser. Pick 999 messages, which is just below - # the default FlowControl.max_messages limit. - fake_leaser_add(leaser, init_msg_count=999, assumed_msg_size=10) - - # Actually run the method and prove that modack and schedule - # are called in the expected way. - manager._on_response(response) - - # all messages should be added to the lease management and have their ACK - # deadline extended, even those not dispatched to callbacks - dispatcher.modify_ack_deadline.assert_called_once_with( - [ - requests.ModAckRequest("fack", 10), - requests.ModAckRequest("back", 10), - requests.ModAckRequest("zack", 10), - ] - ) - - # one message should be scheduled, the flow control limits allow for it - schedule_calls = scheduler.schedule.mock_calls - assert len(schedule_calls) == 1 - call_args = schedule_calls[0][1] - assert call_args[0] == mock.sentinel.callback - assert isinstance(call_args[1], message.Message) - assert call_args[1].message_id == "1" - - # the rest of the messages should have been put on hold - assert manager._messages_on_hold.qsize() == 2 - while True: - try: - msg = manager._messages_on_hold.get_nowait() - except queue.Empty: - break - else: - assert isinstance(msg, message.Message) - assert msg.message_id in ("2", "3") - - -def test__on_response_none_data(caplog): - caplog.set_level(logging.DEBUG) - - manager, _, dispatcher, leaser, _, scheduler = make_running_manager() - manager._callback = mock.sentinel.callback - - # adjust message bookkeeping in leaser - fake_leaser_add(leaser, init_msg_count=0, assumed_msg_size=10) - - manager._on_response(response=None) - - scheduler.schedule.assert_not_called() - assert "callback invoked with None" in caplog.text - - -def test_retryable_stream_errors(): - # Make sure the config matches our hard-coded tuple of exceptions. - interfaces = subscriber_client_config.config["interfaces"] - retry_codes = interfaces["google.pubsub.v1.Subscriber"]["retry_codes"] - idempotent = retry_codes["idempotent"] - - status_codes = tuple(getattr(grpc.StatusCode, name, None) for name in idempotent) - expected = tuple( - exceptions.exception_class_for_grpc_status(status_code) - for status_code in status_codes - ) - assert set(expected).issubset(set(streaming_pull_manager._RETRYABLE_STREAM_ERRORS)) - - -def test__should_recover_true(): - manager = make_manager() - - details = "UNAVAILABLE. Service taking nap." - exc = exceptions.ServiceUnavailable(details) - - assert manager._should_recover(exc) is True - - -def test__should_recover_false(): - manager = make_manager() - - exc = TypeError("wahhhhhh") - - assert manager._should_recover(exc) is False - - -def test__should_terminate_true(): - manager = make_manager() - - details = "Cancelled. Go away, before I taunt you a second time." - exc = exceptions.Cancelled(details) - - assert manager._should_terminate(exc) is True - - -def test__should_terminate_false(): - manager = make_manager() - - exc = TypeError("wahhhhhh") - - assert manager._should_terminate(exc) is False - - -@mock.patch("threading.Thread", autospec=True) -def test__on_rpc_done(thread): - manager = make_manager() - - manager._on_rpc_done(mock.sentinel.error) - - thread.assert_called_once_with( - name=mock.ANY, target=manager.close, kwargs={"reason": mock.sentinel.error} - ) diff --git a/pubsub/tests/unit/pubsub_v1/subscriber/test_subscriber_client.py b/pubsub/tests/unit/pubsub_v1/subscriber/test_subscriber_client.py deleted file mode 100644 index b367733aa705..000000000000 --- a/pubsub/tests/unit/pubsub_v1/subscriber/test_subscriber_client.py +++ /dev/null @@ -1,108 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from google.auth import credentials -import mock - -from google.cloud.pubsub_v1 import subscriber -from google.cloud.pubsub_v1.gapic import subscriber_client -from google.cloud.pubsub_v1 import types -from google.cloud.pubsub_v1.subscriber import futures - - -def test_init(): - creds = mock.Mock(spec=credentials.Credentials) - client = subscriber.Client(credentials=creds) - assert isinstance(client.api, subscriber_client.SubscriberClient) - - -def test_init_w_custom_transport(): - transport = object() - client = subscriber.Client(transport=transport) - assert isinstance(client.api, subscriber_client.SubscriberClient) - assert client.api.transport is transport - - -def test_init_emulator(monkeypatch): - monkeypatch.setenv("PUBSUB_EMULATOR_HOST", "/baz/bacon/") - # NOTE: When the emulator host is set, a custom channel will be used, so - # no credentials (mock ot otherwise) can be passed in. - client = subscriber.Client() - - # Establish that a gRPC request would attempt to hit the emulator host. - # - # Sadly, there seems to be no good way to do this without poking at - # the private API of gRPC. - channel = client.api.transport.pull._channel - assert channel.target().decode("utf8") == "/baz/bacon/" - - -def test_class_method_factory(): - patch = mock.patch( - "google.oauth2.service_account.Credentials.from_service_account_file" - ) - - with patch: - client = subscriber.Client.from_service_account_file("filename.json") - - assert isinstance(client, subscriber.Client) - - -@mock.patch( - "google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager." - "StreamingPullManager.open", - autospec=True, -) -def test_subscribe(manager_open): - creds = mock.Mock(spec=credentials.Credentials) - client = subscriber.Client(credentials=creds) - - future = client.subscribe("sub_name_a", callback=mock.sentinel.callback) - assert isinstance(future, futures.StreamingPullFuture) - - assert future._manager._subscription == "sub_name_a" - manager_open.assert_called_once_with( - mock.ANY, - callback=mock.sentinel.callback, - on_callback_error=future.set_exception, - ) - - -@mock.patch( - "google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager." - "StreamingPullManager.open", - autospec=True, -) -def test_subscribe_options(manager_open): - creds = mock.Mock(spec=credentials.Credentials) - client = subscriber.Client(credentials=creds) - flow_control = types.FlowControl(max_bytes=42) - scheduler = mock.sentinel.scheduler - - future = client.subscribe( - "sub_name_a", - callback=mock.sentinel.callback, - flow_control=flow_control, - scheduler=scheduler, - ) - assert isinstance(future, futures.StreamingPullFuture) - - assert future._manager._subscription == "sub_name_a" - assert future._manager.flow_control == flow_control - assert future._manager._scheduler == scheduler - manager_open.assert_called_once_with( - mock.ANY, - callback=mock.sentinel.callback, - on_callback_error=future.set_exception, - ) diff --git a/pubsub/tests/unit/pubsub_v1/test__gapic.py b/pubsub/tests/unit/pubsub_v1/test__gapic.py deleted file mode 100644 index 5478aee18213..000000000000 --- a/pubsub/tests/unit/pubsub_v1/test__gapic.py +++ /dev/null @@ -1,63 +0,0 @@ -# Copyright 2019 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. - - -from google.cloud.pubsub_v1 import _gapic - - -class SourceClass(object): - def __init__(self): - self.x = "x" - - def method(self): - return "source class instance method" - - @staticmethod - def static_method(): - return "source class static method" - - @classmethod - def class_method(cls): - return "source class class method" - - @classmethod - def blacklisted_method(cls): - return "source class blacklisted method" - - -def test_add_method(): - @_gapic.add_methods(SourceClass, ("blacklisted_method",)) - class Foo(object): - def __init__(self): - self.api = SourceClass() - - def method(self): - return "foo class instance method" - - foo = Foo() - - # Any method that's callable and not blacklisted is "inherited". - assert set(["method", "static_method", "class_method"]) <= set(dir(foo)) - assert "blacklisted_method" not in dir(foo) - - # Source Class's static and class methods become static methods. - assert type(Foo.__dict__["static_method"]) == staticmethod - assert foo.static_method() == "source class static method" - assert type(Foo.__dict__["class_method"]) == staticmethod - assert foo.class_method() == "source class class method" - - # The decorator changes the behavior of instance methods of the wrapped class. - # method() is called on an instance of the Source Class (stored as an - # attribute on the wrapped class). - assert foo.method() == "source class instance method" diff --git a/pubsub/tests/unit/pubsub_v1/test_futures.py b/pubsub/tests/unit/pubsub_v1/test_futures.py deleted file mode 100644 index 11349d5d480a..000000000000 --- a/pubsub/tests/unit/pubsub_v1/test_futures.py +++ /dev/null @@ -1,148 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -import threading - -import mock -import pytest - -from google.cloud.pubsub_v1 import exceptions -from google.cloud.pubsub_v1 import futures - - -def _future(*args, **kwargs): - return futures.Future(*args, **kwargs) - - -def test_constructor_defaults(): - with mock.patch.object(threading, "Event", autospec=True) as Event: - future = _future() - - assert future._result == futures.Future._SENTINEL - assert future._exception == futures.Future._SENTINEL - assert future._callbacks == [] - assert future._completed is Event.return_value - - Event.assert_called_once_with() - - -def test_constructor_explicit_completed(): - completed = mock.sentinel.completed - future = _future(completed=completed) - - assert future._result == futures.Future._SENTINEL - assert future._exception == futures.Future._SENTINEL - assert future._callbacks == [] - assert future._completed is completed - - -def test_cancel(): - assert _future().cancel() is False - - -def test_cancelled(): - assert _future().cancelled() is False - - -def test_running(): - future = _future() - assert future.running() is True - future.set_result("foobar") - assert future.running() is False - - -def test_done(): - future = _future() - assert future.done() is False - future.set_result("12345") - assert future.done() is True - - -def test_exception_no_error(): - future = _future() - future.set_result("12345") - assert future.exception() is None - - -def test_exception_with_error(): - future = _future() - error = RuntimeError("Something really bad happened.") - future.set_exception(error) - - # Make sure that the exception that is returned is the batch's error. - # Also check the type to ensure the batch's error did not somehow - # change internally. - assert future.exception() is error - assert isinstance(future.exception(), RuntimeError) - with pytest.raises(RuntimeError): - future.result() - - -def test_exception_timeout(): - future = _future() - with pytest.raises(exceptions.TimeoutError): - future.exception(timeout=0.01) - - -def test_result_no_error(): - future = _future() - future.set_result("42") - assert future.result() == "42" - - -def test_result_with_error(): - future = _future() - future.set_exception(RuntimeError("Something really bad happened.")) - with pytest.raises(RuntimeError): - future.result() - - -def test_add_done_callback_pending_batch(): - future = _future() - callback = mock.Mock() - future.add_done_callback(callback) - assert len(future._callbacks) == 1 - assert callback in future._callbacks - assert callback.call_count == 0 - - -def test_add_done_callback_completed_batch(): - future = _future() - future.set_result("12345") - callback = mock.Mock(spec=()) - future.add_done_callback(callback) - callback.assert_called_once_with(future) - - -def test_trigger(): - future = _future() - callback = mock.Mock(spec=()) - future.add_done_callback(callback) - assert callback.call_count == 0 - future.set_result("12345") - callback.assert_called_once_with(future) - - -def test_set_result_once_only(): - future = _future() - future.set_result("12345") - with pytest.raises(RuntimeError): - future.set_result("67890") - - -def test_set_exception_once_only(): - future = _future() - future.set_exception(ValueError("wah wah")) - with pytest.raises(RuntimeError): - future.set_exception(TypeError("other wah wah")) diff --git a/pubsub/tests/unit/test_pubsub.py b/pubsub/tests/unit/test_pubsub.py deleted file mode 100644 index 76d590a492c5..000000000000 --- a/pubsub/tests/unit/test_pubsub.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from google.cloud import pubsub -from google.cloud import pubsub_v1 - - -def test_exported_things(): - assert pubsub.PublisherClient is pubsub_v1.PublisherClient - assert pubsub.SubscriberClient is pubsub_v1.SubscriberClient - assert pubsub.types is pubsub_v1.types diff --git a/redis/.coveragerc b/redis/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/redis/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/redis/.flake8 b/redis/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/redis/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/redis/.repo-metadata.json b/redis/.repo-metadata.json deleted file mode 100644 index 7f7f221f15c4..000000000000 --- a/redis/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "redis", - "name_pretty": "Cloud Redis", - "product_documentation": "https://cloud.google.com/memorystore/docs/redis/", - "client_documentation": "https://googleapis.dev/python/redis/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5169231", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-redis", - "api_id": "redis.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/redis/CHANGELOG.md b/redis/CHANGELOG.md deleted file mode 100644 index 8813cf9e6471..000000000000 --- a/redis/CHANGELOG.md +++ /dev/null @@ -1,104 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-redis/#history - -## 0.3.0 - -07-24-2019 17:15 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8400](https://github.com/googleapis/google-cloud-python/pull/8400)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Remove unused message exports. ([#7272](https://github.com/googleapis/google-cloud-python/pull/7272)) -- Protoc-generated serialization update. ([#7092](https://github.com/googleapis/google-cloud-python/pull/7092)) -- Pick up stub docstring fix in GAPIC generator. ([#6979](https://github.com/googleapis/google-cloud-python/pull/6979)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8519](https://github.com/googleapis/google-cloud-python/pull/8519)) -- Add 'import_instance' / 'export_instance' support (via synth). ([#8220](https://github.com/googleapis/google-cloud-python/pull/8220)) -- Remove v1 'import_instance' / 'export_instance'; add v1beta1 'failover_instance' (via synth). ([#7937](https://github.com/googleapis/google-cloud-python/pull/7937)) -- Add support for instance import / export / failover (via synth). ([#7423](https://github.com/googleapis/google-cloud-python/pull/7423)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) -- Pin black version (via synth). ([#8592](https://github.com/googleapis/google-cloud-python/pull/8592)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Update year: 2018 -> 2019. ([#7154](https://github.com/googleapis/google-cloud-python/pull/7154)) - -### Internal / Testing Changes -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8360](https://github.com/googleapis/google-cloud-python/pull/8360)) -- Add disclaimer to auto-generated template files (via synth). ([#8324](https://github.com/googleapis/google-cloud-python/pull/8324)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8249](https://github.com/googleapis/google-cloud-python/pull/8249)) -- Fix coverage in 'types.py' (via synth). ([#8161](https://github.com/googleapis/google-cloud-python/pull/8161)) -- Blacken noxfile.py, setup.py (via synth). ([#8129](https://github.com/googleapis/google-cloud-python/pull/8129)) -- Add empty lines (via synth). ([#8068](https://github.com/googleapis/google-cloud-python/pull/8068)) -- Finsh setup for 'docs' session in nox. ([#8101](https://github.com/googleapis/google-cloud-python/pull/8101)) -- Use alabaster theme everwhere. ([#8021](https://github.com/googleapis/google-cloud-python/pull/8021)) -- Copy lintified proto files (via synth). -- Add clarifying comment to blacken nox target. ([#7400](https://github.com/googleapis/google-cloud-python/pull/7400)) -- Copy proto files alongside protoc versions. -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.2.1 - -12-18-2018 09:40 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes to GAPIC generator. ([#6504](https://github.com/googleapis/google-cloud-python/pull/6504)) -- Assorted synth fixups / cleanups ([#6400](https://github.com/googleapis/google-cloud-python/pull/6400)) -- Fix `client_info` bug, update docstrings. ([#6419](https://github.com/googleapis/google-cloud-python/pull/6419)) -- Re-generate library using redis/synth.py ([#6016](https://github.com/googleapis/google-cloud-python/pull/6016)) -- Re-generate library using redis/synth.py ([#5993](https://github.com/googleapis/google-cloud-python/pull/5993)) - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) - -### Internal / Testing Changes -- Add baseline for synth.metadata -- Update noxfile. -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Don't synth 'README.rst'. ([#6262](https://github.com/googleapis/google-cloud-python/pull/6262)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) - -## 0.2.0 - -### New Features - -- Add the v1 API client library. ([#5945](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5945)) - -### Documentation - -- Docs: Replace links to '/stable/' with '/latest/'. ([#5901](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5901)) -- Redis: Fix README.md links ([#5745](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5745)) -- Add redis documentation to main index.rst ([#5405](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5405)) - -### Internal / Testing Changes - -- Nox: use inplace installs ([#5865](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5865)) -- Avoid overwriting '__module__' of messages from shared modules. ([#5364](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5364)) -- Unit tests require grpcio. ([#5363](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5363)) - -## 0.1.0 - -### New Features -Initial version of Redis client library v1beta1. - diff --git a/redis/LICENSE b/redis/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/redis/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/redis/MANIFEST.in b/redis/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/redis/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/redis/README.rst b/redis/README.rst deleted file mode 100644 index e66a8716154a..000000000000 --- a/redis/README.rst +++ /dev/null @@ -1,88 +0,0 @@ -Python Client for Google Cloud Memorystore for Redis API -======================================================== - -|alpha| |pypi| |versions| - -`Google Cloud Memorystore for Redis API`_: The Google Cloud Memorystore for -Redis API is used for creating and managing Redis instances on the Google -Cloud Platform. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-redis.svg - :target: https://pypi.org/project/google-cloud-redis/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-redis.svg - :target: https://pypi.org/project/google-cloud-redis/ -.. _Google Cloud Memorystore for Redis API: https://cloud.google.com/memorystore/ -.. _Client Library Documentation: https://googleapis.dev/python/redis/latest -.. _Product Documentation: https://cloud.google.com/memorystore/ - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Memorystore for Redis API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Memorystore for Redis API.: https://console.cloud.google.com/apis/library/redis.googleapis.com -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-redis - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-redis - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Google Cloud Memorystore for - Redis API to see other available methods on the client. -- Read the `Product documentation`_ to learn more about the product and see - How-to Guides. diff --git a/redis/docs/README.rst b/redis/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/redis/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/redis/docs/_static/custom.css b/redis/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/redis/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/redis/docs/_templates/layout.html b/redis/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/redis/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/redis/docs/conf.py b/redis/docs/conf.py deleted file mode 100644 index 58e9db4665d2..000000000000 --- a/redis/docs/conf.py +++ /dev/null @@ -1,359 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-redis documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -# needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", "md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-redis" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-redis-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-redis.tex", - u"google-cloud-redis Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-automl", - u"google-cloud-automl Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-redis", - u"google-cloud-redis Documentation", - author, - "google-cloud-redis", - "GAPIC library for the {metadata.shortName} v1beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/redis/docs/gapic/v1/api.rst b/redis/docs/gapic/v1/api.rst deleted file mode 100644 index 50ad1f8a5f64..000000000000 --- a/redis/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Cloud Memorystore for Redis API -================================================= - -.. automodule:: google.cloud.redis_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/redis/docs/gapic/v1/types.rst b/redis/docs/gapic/v1/types.rst deleted file mode 100644 index ba92173ded8e..000000000000 --- a/redis/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Cloud Memorystore for Redis API Client -======================================================= - -.. automodule:: google.cloud.redis_v1.types - :members: \ No newline at end of file diff --git a/redis/docs/gapic/v1beta1/api.rst b/redis/docs/gapic/v1beta1/api.rst deleted file mode 100644 index b1505646c85c..000000000000 --- a/redis/docs/gapic/v1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Cloud Memorystore for Redis API -================================================= - -.. automodule:: google.cloud.redis_v1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/redis/docs/gapic/v1beta1/types.rst b/redis/docs/gapic/v1beta1/types.rst deleted file mode 100644 index 579707e712de..000000000000 --- a/redis/docs/gapic/v1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Cloud Memorystore for Redis API Client -======================================================= - -.. automodule:: google.cloud.redis_v1beta1.types - :members: \ No newline at end of file diff --git a/redis/docs/index.rst b/redis/docs/index.rst deleted file mode 100644 index 5338f59ab023..000000000000 --- a/redis/docs/index.rst +++ /dev/null @@ -1,11 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - gapic/v1beta1/api - gapic/v1beta1/types diff --git a/redis/google/__init__.py b/redis/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/redis/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/redis/google/cloud/__init__.py b/redis/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/redis/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/redis/google/cloud/redis.py b/redis/google/cloud/redis.py deleted file mode 100644 index b30f4a972845..000000000000 --- a/redis/google/cloud/redis.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.redis_v1 import CloudRedisClient -from google.cloud.redis_v1 import enums -from google.cloud.redis_v1 import types - - -__all__ = ("enums", "types", "CloudRedisClient") diff --git a/redis/google/cloud/redis_v1/__init__.py b/redis/google/cloud/redis_v1/__init__.py deleted file mode 100644 index 10c3f5080697..000000000000 --- a/redis/google/cloud/redis_v1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.redis_v1 import types -from google.cloud.redis_v1.gapic import cloud_redis_client -from google.cloud.redis_v1.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class CloudRedisClient(cloud_redis_client.CloudRedisClient): - __doc__ = cloud_redis_client.CloudRedisClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "CloudRedisClient") diff --git a/redis/google/cloud/redis_v1/gapic/__init__.py b/redis/google/cloud/redis_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1/gapic/cloud_redis_client.py b/redis/google/cloud/redis_v1/gapic/cloud_redis_client.py deleted file mode 100644 index 04621b9cf815..000000000000 --- a/redis/google/cloud/redis_v1/gapic/cloud_redis_client.py +++ /dev/null @@ -1,1031 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.redis.v1 CloudRedis API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.redis_v1.gapic import cloud_redis_client_config -from google.cloud.redis_v1.gapic import enums -from google.cloud.redis_v1.gapic.transports import cloud_redis_grpc_transport -from google.cloud.redis_v1.proto import cloud_redis_pb2 -from google.cloud.redis_v1.proto import cloud_redis_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-redis").version - - -class CloudRedisClient(object): - """ - Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1 - - The ``redis.googleapis.com`` service implements the Google Cloud - Memorystore for Redis API and defines the following resource model for - managing Redis instances: - - - The service works with a collection of cloud projects, named: - ``/projects/*`` - - Each project has a collection of available locations, named: - ``/locations/*`` - - Each location has a collection of Redis instances, named: - ``/instances/*`` - - As such, Redis instances are resources of the form: - ``/projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - - Note that location\_id must be referring to a GCP ``region``; for - example: - - - ``projects/redpepper-1290/locations/us-central1/instances/my-redis`` - """ - - SERVICE_ADDRESS = "redis.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.redis.v1.CloudRedis" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - CloudRedisClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def instance_path(cls, project, location, instance): - """Return a fully-qualified instance string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/instances/{instance}", - project=project, - location=location, - instance=instance, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.CloudRedisGrpcTransport, - Callable[[~.Credentials, type], ~.CloudRedisGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = cloud_redis_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=cloud_redis_grpc_transport.CloudRedisGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = cloud_redis_grpc_transport.CloudRedisGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_instances( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - - - ``projects/{project_id}/locations/{location_id}`` - - If ``location_id`` is specified as ``-`` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_instances(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_instances(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the instance location using the form: - ``projects/{project_id}/locations/{location_id}`` where ``location_id`` - refers to a GCP region. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.redis_v1.types.Instance` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_instances" not in self._inner_api_calls: - self._inner_api_calls[ - "list_instances" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_instances, - default_retry=self._method_configs["ListInstances"].retry, - default_timeout=self._method_configs["ListInstances"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ListInstancesRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_instances"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="instances", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_instance( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the details of a specific Redis instance. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.get_instance(name) - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types.Instance` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "get_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_instance, - default_retry=self._method_configs["GetInstance"].retry, - default_timeout=self._method_configs["GetInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.GetInstanceRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_instance( - self, - parent, - instance_id, - instance, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's `default - network `__. - - The creation is executed asynchronously and callers may check the - returned operation to track its progress. Once the operation is - completed the Redis instance will be fully functional. Completed - longrunning.Operation will contain the new instance object in the - response field. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1 - >>> from google.cloud.redis_v1 import enums - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> instance_id = 'test_instance' - >>> tier = enums.Instance.Tier.BASIC - >>> memory_size_gb = 1 - >>> instance = {'tier': tier, 'memory_size_gb': memory_size_gb} - >>> - >>> response = client.create_instance(parent, instance_id, instance) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The resource name of the instance location using the form: - ``projects/{project_id}/locations/{location_id}`` where ``location_id`` - refers to a GCP region. - instance_id (str): Required. The logical name of the Redis instance in the customer project - with the following restrictions: - - - Must contain only lowercase letters, numbers, and hyphens. - - Must start with a letter. - - Must be between 1-40 characters. - - Must end with a number or a letter. - - Must be unique within the customer project / location - instance (Union[dict, ~google.cloud.redis_v1.types.Instance]): Required. A Redis [Instance] resource - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1.types.Instance` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "create_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_instance, - default_retry=self._method_configs["CreateInstance"].retry, - default_timeout=self._method_configs["CreateInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.CreateInstanceRequest( - parent=parent, instance_id=instance_id, instance=instance - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) - - def update_instance( - self, - update_mask, - instance, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> paths_element = 'display_name' - >>> paths_element_2 = 'memory_size_gb' - >>> paths = [paths_element, paths_element_2] - >>> update_mask = {'paths': paths} - >>> display_name = ' instance.memory_size_gb=4' - >>> instance = {'display_name': display_name} - >>> - >>> response = client.update_instance(update_mask, instance) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - update_mask (Union[dict, ~google.cloud.redis_v1.types.FieldMask]): Required. Mask of fields to update. At least one path must be supplied - in this field. The elements of the repeated paths field may only include - these fields from ``Instance``: - - - ``displayName`` - - ``labels`` - - ``memorySizeGb`` - - ``redisConfig`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1.types.FieldMask` - instance (Union[dict, ~google.cloud.redis_v1.types.Instance]): Required. Update description. Only fields specified in update\_mask are - updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1.types.Instance` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "update_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_instance, - default_retry=self._method_configs["UpdateInstance"].retry, - default_timeout=self._method_configs["UpdateInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.UpdateInstanceRequest( - update_mask=update_mask, instance=instance - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("instance.name", instance.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["update_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) - - def import_instance( - self, - name, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> # TODO: Initialize `name`: - >>> name = '' - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_instance(name, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - input_config (Union[dict, ~google.cloud.redis_v1.types.InputConfig]): Required. Specify data to be imported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1.types.InputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "import_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_instance, - default_retry=self._method_configs["ImportInstance"].retry, - default_timeout=self._method_configs["ImportInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ImportInstanceRequest( - name=name, input_config=input_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) - - def export_instance( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> # TODO: Initialize `name`: - >>> name = '' - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_instance(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - output_config (Union[dict, ~google.cloud.redis_v1.types.OutputConfig]): Required. Specify data to be exported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1.types.OutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "export_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_instance, - default_retry=self._method_configs["ExportInstance"].retry, - default_timeout=self._method_configs["ExportInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ExportInstanceRequest( - name=name, output_config=output_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) - - def failover_instance( - self, - name, - data_protection_mode=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.failover_instance(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - data_protection_mode (~google.cloud.redis_v1.types.DataProtectionMode): Optional. Available data protection modes that the user can choose. If - it's unspecified, data protection mode will be LIMITED\_DATA\_LOSS by - default. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "failover_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "failover_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.failover_instance, - default_retry=self._method_configs["FailoverInstance"].retry, - default_timeout=self._method_configs["FailoverInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.FailoverInstanceRequest( - name=name, data_protection_mode=data_protection_mode - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["failover_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) - - def delete_instance( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a specific Redis instance. Instance stops serving and data is - deleted. - - Example: - >>> from google.cloud import redis_v1 - >>> - >>> client = redis_v1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.delete_instance(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_instance, - default_retry=self._method_configs["DeleteInstance"].retry, - default_timeout=self._method_configs["DeleteInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.DeleteInstanceRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=cloud_redis_pb2.OperationMetadata, - ) diff --git a/redis/google/cloud/redis_v1/gapic/cloud_redis_client_config.py b/redis/google/cloud/redis_v1/gapic/cloud_redis_client_config.py deleted file mode 100644 index 9d0264891f0b..000000000000 --- a/redis/google/cloud/redis_v1/gapic/cloud_redis_client_config.py +++ /dev/null @@ -1,63 +0,0 @@ -config = { - "interfaces": { - "google.cloud.redis.v1.CloudRedis": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ImportInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/redis/google/cloud/redis_v1/gapic/enums.py b/redis/google/cloud/redis_v1/gapic/enums.py deleted file mode 100644 index d5a628a8cab5..000000000000 --- a/redis/google/cloud/redis_v1/gapic/enums.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class FailoverInstanceRequest(object): - class DataProtectionMode(enum.IntEnum): - """ - Attributes: - DATA_PROTECTION_MODE_UNSPECIFIED (int): Defaults to LIMITED\_DATA\_LOSS if a data protection mode is not - specified. - LIMITED_DATA_LOSS (int): Instance failover will be protected with data loss control. More - specifically, the failover will only be performed if the current - replication offset diff between master and replica is under a certain - threshold. - FORCE_DATA_LOSS (int): Instance failover will be performed without data loss control. - """ - - DATA_PROTECTION_MODE_UNSPECIFIED = 0 - LIMITED_DATA_LOSS = 1 - FORCE_DATA_LOSS = 2 - - -class Instance(object): - class State(enum.IntEnum): - """ - Represents the different states of a Redis instance. - - Attributes: - STATE_UNSPECIFIED (int): Not set. - CREATING (int): Redis instance is being created. - READY (int): Redis instance has been created and is fully usable. - UPDATING (int): Redis instance configuration is being updated. Certain kinds of updates - may cause the instance to become unusable while the update is in - progress. - DELETING (int): Redis instance is being deleted. - REPAIRING (int): Redis instance is being repaired and may be unusable. - MAINTENANCE (int): Maintenance is being performed on this Redis instance. - IMPORTING (int): Redis instance is importing data (availability may be affected). - FAILING_OVER (int): Redis instance is failing over (availability may be affected). - """ - - STATE_UNSPECIFIED = 0 - CREATING = 1 - READY = 2 - UPDATING = 3 - DELETING = 4 - REPAIRING = 5 - MAINTENANCE = 6 - IMPORTING = 8 - FAILING_OVER = 9 - - class Tier(enum.IntEnum): - """ - Available service tiers to choose from - - Attributes: - TIER_UNSPECIFIED (int): Not set. - BASIC (int): BASIC tier: standalone instance - STANDARD_HA (int): STANDARD\_HA tier: highly available primary/replica instances - """ - - TIER_UNSPECIFIED = 0 - BASIC = 1 - STANDARD_HA = 3 diff --git a/redis/google/cloud/redis_v1/gapic/transports/__init__.py b/redis/google/cloud/redis_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1/gapic/transports/cloud_redis_grpc_transport.py b/redis/google/cloud/redis_v1/gapic/transports/cloud_redis_grpc_transport.py deleted file mode 100644 index 3cb1ef684dea..000000000000 --- a/redis/google/cloud/redis_v1/gapic/transports/cloud_redis_grpc_transport.py +++ /dev/null @@ -1,256 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.redis_v1.proto import cloud_redis_pb2_grpc - - -class CloudRedisGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.redis.v1 CloudRedis API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="redis.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"cloud_redis_stub": cloud_redis_pb2_grpc.CloudRedisStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="redis.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_instances(self): - """Return the gRPC stub for :meth:`CloudRedisClient.list_instances`. - - Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - - - ``projects/{project_id}/locations/{location_id}`` - - If ``location_id`` is specified as ``-`` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ListInstances - - @property - def get_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.get_instance`. - - Gets the details of a specific Redis instance. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].GetInstance - - @property - def create_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.create_instance`. - - Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's `default - network `__. - - The creation is executed asynchronously and callers may check the - returned operation to track its progress. Once the operation is - completed the Redis instance will be fully functional. Completed - longrunning.Operation will contain the new instance object in the - response field. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].CreateInstance - - @property - def update_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.update_instance`. - - Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].UpdateInstance - - @property - def import_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.import_instance`. - - Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ImportInstance - - @property - def export_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.export_instance`. - - Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ExportInstance - - @property - def failover_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.failover_instance`. - - Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].FailoverInstance - - @property - def delete_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.delete_instance`. - - Deletes a specific Redis instance. Instance stops serving and data is - deleted. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].DeleteInstance diff --git a/redis/google/cloud/redis_v1/proto/__init__.py b/redis/google/cloud/redis_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1/proto/cloud_redis.proto b/redis/google/cloud/redis_v1/proto/cloud_redis.proto deleted file mode 100644 index 1c9cd495da6e..000000000000 --- a/redis/google/cloud/redis_v1/proto/cloud_redis.proto +++ /dev/null @@ -1,579 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.redis.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1;redis"; -option java_multiple_files = true; -option java_outer_classname = "CloudRedisServiceV1Proto"; -option java_package = "com.google.cloud.redis.v1"; - -// Configures and manages Cloud Memorystore for Redis instances -// -// Google Cloud Memorystore for Redis v1 -// -// The `redis.googleapis.com` service implements the Google Cloud Memorystore -// for Redis API and defines the following resource model for managing Redis -// instances: -// * The service works with a collection of cloud projects, named: `/projects/*` -// * Each project has a collection of available locations, named: `/locations/*` -// * Each location has a collection of Redis instances, named: `/instances/*` -// * As such, Redis instances are resources of the form: -// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` -// -// Note that location_id must be referring to a GCP `region`; for example: -// * `projects/redpepper-1290/locations/us-central1/instances/my-redis` -service CloudRedis { - option (google.api.default_host) = "redis.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all Redis instances owned by a project in either the specified - // location (region) or all locations. - // - // The location should have the following format: - // * `projects/{project_id}/locations/{location_id}` - // - // If `location_id` is specified as `-` (wildcard), then all regions - // available to the project are queried, and the results are aggregated. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets the details of a specific Redis instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a Redis instance based on the specified tier and memory size. - // - // By default, the instance is accessible from the project's - // [default network](/compute/docs/networks-and-firewalls#networks). - // - // The creation is executed asynchronously and callers may check the returned - // operation to track its progress. Once the operation is completed the Redis - // instance will be fully functional. Completed longrunning.Operation will - // contain the new instance object in the response field. - // - // The returned operation is automatically deleted after a few hours, so there - // is no need to call DeleteOperation. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance_id,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1.Instance" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } - - // Updates the metadata and configuration of a specific Redis instance. - // - // Completed longrunning.Operation will contain the new instance object - // in the response field. The returned operation is automatically deleted - // after a few hours, so there is no need to call DeleteOperation. - rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{instance.name=projects/*/locations/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "update_mask,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1.Instance" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } - - // Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - // - // Redis may stop serving during this operation. Instance state will be - // IMPORTING for entire operation. When complete, the instance will contain - // only data from the imported file. - // - // The returned operation is automatically deleted after a few hours, so - // there is no need to call DeleteOperation. - rpc ImportInstance(ImportInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/instances/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,input_config"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1.Instance" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } - - // Export Redis instance data into a Redis RDB format file in Cloud Storage. - // - // Redis will continue serving during this operation. - // - // The returned operation is automatically deleted after a few hours, so - // there is no need to call DeleteOperation. - rpc ExportInstance(ExportInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/instances/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,output_config"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1.Instance" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } - - // Initiates a failover of the master node to current replica node for a - // specific STANDARD tier Cloud Memorystore for Redis instance. - rpc FailoverInstance(FailoverInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/instances/*}:failover" - body: "*" - }; - option (google.api.method_signature) = "name,data_protection_mode"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1.Instance" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } - - // Deletes a specific Redis instance. Instance stops serving and data is - // deleted. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.cloud.redis.v1.OperationMetadata" - }; - } -} - -// A Google Cloud Redis instance. -message Instance { - option (google.api.resource) = { - type: "redis.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/instances/{instance}" - }; - - // Represents the different states of a Redis instance. - enum State { - // Not set. - STATE_UNSPECIFIED = 0; - - // Redis instance is being created. - CREATING = 1; - - // Redis instance has been created and is fully usable. - READY = 2; - - // Redis instance configuration is being updated. Certain kinds of updates - // may cause the instance to become unusable while the update is in - // progress. - UPDATING = 3; - - // Redis instance is being deleted. - DELETING = 4; - - // Redis instance is being repaired and may be unusable. - REPAIRING = 5; - - // Maintenance is being performed on this Redis instance. - MAINTENANCE = 6; - - // Redis instance is importing data (availability may be affected). - IMPORTING = 8; - - // Redis instance is failing over (availability may be affected). - FAILING_OVER = 9; - } - - // Available service tiers to choose from - enum Tier { - // Not set. - TIER_UNSPECIFIED = 0; - - // BASIC tier: standalone instance - BASIC = 1; - - // STANDARD_HA tier: highly available primary/replica instances - STANDARD_HA = 3; - } - - // Required. Unique name of the resource in this scope including project and - // location using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // - // Note: Redis instances are managed and addressed at regional level so - // location_id here refers to a GCP region; however, users may choose which - // specific zone (or collection of zones for cross-zone instances) an instance - // should be provisioned in. Refer to [location_id] and - // [alternative_location_id] fields for more details. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // An arbitrary and optional user-provided name for the instance. - string display_name = 2; - - // Resource labels to represent user provided metadata - map labels = 3; - - // Optional. The zone where the instance will be provisioned. If not provided, - // the service will choose a zone for the instance. For STANDARD_HA tier, - // instances will be created across two zones for protection against zonal - // failures. If [alternative_location_id] is also provided, it must be - // different from [location_id]. - string location_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only applicable to STANDARD_HA tier which protects the instance - // against zonal failures by provisioning it across two zones. If provided, it - // must be a different zone from the one provided in [location_id]. - string alternative_location_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The version of Redis software. - // If not provided, latest supported version will be used. Updating the - // version will perform an upgrade/downgrade to the new version. Currently, - // the supported values are: - // - // * `REDIS_4_0` for Redis 4.0 compatibility (default) - // * `REDIS_3_2` for Redis 3.2 compatibility - string redis_version = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR range of internal addresses that are reserved for this - // instance. If not provided, the service will choose an unused /29 block, - // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - // and non-overlapping with existing subnets in an authorized network. - string reserved_ip_range = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Hostname or IP address of the exposed Redis endpoint used by - // clients to connect to the service. - string host = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The port number of the exposed Redis endpoint. - int32 port = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current zone where the Redis endpoint is placed. For Basic - // Tier instances, this will always be the same as the [location_id] - // provided by the user at creation time. For Standard Tier instances, - // this can be either [location_id] or [alternative_location_id] and can - // change after a failover event. - string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of this instance. - State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional information about the current status of this - // instance, if available. - string status_message = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Redis configuration parameters, according to - // http://redis.io/topics/config. Currently, the only supported parameters - // are: - // - // Redis 3.2 and above: - // - // * maxmemory-policy - // * notify-keyspace-events - // - // Redis 4.0 and above: - // - // * activedefrag - // * lfu-log-factor - // * lfu-decay-time - map redis_configs = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The service tier of the instance. - Tier tier = 17 [(google.api.field_behavior) = REQUIRED]; - - // Required. Redis memory size in GiB. - int32 memory_size_gb = 18 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The full name of the Google Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // instance is connected. If left unspecified, the `default` network - // will be used. - string authorized_network = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Cloud IAM identity used by import / export operations to - // transfer data to/from Cloud Storage. Format is - // "serviceAccount:". The value may change over time - // for a given instance so should be checked before each import/export - // operation. - string persistence_iam_identity = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. -message ListInstancesRequest { - // Required. The resource name of the instance location using the form: - // `projects/{project_id}/locations/{location_id}` - // where `location_id` refers to a GCP region. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of items to return. - // - // If not specified, a default value of 1000 will be used by the service. - // Regardless of the page_size value, the response may include a partial list - // and a caller should only rely on response's - // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token] - // to determine if there are more instances left to be queried. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, - // if any. - string page_token = 3; -} - -// Response for [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. -message ListInstancesResponse { - // A list of Redis instances in the project in the specified location, - // or across all locations. - // - // If the `location_id` in the parent field of the request is "-", all regions - // available to the project are queried, and the results aggregated. - // If in such an aggregated query a location is unavailable, a dummy Redis - // entry is included in the response with the "name" field set to a value of - // the form projects/{project_id}/locations/{location_id}/instances/- and the - // "status" field set to ERROR and "status_message" field set to "location not - // available for ListInstances". - repeated Instance instances = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance]. -message GetInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; -} - -// Request for [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance]. -message CreateInstanceRequest { - // Required. The resource name of the instance location using the form: - // `projects/{project_id}/locations/{location_id}` - // where `location_id` refers to a GCP region. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The logical name of the Redis instance in the customer project - // with the following restrictions: - // - // * Must contain only lowercase letters, numbers, and hyphens. - // * Must start with a letter. - // * Must be between 1-40 characters. - // * Must end with a number or a letter. - // * Must be unique within the customer project / location - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A Redis [Instance] resource - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance]. -message UpdateInstanceRequest { - // Required. Mask of fields to update. At least one path must be supplied in - // this field. The elements of the repeated paths field may only include these - // fields from [Instance][CloudRedis.Instance]: - // - // * `displayName` - // * `labels` - // * `memorySizeGb` - // * `redisConfig` - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Update description. - // Only fields specified in update_mask are updated. - Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance]. -message DeleteInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; -} - -// The Cloud Storage location for the input content -message GcsSource { - // Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The input content -message InputConfig { - // Required. Specify source location of input data - oneof source { - // Google Cloud Storage location where input content is located. - GcsSource gcs_source = 1; - } -} - -// Request for [Import][google.cloud.redis.v1.CloudRedis.ImportInstance]. -message ImportInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify data to be imported. - InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The Cloud Storage location for the output content -message GcsDestination { - // Required. Data destination URI (e.g. - // 'gs://my_bucket/my_object'). Existing files will be overwritten. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The output content -message OutputConfig { - // Required. Specify destination location of output data - oneof destination { - // Google Cloud Storage destination for output content. - GcsDestination gcs_destination = 1; - } -} - -// Request for [Export][google.cloud.redis.v1.CloudRedis.ExportInstance]. -message ExportInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify data to be exported. - OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance]. -message FailoverInstanceRequest { - enum DataProtectionMode { - // Defaults to LIMITED_DATA_LOSS if a data protection mode is not - // specified. - DATA_PROTECTION_MODE_UNSPECIFIED = 0; - - // Instance failover will be protected with data loss control. More - // specifically, the failover will only be performed if the current - // replication offset diff between master and replica is under a certain - // threshold. - LIMITED_DATA_LOSS = 1; - - // Instance failover will be performed without data loss control. - FORCE_DATA_LOSS = 2; - } - - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; - - // Optional. Available data protection modes that the user can choose. If it's - // unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - DataProtectionMode data_protection_mode = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Represents the v1 metadata of the long-running operation. -message OperationMetadata { - // Creation timestamp. - google.protobuf.Timestamp create_time = 1; - - // End timestamp. - google.protobuf.Timestamp end_time = 2; - - // Operation target. - string target = 3; - - // Operation verb. - string verb = 4; - - // Operation status details. - string status_detail = 5; - - // Specifies if cancellation was requested for the operation. - bool cancel_requested = 6; - - // API version. - string api_version = 7; -} - -// This location metadata represents additional configuration options for a -// given location where a Redis instance may be created. All fields are output -// only. It is returned as content of the -// `google.cloud.location.Location.metadata` field. -message LocationMetadata { - // Output only. The set of available zones in the location. The map is keyed - // by the lowercase ID of each zone, as defined by GCE. These keys can be - // specified in `location_id` or `alternative_location_id` fields when - // creating a Redis instance. - map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Defines specific information for a particular zone. Currently empty and -// reserved for future use only. -message ZoneMetadata { - -} diff --git a/redis/google/cloud/redis_v1/proto/cloud_redis_pb2.py b/redis/google/cloud/redis_v1/proto/cloud_redis_pb2.py deleted file mode 100644 index fc6e1400e0b4..000000000000 --- a/redis/google/cloud/redis_v1/proto/cloud_redis_pb2.py +++ /dev/null @@ -1,2313 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis_v1/proto/cloud_redis.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/redis_v1/proto/cloud_redis.proto", - package="google.cloud.redis.v1", - syntax="proto3", - serialized_options=_b( - "\n\031com.google.cloud.redis.v1B\030CloudRedisServiceV1ProtoP\001Z:google.golang.org/genproto/googleapis/cloud/redis/v1;redis" - ), - serialized_pb=_b( - '\n-google/cloud/redis_v1/proto/cloud_redis.proto\x12\x15google.cloud.redis.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xc6\x08\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12;\n\x06labels\x18\x03 \x03(\x0b\x32+.google.cloud.redis.v1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x39\n\x05state\x18\x0e \x01(\x0e\x32%.google.cloud.redis.v1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12M\n\rredis_configs\x18\x10 \x03(\x0b\x32\x31.google.cloud.redis.v1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12\x37\n\x04tier\x18\x11 \x01(\x0e\x32$.google.cloud.redis.v1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\t"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12\x82\xd3\xe4\x93\x02/\x12-/v1/{parent=projects/*/locations/*}/instances\xda\x41\x06parent\x12\x97\x01\n\x0bGetInstance\x12).google.cloud.redis.v1.GetInstanceRequest\x1a\x1f.google.cloud.redis.v1.Instance"<\x82\xd3\xe4\x93\x02/\x12-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\x12\x89\x02\n\x0e\x43reateInstance\x12,.google.cloud.redis.v1.CreateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02\x39"-/v1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8b\x02\n\x0eUpdateInstance\x12,.google.cloud.redis.v1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xab\x01\x82\xd3\xe4\x93\x02\x42\x32\x36/v1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xff\x01\n\x0eImportInstance\x12,.google.cloud.redis.v1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x80\x02\n\x0e\x45xportInstance\x12,.google.cloud.redis.v1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa0\x01\x82\xd3\xe4\x93\x02\x39"4/v1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\x8d\x02\n\x10\x46\x61iloverInstance\x12..google.cloud.redis.v1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa9\x01\x82\xd3\xe4\x93\x02;"6/v1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41I\n\x1egoogle.cloud.redis.v1.Instance\x12\'google.cloud.redis.v1.OperationMetadata\x12\xde\x01\n\x0e\x44\x65leteInstance\x12,.google.cloud.redis.v1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"\x7f\x82\xd3\xe4\x93\x02/*-/v1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41@\n\x15google.protobuf.Empty\x12\'google.cloud.redis.v1.OperationMetadata\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBs\n\x19\x63om.google.cloud.redis.v1B\x18\x43loudRedisServiceV1ProtoP\x01Z:google.golang.org/genproto/googleapis/cloud/redis/v1;redisb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_INSTANCE_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.redis.v1.Instance.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="READY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPDATING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DELETING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="REPAIRING", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MAINTENANCE", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IMPORTING", index=7, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILING_OVER", index=8, number=9, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1082, - serialized_end=1230, -) -_sym_db.RegisterEnumDescriptor(_INSTANCE_STATE) - -_INSTANCE_TIER = _descriptor.EnumDescriptor( - name="Tier", - full_name="google.cloud.redis.v1.Instance.Tier", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TIER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BASIC", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STANDARD_HA", index=2, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1232, - serialized_end=1288, -) -_sym_db.RegisterEnumDescriptor(_INSTANCE_TIER) - -_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE = _descriptor.EnumDescriptor( - name="DataProtectionMode", - full_name="google.cloud.redis.v1.FailoverInstanceRequest.DataProtectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DATA_PROTECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LIMITED_DATA_LOSS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FORCE_DATA_LOSS", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2733, - serialized_end=2835, -) -_sym_db.RegisterEnumDescriptor(_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE) - - -_INSTANCE_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.redis.v1.Instance.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.redis.v1.Instance.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.redis.v1.Instance.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1026, -) - -_INSTANCE_REDISCONFIGSENTRY = _descriptor.Descriptor( - name="RedisConfigsEntry", - full_name="google.cloud.redis.v1.Instance.RedisConfigsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.redis.v1.Instance.RedisConfigsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.redis.v1.Instance.RedisConfigsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1028, - serialized_end=1079, -) - -_INSTANCE = _descriptor.Descriptor( - name="Instance", - full_name="google.cloud.redis.v1.Instance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.redis.v1.Instance.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.redis.v1.Instance.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.redis.v1.Instance.labels", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.redis.v1.Instance.location_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="alternative_location_id", - full_name="google.cloud.redis.v1.Instance.alternative_location_id", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="redis_version", - full_name="google.cloud.redis.v1.Instance.redis_version", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reserved_ip_range", - full_name="google.cloud.redis.v1.Instance.reserved_ip_range", - index=6, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="host", - full_name="google.cloud.redis.v1.Instance.host", - index=7, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="port", - full_name="google.cloud.redis.v1.Instance.port", - index=8, - number=11, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current_location_id", - full_name="google.cloud.redis.v1.Instance.current_location_id", - index=9, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.redis.v1.Instance.create_time", - index=10, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.redis.v1.Instance.state", - index=11, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.cloud.redis.v1.Instance.status_message", - index=12, - number=15, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="redis_configs", - full_name="google.cloud.redis.v1.Instance.redis_configs", - index=13, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tier", - full_name="google.cloud.redis.v1.Instance.tier", - index=14, - number=17, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="memory_size_gb", - full_name="google.cloud.redis.v1.Instance.memory_size_gb", - index=15, - number=18, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="authorized_network", - full_name="google.cloud.redis.v1.Instance.authorized_network", - index=16, - number=20, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="persistence_iam_identity", - full_name="google.cloud.redis.v1.Instance.persistence_iam_identity", - index=17, - number=21, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_INSTANCE_LABELSENTRY, _INSTANCE_REDISCONFIGSENTRY], - enum_types=[_INSTANCE_STATE, _INSTANCE_TIER], - serialized_options=_b( - "\352A]\n\035redis.googleapis.com/Instance\022`__ to which - the instance is connected. If left unspecified, the - ``default`` network will be used. - persistence_iam_identity: - Output only. Cloud IAM identity used by import / export - operations to transfer data to/from Cloud Storage. Format is - "serviceAccount:". The value may change over time for a given - instance so should be checked before each import/export - operation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.Instance) - ), -) -_sym_db.RegisterMessage(Instance) -_sym_db.RegisterMessage(Instance.LabelsEntry) -_sym_db.RegisterMessage(Instance.RedisConfigsEntry) - -ListInstancesRequest = _reflection.GeneratedProtocolMessageType( - "ListInstancesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTANCESREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. - - - Attributes: - parent: - Required. The resource name of the instance location using the - form: ``projects/{project_id}/locations/{location_id}`` where - ``location_id`` refers to a GCP region. - page_size: - The maximum number of items to return. If not specified, a - default value of 1000 will be used by the service. Regardless - of the page\_size value, the response may include a partial - list and a caller should only rely on response's [next\_page\_ - token][CloudRedis.ListInstancesResponse.next\_page\_token] to - determine if there are more instances left to be queried. - page_token: - The next\_page\_token value returned from a previous List - request, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ListInstancesRequest) - ), -) -_sym_db.RegisterMessage(ListInstancesRequest) - -ListInstancesResponse = _reflection.GeneratedProtocolMessageType( - "ListInstancesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTANCESRESPONSE, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Response for - [ListInstances][google.cloud.redis.v1.CloudRedis.ListInstances]. - - - Attributes: - instances: - A list of Redis instances in the project in the specified - location, or across all locations. If the ``location_id`` in - the parent field of the request is "-", all regions available - to the project are queried, and the results aggregated. If in - such an aggregated query a location is unavailable, a dummy - Redis entry is included in the response with the "name" field - set to a value of the form - projects/{project\_id}/locations/{location\_id}/instances/- - and the "status" field set to ERROR and "status\_message" - field set to "location not available for ListInstances". - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - unreachable: - Locations that could not be reached. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ListInstancesResponse) - ), -) -_sym_db.RegisterMessage(ListInstancesResponse) - -GetInstanceRequest = _reflection.GeneratedProtocolMessageType( - "GetInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [GetInstance][google.cloud.redis.v1.CloudRedis.GetInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.GetInstanceRequest) - ), -) -_sym_db.RegisterMessage(GetInstanceRequest) - -CreateInstanceRequest = _reflection.GeneratedProtocolMessageType( - "CreateInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [CreateInstance][google.cloud.redis.v1.CloudRedis.CreateInstance]. - - - Attributes: - parent: - Required. The resource name of the instance location using the - form: ``projects/{project_id}/locations/{location_id}`` where - ``location_id`` refers to a GCP region. - instance_id: - Required. The logical name of the Redis instance in the - customer project with the following restrictions: - Must - contain only lowercase letters, numbers, and hyphens. - Must - start with a letter. - Must be between 1-40 characters. - - Must end with a number or a letter. - Must be unique within - the customer project / location - instance: - Required. A Redis [Instance] resource - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.CreateInstanceRequest) - ), -) -_sym_db.RegisterMessage(CreateInstanceRequest) - -UpdateInstanceRequest = _reflection.GeneratedProtocolMessageType( - "UpdateInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [UpdateInstance][google.cloud.redis.v1.CloudRedis.UpdateInstance]. - - - Attributes: - update_mask: - Required. Mask of fields to update. At least one path must be - supplied in this field. The elements of the repeated paths - field may only include these fields from - [Instance][CloudRedis.Instance]: - ``displayName`` - - ``labels`` - ``memorySizeGb`` - ``redisConfig`` - instance: - Required. Update description. Only fields specified in - update\_mask are updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.UpdateInstanceRequest) - ), -) -_sym_db.RegisterMessage(UpdateInstanceRequest) - -DeleteInstanceRequest = _reflection.GeneratedProtocolMessageType( - "DeleteInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [DeleteInstance][google.cloud.redis.v1.CloudRedis.DeleteInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.DeleteInstanceRequest) - ), -) -_sym_db.RegisterMessage(DeleteInstanceRequest) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""The Cloud Storage location for the input content - - - Attributes: - uri: - Required. Source data URI. (e.g. - 'gs://my\_bucket/my\_object'). - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""The input content - - - Attributes: - source: - Required. Specify source location of input data - gcs_source: - Google Cloud Storage location where input content is located. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -ImportInstanceRequest = _reflection.GeneratedProtocolMessageType( - "ImportInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [Import][google.cloud.redis.v1.CloudRedis.ImportInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - input_config: - Required. Specify data to be imported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ImportInstanceRequest) - ), -) -_sym_db.RegisterMessage(ImportInstanceRequest) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""The Cloud Storage location for the output content - - - Attributes: - uri: - Required. Data destination URI (e.g. - 'gs://my\_bucket/my\_object'). Existing files will be - overwritten. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""The output content - - - Attributes: - destination: - Required. Specify destination location of output data - gcs_destination: - Google Cloud Storage destination for output content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -ExportInstanceRequest = _reflection.GeneratedProtocolMessageType( - "ExportInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [Export][google.cloud.redis.v1.CloudRedis.ExportInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - output_config: - Required. Specify data to be exported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ExportInstanceRequest) - ), -) -_sym_db.RegisterMessage(ExportInstanceRequest) - -FailoverInstanceRequest = _reflection.GeneratedProtocolMessageType( - "FailoverInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_FAILOVERINSTANCEREQUEST, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Request for - [Failover][google.cloud.redis.v1.CloudRedis.FailoverInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - data_protection_mode: - Optional. Available data protection modes that the user can - choose. If it's unspecified, data protection mode will be - LIMITED\_DATA\_LOSS by default. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.FailoverInstanceRequest) - ), -) -_sym_db.RegisterMessage(FailoverInstanceRequest) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Represents the v1 metadata of the long-running operation. - - - Attributes: - create_time: - Creation timestamp. - end_time: - End timestamp. - target: - Operation target. - verb: - Operation verb. - status_detail: - Operation status details. - cancel_requested: - Specifies if cancellation was requested for the operation. - api_version: - API version. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - -LocationMetadata = _reflection.GeneratedProtocolMessageType( - "LocationMetadata", - (_message.Message,), - dict( - AvailableZonesEntry=_reflection.GeneratedProtocolMessageType( - "AvailableZonesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONMETADATA_AVAILABLEZONESENTRY, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.LocationMetadata.AvailableZonesEntry) - ), - ), - DESCRIPTOR=_LOCATIONMETADATA, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""This location metadata represents additional configuration - options for a given location where a Redis instance may be created. All - fields are output only. It is returned as content of the - ``google.cloud.location.Location.metadata`` field. - - - Attributes: - available_zones: - Output only. The set of available zones in the location. The - map is keyed by the lowercase ID of each zone, as defined by - GCE. These keys can be specified in ``location_id`` or - ``alternative_location_id`` fields when creating a Redis - instance. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.LocationMetadata) - ), -) -_sym_db.RegisterMessage(LocationMetadata) -_sym_db.RegisterMessage(LocationMetadata.AvailableZonesEntry) - -ZoneMetadata = _reflection.GeneratedProtocolMessageType( - "ZoneMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_ZONEMETADATA, - __module__="google.cloud.redis_v1.proto.cloud_redis_pb2", - __doc__="""Defines specific information for a particular zone. - Currently empty and reserved for future use only. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1.ZoneMetadata) - ), -) -_sym_db.RegisterMessage(ZoneMetadata) - - -DESCRIPTOR._options = None -_INSTANCE_LABELSENTRY._options = None -_INSTANCE_REDISCONFIGSENTRY._options = None -_INSTANCE.fields_by_name["name"]._options = None -_INSTANCE.fields_by_name["location_id"]._options = None -_INSTANCE.fields_by_name["alternative_location_id"]._options = None -_INSTANCE.fields_by_name["redis_version"]._options = None -_INSTANCE.fields_by_name["reserved_ip_range"]._options = None -_INSTANCE.fields_by_name["host"]._options = None -_INSTANCE.fields_by_name["port"]._options = None -_INSTANCE.fields_by_name["current_location_id"]._options = None -_INSTANCE.fields_by_name["create_time"]._options = None -_INSTANCE.fields_by_name["state"]._options = None -_INSTANCE.fields_by_name["status_message"]._options = None -_INSTANCE.fields_by_name["redis_configs"]._options = None -_INSTANCE.fields_by_name["tier"]._options = None -_INSTANCE.fields_by_name["memory_size_gb"]._options = None -_INSTANCE.fields_by_name["authorized_network"]._options = None -_INSTANCE.fields_by_name["persistence_iam_identity"]._options = None -_INSTANCE._options = None -_LISTINSTANCESREQUEST.fields_by_name["parent"]._options = None -_GETINSTANCEREQUEST.fields_by_name["name"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["parent"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["instance_id"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["instance"]._options = None -_UPDATEINSTANCEREQUEST.fields_by_name["update_mask"]._options = None -_UPDATEINSTANCEREQUEST.fields_by_name["instance"]._options = None -_DELETEINSTANCEREQUEST.fields_by_name["name"]._options = None -_GCSSOURCE.fields_by_name["uri"]._options = None -_IMPORTINSTANCEREQUEST.fields_by_name["name"]._options = None -_IMPORTINSTANCEREQUEST.fields_by_name["input_config"]._options = None -_GCSDESTINATION.fields_by_name["uri"]._options = None -_EXPORTINSTANCEREQUEST.fields_by_name["name"]._options = None -_EXPORTINSTANCEREQUEST.fields_by_name["output_config"]._options = None -_FAILOVERINSTANCEREQUEST.fields_by_name["name"]._options = None -_FAILOVERINSTANCEREQUEST.fields_by_name["data_protection_mode"]._options = None -_LOCATIONMETADATA_AVAILABLEZONESENTRY._options = None -_LOCATIONMETADATA.fields_by_name["available_zones"]._options = None - -_CLOUDREDIS = _descriptor.ServiceDescriptor( - name="CloudRedis", - full_name="google.cloud.redis.v1.CloudRedis", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\024redis.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=3275, - serialized_end=5240, - methods=[ - _descriptor.MethodDescriptor( - name="ListInstances", - full_name="google.cloud.redis.v1.CloudRedis.ListInstances", - index=0, - containing_service=None, - input_type=_LISTINSTANCESREQUEST, - output_type=_LISTINSTANCESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002/\022-/v1/{parent=projects/*/locations/*}/instances\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetInstance", - full_name="google.cloud.redis.v1.CloudRedis.GetInstance", - index=1, - containing_service=None, - input_type=_GETINSTANCEREQUEST, - output_type=_INSTANCE, - serialized_options=_b( - "\202\323\344\223\002/\022-/v1/{name=projects/*/locations/*/instances/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateInstance", - full_name="google.cloud.redis.v1.CloudRedis.CreateInstance", - index=2, - containing_service=None, - input_type=_CREATEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0029\"-/v1/{parent=projects/*/locations/*}/instances:\010instance\332A\033parent,instance_id,instance\312AI\n\036google.cloud.redis.v1.Instance\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateInstance", - full_name="google.cloud.redis.v1.CloudRedis.UpdateInstance", - index=3, - containing_service=None, - input_type=_UPDATEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002B26/v1/{instance.name=projects/*/locations/*/instances/*}:\010instance\332A\024update_mask,instance\312AI\n\036google.cloud.redis.v1.Instance\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - _descriptor.MethodDescriptor( - name="ImportInstance", - full_name="google.cloud.redis.v1.CloudRedis.ImportInstance", - index=4, - containing_service=None, - input_type=_IMPORTINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0029\"4/v1/{name=projects/*/locations/*/instances/*}:import:\001*\332A\021name,input_config\312AI\n\036google.cloud.redis.v1.Instance\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - _descriptor.MethodDescriptor( - name="ExportInstance", - full_name="google.cloud.redis.v1.CloudRedis.ExportInstance", - index=5, - containing_service=None, - input_type=_EXPORTINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0029\"4/v1/{name=projects/*/locations/*/instances/*}:export:\001*\332A\022name,output_config\312AI\n\036google.cloud.redis.v1.Instance\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - _descriptor.MethodDescriptor( - name="FailoverInstance", - full_name="google.cloud.redis.v1.CloudRedis.FailoverInstance", - index=6, - containing_service=None, - input_type=_FAILOVERINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002;\"6/v1/{name=projects/*/locations/*/instances/*}:failover:\001*\332A\031name,data_protection_mode\312AI\n\036google.cloud.redis.v1.Instance\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteInstance", - full_name="google.cloud.redis.v1.CloudRedis.DeleteInstance", - index=7, - containing_service=None, - input_type=_DELETEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002/*-/v1/{name=projects/*/locations/*/instances/*}\332A\004name\312A@\n\025google.protobuf.Empty\022'google.cloud.redis.v1.OperationMetadata" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_CLOUDREDIS) - -DESCRIPTOR.services_by_name["CloudRedis"] = _CLOUDREDIS - -# @@protoc_insertion_point(module_scope) diff --git a/redis/google/cloud/redis_v1/proto/cloud_redis_pb2_grpc.py b/redis/google/cloud/redis_v1/proto/cloud_redis_pb2_grpc.py deleted file mode 100644 index e066fbf19a23..000000000000 --- a/redis/google/cloud/redis_v1/proto/cloud_redis_pb2_grpc.py +++ /dev/null @@ -1,235 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.redis_v1.proto import ( - cloud_redis_pb2 as google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class CloudRedisStub(object): - """Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1 - - The `redis.googleapis.com` service implements the Google Cloud Memorystore - for Redis API and defines the following resource model for managing Redis - instances: - * The service works with a collection of cloud projects, named: `/projects/*` - * Each project has a collection of available locations, named: `/locations/*` - * Each location has a collection of Redis instances, named: `/instances/*` - * As such, Redis instances are resources of the form: - `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - - Note that location_id must be referring to a GCP `region`; for example: - * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListInstances = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/ListInstances", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.FromString, - ) - self.GetInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/GetInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.Instance.FromString, - ) - self.CreateInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/CreateInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.UpdateInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/UpdateInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ImportInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/ImportInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/ExportInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.FailoverInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/FailoverInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.DeleteInstance = channel.unary_unary( - "/google.cloud.redis.v1.CloudRedis/DeleteInstance", - request_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class CloudRedisServicer(object): - """Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1 - - The `redis.googleapis.com` service implements the Google Cloud Memorystore - for Redis API and defines the following resource model for managing Redis - instances: - * The service works with a collection of cloud projects, named: `/projects/*` - * Each project has a collection of available locations, named: `/locations/*` - * Each location has a collection of Redis instances, named: `/instances/*` - * As such, Redis instances are resources of the form: - `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - - Note that location_id must be referring to a GCP `region`; for example: - * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - """ - - def ListInstances(self, request, context): - """Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - * `projects/{project_id}/locations/{location_id}` - - If `location_id` is specified as `-` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetInstance(self, request, context): - """Gets the details of a specific Redis instance. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateInstance(self, request, context): - """Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's - [default network](/compute/docs/networks-and-firewalls#networks). - - The creation is executed asynchronously and callers may check the returned - operation to track its progress. Once the operation is completed the Redis - instance will be fully functional. Completed longrunning.Operation will - contain the new instance object in the response field. - - The returned operation is automatically deleted after a few hours, so there - is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateInstance(self, request, context): - """Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportInstance(self, request, context): - """Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportInstance(self, request, context): - """Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def FailoverInstance(self, request, context): - """Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteInstance(self, request, context): - """Deletes a specific Redis instance. Instance stops serving and data is - deleted. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_CloudRedisServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListInstances": grpc.unary_unary_rpc_method_handler( - servicer.ListInstances, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.FromString, - response_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.SerializeToString, - ), - "GetInstance": grpc.unary_unary_rpc_method_handler( - servicer.GetInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.FromString, - response_serializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.Instance.SerializeToString, - ), - "CreateInstance": grpc.unary_unary_rpc_method_handler( - servicer.CreateInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "UpdateInstance": grpc.unary_unary_rpc_method_handler( - servicer.UpdateInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ImportInstance": grpc.unary_unary_rpc_method_handler( - servicer.ImportInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportInstance": grpc.unary_unary_rpc_method_handler( - servicer.ExportInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "FailoverInstance": grpc.unary_unary_rpc_method_handler( - servicer.FailoverInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "DeleteInstance": grpc.unary_unary_rpc_method_handler( - servicer.DeleteInstance, - request_deserializer=google_dot_cloud_dot_redis__v1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.redis.v1.CloudRedis", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/redis/google/cloud/redis_v1/types.py b/redis/google/cloud/redis_v1/types.py deleted file mode 100644 index a5a0b20db9c9..000000000000 --- a/redis/google/cloud/redis_v1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.redis_v1.proto import cloud_redis_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, field_mask_pb2, timestamp_pb2, status_pb2] - -_local_modules = [cloud_redis_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.redis_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/redis/google/cloud/redis_v1beta1/__init__.py b/redis/google/cloud/redis_v1beta1/__init__.py deleted file mode 100644 index 6fb67cb28fde..000000000000 --- a/redis/google/cloud/redis_v1beta1/__init__.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.redis_v1beta1 import types -from google.cloud.redis_v1beta1.gapic import cloud_redis_client -from google.cloud.redis_v1beta1.gapic import enums - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class CloudRedisClient(cloud_redis_client.CloudRedisClient): - __doc__ = cloud_redis_client.CloudRedisClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "CloudRedisClient") diff --git a/redis/google/cloud/redis_v1beta1/gapic/__init__.py b/redis/google/cloud/redis_v1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py b/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py deleted file mode 100644 index 9a09a053ac07..000000000000 --- a/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client.py +++ /dev/null @@ -1,1033 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.redis.v1beta1 CloudRedis API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.redis_v1beta1.gapic import cloud_redis_client_config -from google.cloud.redis_v1beta1.gapic import enums -from google.cloud.redis_v1beta1.gapic.transports import cloud_redis_grpc_transport -from google.cloud.redis_v1beta1.proto import cloud_redis_pb2 -from google.cloud.redis_v1beta1.proto import cloud_redis_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-redis").version - - -class CloudRedisClient(object): - """ - Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1beta1 - - The ``redis.googleapis.com`` service implements the Google Cloud - Memorystore for Redis API and defines the following resource model for - managing Redis instances: - - - The service works with a collection of cloud projects, named: - ``/projects/*`` - - Each project has a collection of available locations, named: - ``/locations/*`` - - Each location has a collection of Redis instances, named: - ``/instances/*`` - - As such, Redis instances are resources of the form: - ``/projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - - Note that location\_id must be refering to a GCP ``region``; for - example: - - - ``projects/redpepper-1290/locations/us-central1/instances/my-redis`` - """ - - SERVICE_ADDRESS = "redis.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.redis.v1beta1.CloudRedis" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - CloudRedisClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def instance_path(cls, project, location, instance): - """Return a fully-qualified instance string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/instances/{instance}", - project=project, - location=location, - instance=instance, - ) - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.CloudRedisGrpcTransport, - Callable[[~.Credentials, type], ~.CloudRedisGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = cloud_redis_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=cloud_redis_grpc_transport.CloudRedisGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = cloud_redis_grpc_transport.CloudRedisGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_instances( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - - - ``projects/{project_id}/locations/{location_id}`` - - If ``location_id`` is specified as ``-`` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_instances(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_instances(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the instance location using the form: - ``projects/{project_id}/locations/{location_id}`` where ``location_id`` - refers to a GCP region. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.redis_v1beta1.types.Instance` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_instances" not in self._inner_api_calls: - self._inner_api_calls[ - "list_instances" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_instances, - default_retry=self._method_configs["ListInstances"].retry, - default_timeout=self._method_configs["ListInstances"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ListInstancesRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_instances"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="instances", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_instance( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the details of a specific Redis instance. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.get_instance(name) - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types.Instance` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "get_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_instance, - default_retry=self._method_configs["GetInstance"].retry, - default_timeout=self._method_configs["GetInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.GetInstanceRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_instance( - self, - parent, - instance_id, - instance, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's `default - network `__. - - The creation is executed asynchronously and callers may check the - returned operation to track its progress. Once the operation is - completed the Redis instance will be fully functional. Completed - longrunning.Operation will contain the new instance object in the - response field. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> from google.cloud.redis_v1beta1 import enums - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> instance_id = 'test_instance' - >>> tier = enums.Instance.Tier.BASIC - >>> memory_size_gb = 1 - >>> instance = {'tier': tier, 'memory_size_gb': memory_size_gb} - >>> - >>> response = client.create_instance(parent, instance_id, instance) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The resource name of the instance location using the form: - ``projects/{project_id}/locations/{location_id}`` where ``location_id`` - refers to a GCP region. - instance_id (str): Required. The logical name of the Redis instance in the customer project - with the following restrictions: - - - Must contain only lowercase letters, numbers, and hyphens. - - Must start with a letter. - - Must be between 1-40 characters. - - Must end with a number or a letter. - - Must be unique within the customer project / location - instance (Union[dict, ~google.cloud.redis_v1beta1.types.Instance]): Required. A Redis [Instance] resource - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1beta1.types.Instance` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "create_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_instance, - default_retry=self._method_configs["CreateInstance"].retry, - default_timeout=self._method_configs["CreateInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.CreateInstanceRequest( - parent=parent, instance_id=instance_id, instance=instance - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["create_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=any_pb2.Any, - ) - - def update_instance( - self, - update_mask, - instance, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> paths_element = 'display_name' - >>> paths_element_2 = 'memory_size_gb' - >>> paths = [paths_element, paths_element_2] - >>> update_mask = {'paths': paths} - >>> display_name = 'UpdatedDisplayName' - >>> memory_size_gb = 4 - >>> instance = {'display_name': display_name, 'memory_size_gb': memory_size_gb} - >>> - >>> response = client.update_instance(update_mask, instance) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - update_mask (Union[dict, ~google.cloud.redis_v1beta1.types.FieldMask]): Required. Mask of fields to update. At least one path must be supplied - in this field. The elements of the repeated paths field may only include - these fields from ``Instance``: - - - ``displayName`` - - ``labels`` - - ``memorySizeGb`` - - ``redisConfig`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1beta1.types.FieldMask` - instance (Union[dict, ~google.cloud.redis_v1beta1.types.Instance]): Required. Update description. Only fields specified in update\_mask are - updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1beta1.types.Instance` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "update_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_instance, - default_retry=self._method_configs["UpdateInstance"].retry, - default_timeout=self._method_configs["UpdateInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.UpdateInstanceRequest( - update_mask=update_mask, instance=instance - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("instance.name", instance.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["update_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=any_pb2.Any, - ) - - def import_instance( - self, - name, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> # TODO: Initialize `name`: - >>> name = '' - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_instance(name, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - input_config (Union[dict, ~google.cloud.redis_v1beta1.types.InputConfig]): Required. Specify data to be imported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1beta1.types.InputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "import_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_instance, - default_retry=self._method_configs["ImportInstance"].retry, - default_timeout=self._method_configs["ImportInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ImportInstanceRequest( - name=name, input_config=input_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=any_pb2.Any, - ) - - def export_instance( - self, - name, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> # TODO: Initialize `name`: - >>> name = '' - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.export_instance(name, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - output_config (Union[dict, ~google.cloud.redis_v1beta1.types.OutputConfig]): Required. Specify data to be exported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.redis_v1beta1.types.OutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "export_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "export_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.export_instance, - default_retry=self._method_configs["ExportInstance"].retry, - default_timeout=self._method_configs["ExportInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.ExportInstanceRequest( - name=name, output_config=output_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["export_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=any_pb2.Any, - ) - - def failover_instance( - self, - name, - data_protection_mode=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.failover_instance(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - data_protection_mode (~google.cloud.redis_v1beta1.types.DataProtectionMode): Optional. Available data protection modes that the user can choose. If - it's unspecified, data protection mode will be LIMITED\_DATA\_LOSS by - default. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "failover_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "failover_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.failover_instance, - default_retry=self._method_configs["FailoverInstance"].retry, - default_timeout=self._method_configs["FailoverInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.FailoverInstanceRequest( - name=name, data_protection_mode=data_protection_mode - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["failover_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_redis_pb2.Instance, - metadata_type=any_pb2.Any, - ) - - def delete_instance( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a specific Redis instance. Instance stops serving and data is - deleted. - - Example: - >>> from google.cloud import redis_v1beta1 - >>> - >>> client = redis_v1beta1.CloudRedisClient() - >>> - >>> name = client.instance_path('[PROJECT]', '[LOCATION]', '[INSTANCE]') - >>> - >>> response = client.delete_instance(name) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - name (str): Required. Redis instance resource name using the form: - ``projects/{project_id}/locations/{location_id}/instances/{instance_id}`` - where ``location_id`` refers to a GCP region. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.redis_v1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_instance" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_instance" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_instance, - default_retry=self._method_configs["DeleteInstance"].retry, - default_timeout=self._method_configs["DeleteInstance"].timeout, - client_info=self._client_info, - ) - - request = cloud_redis_pb2.DeleteInstanceRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["delete_instance"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=any_pb2.Any, - ) diff --git a/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py b/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py deleted file mode 100644 index 262a77dc9af0..000000000000 --- a/redis/google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py +++ /dev/null @@ -1,63 +0,0 @@ -config = { - "interfaces": { - "google.cloud.redis.v1beta1.CloudRedis": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListInstances": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "UpdateInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ImportInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ExportInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "FailoverInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteInstance": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/redis/google/cloud/redis_v1beta1/gapic/enums.py b/redis/google/cloud/redis_v1beta1/gapic/enums.py deleted file mode 100644 index 6f7648270d21..000000000000 --- a/redis/google/cloud/redis_v1beta1/gapic/enums.py +++ /dev/null @@ -1,81 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class FailoverInstanceRequest(object): - class DataProtectionMode(enum.IntEnum): - """ - Attributes: - DATA_PROTECTION_MODE_UNSPECIFIED (int): Defaults to LIMITED\_DATA\_LOSS if a data protection mode is not - specified. - LIMITED_DATA_LOSS (int): Instance failover will be protected with data loss control. More - specifically, the failover will only be performed if the current - replication offset diff between master and replica is under a certain - threshold. - FORCE_DATA_LOSS (int): Instance failover will be performed without data loss control. - """ - - DATA_PROTECTION_MODE_UNSPECIFIED = 0 - LIMITED_DATA_LOSS = 1 - FORCE_DATA_LOSS = 2 - - -class Instance(object): - class State(enum.IntEnum): - """ - Represents the different states of a Redis instance. - - Attributes: - STATE_UNSPECIFIED (int): Not set. - CREATING (int): Redis instance is being created. - READY (int): Redis instance has been created and is fully usable. - UPDATING (int): Redis instance configuration is being updated. Certain kinds of updates - may cause the instance to become unusable while the update is in - progress. - DELETING (int): Redis instance is being deleted. - REPAIRING (int): Redis instance is being repaired and may be unusable. - MAINTENANCE (int): Maintenance is being performed on this Redis instance. - IMPORTING (int): Redis instance is importing data (availability may be affected). - FAILING_OVER (int): Redis instance is failing over (availability may be affected). - """ - - STATE_UNSPECIFIED = 0 - CREATING = 1 - READY = 2 - UPDATING = 3 - DELETING = 4 - REPAIRING = 5 - MAINTENANCE = 6 - IMPORTING = 8 - FAILING_OVER = 10 - - class Tier(enum.IntEnum): - """ - Available service tiers to choose from - - Attributes: - TIER_UNSPECIFIED (int): Not set. - BASIC (int): BASIC tier: standalone instance - STANDARD_HA (int): STANDARD\_HA tier: highly available primary/replica instances - """ - - TIER_UNSPECIFIED = 0 - BASIC = 1 - STANDARD_HA = 3 diff --git a/redis/google/cloud/redis_v1beta1/gapic/transports/__init__.py b/redis/google/cloud/redis_v1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py b/redis/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py deleted file mode 100644 index 7ab4727a360a..000000000000 --- a/redis/google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py +++ /dev/null @@ -1,256 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.redis_v1beta1.proto import cloud_redis_pb2_grpc - - -class CloudRedisGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.redis.v1beta1 CloudRedis API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="redis.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"cloud_redis_stub": cloud_redis_pb2_grpc.CloudRedisStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="redis.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_instances(self): - """Return the gRPC stub for :meth:`CloudRedisClient.list_instances`. - - Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - - - ``projects/{project_id}/locations/{location_id}`` - - If ``location_id`` is specified as ``-`` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ListInstances - - @property - def get_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.get_instance`. - - Gets the details of a specific Redis instance. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].GetInstance - - @property - def create_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.create_instance`. - - Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's `default - network `__. - - The creation is executed asynchronously and callers may check the - returned operation to track its progress. Once the operation is - completed the Redis instance will be fully functional. Completed - longrunning.Operation will contain the new instance object in the - response field. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].CreateInstance - - @property - def update_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.update_instance`. - - Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].UpdateInstance - - @property - def import_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.import_instance`. - - Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ImportInstance - - @property - def export_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.export_instance`. - - Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].ExportInstance - - @property - def failover_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.failover_instance`. - - Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].FailoverInstance - - @property - def delete_instance(self): - """Return the gRPC stub for :meth:`CloudRedisClient.delete_instance`. - - Deletes a specific Redis instance. Instance stops serving and data is - deleted. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["cloud_redis_stub"].DeleteInstance diff --git a/redis/google/cloud/redis_v1beta1/proto/__init__.py b/redis/google/cloud/redis_v1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/redis/google/cloud/redis_v1beta1/proto/cloud_redis.proto b/redis/google/cloud/redis_v1beta1/proto/cloud_redis.proto deleted file mode 100644 index eafd8eb4ea86..000000000000 --- a/redis/google/cloud/redis_v1beta1/proto/cloud_redis.proto +++ /dev/null @@ -1,555 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.redis.v1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redis"; -option java_multiple_files = true; -option java_outer_classname = "CloudRedisServiceBetaProto"; -option java_package = "com.google.cloud.redis.v1beta1"; - -// Configures and manages Cloud Memorystore for Redis instances -// -// Google Cloud Memorystore for Redis v1beta1 -// -// The `redis.googleapis.com` service implements the Google Cloud Memorystore -// for Redis API and defines the following resource model for managing Redis -// instances: -// * The service works with a collection of cloud projects, named: `/projects/*` -// * Each project has a collection of available locations, named: `/locations/*` -// * Each location has a collection of Redis instances, named: `/instances/*` -// * As such, Redis instances are resources of the form: -// `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` -// -// Note that location_id must be refering to a GCP `region`; for example: -// * `projects/redpepper-1290/locations/us-central1/instances/my-redis` -service CloudRedis { - option (google.api.default_host) = "redis.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Lists all Redis instances owned by a project in either the specified - // location (region) or all locations. - // - // The location should have the following format: - // * `projects/{project_id}/locations/{location_id}` - // - // If `location_id` is specified as `-` (wildcard), then all regions - // available to the project are queried, and the results are aggregated. - rpc ListInstances(ListInstancesRequest) returns (ListInstancesResponse) { - option (google.api.http) = { - get: "/v1beta1/{parent=projects/*/locations/*}/instances" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets the details of a specific Redis instance. - rpc GetInstance(GetInstanceRequest) returns (Instance) { - option (google.api.http) = { - get: "/v1beta1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a Redis instance based on the specified tier and memory size. - // - // By default, the instance is accessible from the project's - // [default network](/compute/docs/networks-and-firewalls#networks). - // - // The creation is executed asynchronously and callers may check the returned - // operation to track its progress. Once the operation is completed the Redis - // instance will be fully functional. Completed longrunning.Operation will - // contain the new instance object in the response field. - // - // The returned operation is automatically deleted after a few hours, so there - // is no need to call DeleteOperation. - rpc CreateInstance(CreateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{parent=projects/*/locations/*}/instances" - body: "instance" - }; - option (google.api.method_signature) = "parent,instance_id,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1beta1.Instance" - metadata_type: "google.protobuf.Any" - }; - } - - // Updates the metadata and configuration of a specific Redis instance. - // - // Completed longrunning.Operation will contain the new instance object - // in the response field. The returned operation is automatically deleted - // after a few hours, so there is no need to call DeleteOperation. - rpc UpdateInstance(UpdateInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1beta1/{instance.name=projects/*/locations/*/instances/*}" - body: "instance" - }; - option (google.api.method_signature) = "update_mask,instance"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1beta1.Instance" - metadata_type: "google.protobuf.Any" - }; - } - - // Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - // - // Redis may stop serving during this operation. Instance state will be - // IMPORTING for entire operation. When complete, the instance will contain - // only data from the imported file. - // - // The returned operation is automatically deleted after a few hours, so - // there is no need to call DeleteOperation. - rpc ImportInstance(ImportInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/instances/*}:import" - body: "*" - }; - option (google.api.method_signature) = "name,input_config"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1beta1.Instance" - metadata_type: "google.protobuf.Any" - }; - } - - // Export Redis instance data into a Redis RDB format file in Cloud Storage. - // - // Redis will continue serving during this operation. - // - // The returned operation is automatically deleted after a few hours, so - // there is no need to call DeleteOperation. - rpc ExportInstance(ExportInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/instances/*}:export" - body: "*" - }; - option (google.api.method_signature) = "name,output_config"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1beta1.Instance" - metadata_type: "google.protobuf.Any" - }; - } - - // Initiates a failover of the master node to current replica node for a - // specific STANDARD tier Cloud Memorystore for Redis instance. - rpc FailoverInstance(FailoverInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta1/{name=projects/*/locations/*/instances/*}:failover" - body: "*" - }; - option (google.api.method_signature) = "name,data_protection_mode"; - option (google.longrunning.operation_info) = { - response_type: "google.cloud.redis.v1beta1.Instance" - metadata_type: "google.protobuf.Any" - }; - } - - // Deletes a specific Redis instance. Instance stops serving and data is - // deleted. - rpc DeleteInstance(DeleteInstanceRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1beta1/{name=projects/*/locations/*/instances/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "google.protobuf.Any" - }; - } -} - -// A Google Cloud Redis instance. -message Instance { - option (google.api.resource) = { - type: "redis.googleapis.com/Instance" - pattern: "projects/{project}/locations/{location}/instances/{instance}" - }; - - // Represents the different states of a Redis instance. - enum State { - // Not set. - STATE_UNSPECIFIED = 0; - - // Redis instance is being created. - CREATING = 1; - - // Redis instance has been created and is fully usable. - READY = 2; - - // Redis instance configuration is being updated. Certain kinds of updates - // may cause the instance to become unusable while the update is in - // progress. - UPDATING = 3; - - // Redis instance is being deleted. - DELETING = 4; - - // Redis instance is being repaired and may be unusable. - REPAIRING = 5; - - // Maintenance is being performed on this Redis instance. - MAINTENANCE = 6; - - // Redis instance is importing data (availability may be affected). - IMPORTING = 8; - - // Redis instance is failing over (availability may be affected). - FAILING_OVER = 10; - } - - // Available service tiers to choose from - enum Tier { - // Not set. - TIER_UNSPECIFIED = 0; - - // BASIC tier: standalone instance - BASIC = 1; - - // STANDARD_HA tier: highly available primary/replica instances - STANDARD_HA = 3; - } - - // Required. Unique name of the resource in this scope including project and - // location using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // - // Note: Redis instances are managed and addressed at regional level so - // location_id here refers to a GCP region; however, users may choose which - // specific zone (or collection of zones for cross-zone instances) an instance - // should be provisioned in. Refer to [location_id] and - // [alternative_location_id] fields for more details. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // An arbitrary and optional user-provided name for the instance. - string display_name = 2; - - // Resource labels to represent user provided metadata - map labels = 3; - - // Optional. The zone where the instance will be provisioned. If not provided, - // the service will choose a zone for the instance. For STANDARD_HA tier, - // instances will be created across two zones for protection against zonal - // failures. If [alternative_location_id] is also provided, it must be - // different from [location_id]. - string location_id = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Only applicable to STANDARD_HA tier which protects the instance - // against zonal failures by provisioning it across two zones. If provided, it - // must be a different zone from the one provided in [location_id]. - string alternative_location_id = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The version of Redis software. - // If not provided, latest supported version will be used. Updating the - // version will perform an upgrade/downgrade to the new version. Currently, - // the supported values are: - // - // * `REDIS_4_0` for Redis 4.0 compatibility (default) - // * `REDIS_3_2` for Redis 3.2 compatibility - string redis_version = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The CIDR range of internal addresses that are reserved for this - // instance. If not provided, the service will choose an unused /29 block, - // for example, 10.0.0.0/29 or 192.168.0.0/29. Ranges must be unique - // and non-overlapping with existing subnets in an authorized network. - string reserved_ip_range = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Hostname or IP address of the exposed Redis endpoint used by - // clients to connect to the service. - string host = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The port number of the exposed Redis endpoint. - int32 port = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current zone where the Redis endpoint is placed. For Basic - // Tier instances, this will always be the same as the [location_id] - // provided by the user at creation time. For Standard Tier instances, - // this can be either [location_id] or [alternative_location_id] and can - // change after a failover event. - string current_location_id = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the instance was created. - google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The current state of this instance. - State state = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Additional information about the current status of this - // instance, if available. - string status_message = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Redis configuration parameters, according to - // http://redis.io/topics/config. Currently, the only supported parameters - // are: - // - // Redis 3.2 and above: - // - // * maxmemory-policy - // * notify-keyspace-events - // - // Redis 4.0 and above: - // - // * activedefrag - // * lfu-log-factor - // * lfu-decay-time - map redis_configs = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The service tier of the instance. - Tier tier = 17 [(google.api.field_behavior) = REQUIRED]; - - // Required. Redis memory size in GiB. - int32 memory_size_gb = 18 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The full name of the Google Compute Engine - // [network](/compute/docs/networks-and-firewalls#networks) to which the - // instance is connected. If left unspecified, the `default` network - // will be used. - string authorized_network = 20 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Cloud IAM identity used by import / export operations to - // transfer data to/from Cloud Storage. Format is - // "serviceAccount:". The value may change over time - // for a given instance so should be checked before each import/export - // operation. - string persistence_iam_identity = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. -message ListInstancesRequest { - // Required. The resource name of the instance location using the form: - // `projects/{project_id}/locations/{location_id}` - // where `location_id` refers to a GCP region. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of items to return. - // - // If not specified, a default value of 1000 will be used by the service. - // Regardless of the page_size value, the response may include a partial list - // and a caller should only rely on response's - // [next_page_token][CloudRedis.ListInstancesResponse.next_page_token] - // to determine if there are more instances left to be queried. - int32 page_size = 2; - - // The next_page_token value returned from a previous List request, - // if any. - string page_token = 3; -} - -// Response for [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. -message ListInstancesResponse { - // A list of Redis instances in the project in the specified location, - // or across all locations. - // - // If the `location_id` in the parent field of the request is "-", all regions - // available to the project are queried, and the results aggregated. - // If in such an aggregated query a location is unavailable, a dummy Redis - // entry is included in the response with the "name" field set to a value of - // the form projects/{project_id}/locations/{location_id}/instances/- and the - // "status" field set to ERROR and "status_message" field set to "location not - // available for ListInstances". - repeated Instance instances = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for [GetInstance][google.cloud.redis.v1beta1.CloudRedis.GetInstance]. -message GetInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; -} - -// Request for [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance]. -message CreateInstanceRequest { - // Required. The resource name of the instance location using the form: - // `projects/{project_id}/locations/{location_id}` - // where `location_id` refers to a GCP region. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The logical name of the Redis instance in the customer project - // with the following restrictions: - // - // * Must contain only lowercase letters, numbers, and hyphens. - // * Must start with a letter. - // * Must be between 1-40 characters. - // * Must end with a number or a letter. - // * Must be unique within the customer project / location - string instance_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A Redis [Instance] resource - Instance instance = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance]. -message UpdateInstanceRequest { - // Required. Mask of fields to update. At least one path must be supplied in - // this field. The elements of the repeated paths field may only include these - // fields from [Instance][google.cloud.redis.v1beta1.Instance]: - // - // * `displayName` - // * `labels` - // * `memorySizeGb` - // * `redisConfig` - google.protobuf.FieldMask update_mask = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Update description. - // Only fields specified in update_mask are updated. - Instance instance = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance]. -message DeleteInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; -} - -// The Cloud Storage location for the input content -message GcsSource { - // Required. Source data URI. (e.g. 'gs://my_bucket/my_object'). - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The input content -message InputConfig { - // Required. Specify source location of input data - oneof source { - // Google Cloud Storage location where input content is located. - GcsSource gcs_source = 1; - } -} - -// Request for [Import][google.cloud.redis.v1beta1.CloudRedis.ImportInstance]. -message ImportInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify data to be imported. - InputConfig input_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// The Cloud Storage location for the output content -message GcsDestination { - // Required. Data destination URI (e.g. - // 'gs://my_bucket/my_object'). Existing files will be overwritten. - string uri = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// The output content -message OutputConfig { - // Required. Specify destination location of output data - oneof destination { - // Google Cloud Storage destination for output content. - GcsDestination gcs_destination = 1; - } -} - -// Request for [Export][google.cloud.redis.v1beta1.CloudRedis.ExportInstance]. -message ExportInstanceRequest { - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify data to be exported. - OutputConfig output_config = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. -message FailoverInstanceRequest { - enum DataProtectionMode { - // Defaults to LIMITED_DATA_LOSS if a data protection mode is not - // specified. - DATA_PROTECTION_MODE_UNSPECIFIED = 0; - - // Instance failover will be protected with data loss control. More - // specifically, the failover will only be performed if the current - // replication offset diff between master and replica is under a certain - // threshold. - LIMITED_DATA_LOSS = 1; - - // Instance failover will be performed without data loss control. - FORCE_DATA_LOSS = 2; - } - - // Required. Redis instance resource name using the form: - // `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - // where `location_id` refers to a GCP region. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "redis.googleapis.com/Instance" - } - ]; - - // Optional. Available data protection modes that the user can choose. If it's - // unspecified, data protection mode will be LIMITED_DATA_LOSS by default. - DataProtectionMode data_protection_mode = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// This location metadata represents additional configuration options for a -// given location where a Redis instance may be created. All fields are output -// only. It is returned as content of the -// `google.cloud.location.Location.metadata` field. -message LocationMetadata { - // Output only. The set of available zones in the location. The map is keyed - // by the lowercase ID of each zone, as defined by GCE. These keys can be - // specified in `location_id` or `alternative_location_id` fields when - // creating a Redis instance. - map available_zones = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Defines specific information for a particular zone. Currently empty and -// reserved for future use only. -message ZoneMetadata { - -} diff --git a/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py b/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py deleted file mode 100644 index 528075a7420b..000000000000 --- a/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py +++ /dev/null @@ -1,2130 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/redis_v1beta1/proto/cloud_redis.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/redis_v1beta1/proto/cloud_redis.proto", - package="google.cloud.redis.v1beta1", - syntax="proto3", - serialized_options=_b( - "\n\036com.google.cloud.redis.v1beta1B\032CloudRedisServiceBetaProtoP\001Z?google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redis" - ), - serialized_pb=_b( - '\n2google/cloud/redis_v1beta1/proto/cloud_redis.proto\x12\x1agoogle.cloud.redis.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xda\x08\n\x08Instance\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12@\n\x06labels\x18\x03 \x03(\x0b\x32\x30.google.cloud.redis.v1beta1.Instance.LabelsEntry\x12\x18\n\x0blocation_id\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12$\n\x17\x61lternative_location_id\x18\x05 \x01(\tB\x03\xe0\x41\x01\x12\x1a\n\rredis_version\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x1e\n\x11reserved_ip_range\x18\t \x01(\tB\x03\xe0\x41\x01\x12\x11\n\x04host\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x11\n\x04port\x18\x0b \x01(\x05\x42\x03\xe0\x41\x03\x12 \n\x13\x63urrent_location_id\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\r \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12>\n\x05state\x18\x0e \x01(\x0e\x32*.google.cloud.redis.v1beta1.Instance.StateB\x03\xe0\x41\x03\x12\x1b\n\x0estatus_message\x18\x0f \x01(\tB\x03\xe0\x41\x03\x12R\n\rredis_configs\x18\x10 \x03(\x0b\x32\x36.google.cloud.redis.v1beta1.Instance.RedisConfigsEntryB\x03\xe0\x41\x01\x12<\n\x04tier\x18\x11 \x01(\x0e\x32).google.cloud.redis.v1beta1.Instance.TierB\x03\xe0\x41\x02\x12\x1b\n\x0ememory_size_gb\x18\x12 \x01(\x05\x42\x03\xe0\x41\x02\x12\x1f\n\x12\x61uthorized_network\x18\x14 \x01(\tB\x03\xe0\x41\x01\x12%\n\x18persistence_iam_identity\x18\x15 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x33\n\x11RedisConfigsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"\x94\x01\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x43REATING\x10\x01\x12\t\n\x05READY\x10\x02\x12\x0c\n\x08UPDATING\x10\x03\x12\x0c\n\x08\x44\x45LETING\x10\x04\x12\r\n\tREPAIRING\x10\x05\x12\x0f\n\x0bMAINTENANCE\x10\x06\x12\r\n\tIMPORTING\x10\x08\x12\x10\n\x0c\x46\x41ILING_OVER\x10\n"8\n\x04Tier\x12\x14\n\x10TIER_UNSPECIFIED\x10\x00\x12\t\n\x05\x42\x41SIC\x10\x01\x12\x0f\n\x0bSTANDARD_HA\x10\x03:`\xea\x41]\n\x1dredis.googleapis.com/Instance\x12"2/v1beta1/{parent=projects/*/locations/*}/instances:\x08instance\xda\x41\x1bparent,instance_id,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x86\x02\n\x0eUpdateInstance\x12\x31.google.cloud.redis.v1beta1.UpdateInstanceRequest\x1a\x1d.google.longrunning.Operation"\xa1\x01\x82\xd3\xe4\x93\x02G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\x08instance\xda\x41\x14update_mask,instance\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfa\x01\n\x0eImportInstance\x12\x31.google.cloud.redis.v1beta1.ImportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x95\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\x01*\xda\x41\x11name,input_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xfb\x01\n\x0e\x45xportInstance\x12\x31.google.cloud.redis.v1beta1.ExportInstanceRequest\x1a\x1d.google.longrunning.Operation"\x96\x01\x82\xd3\xe4\x93\x02>"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\x01*\xda\x41\x12name,output_config\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\x88\x02\n\x10\x46\x61iloverInstance\x12\x33.google.cloud.redis.v1beta1.FailoverInstanceRequest\x1a\x1d.google.longrunning.Operation"\x9f\x01\x82\xd3\xe4\x93\x02@";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\x01*\xda\x41\x19name,data_protection_mode\xca\x41:\n#google.cloud.redis.v1beta1.Instance\x12\x13google.protobuf.Any\x12\xd4\x01\n\x0e\x44\x65leteInstance\x12\x31.google.cloud.redis.v1beta1.DeleteInstanceRequest\x1a\x1d.google.longrunning.Operation"p\x82\xd3\xe4\x93\x02\x34*2/v1beta1/{name=projects/*/locations/*/instances/*}\xda\x41\x04name\xca\x41,\n\x15google.protobuf.Empty\x12\x13google.protobuf.Any\x1aH\xca\x41\x14redis.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x7f\n\x1e\x63om.google.cloud.redis.v1beta1B\x1a\x43loudRedisServiceBetaProtoP\x01Z?google.golang.org/genproto/googleapis/cloud/redis/v1beta1;redisb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_INSTANCE_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.redis.v1beta1.Instance.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="READY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPDATING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DELETING", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="REPAIRING", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MAINTENANCE", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IMPORTING", index=7, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILING_OVER", index=8, number=10, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1112, - serialized_end=1260, -) -_sym_db.RegisterEnumDescriptor(_INSTANCE_STATE) - -_INSTANCE_TIER = _descriptor.EnumDescriptor( - name="Tier", - full_name="google.cloud.redis.v1beta1.Instance.Tier", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TIER_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BASIC", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STANDARD_HA", index=2, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1262, - serialized_end=1318, -) -_sym_db.RegisterEnumDescriptor(_INSTANCE_TIER) - -_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE = _descriptor.EnumDescriptor( - name="DataProtectionMode", - full_name="google.cloud.redis.v1beta1.FailoverInstanceRequest.DataProtectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DATA_PROTECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LIMITED_DATA_LOSS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FORCE_DATA_LOSS", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2803, - serialized_end=2905, -) -_sym_db.RegisterEnumDescriptor(_FAILOVERINSTANCEREQUEST_DATAPROTECTIONMODE) - - -_INSTANCE_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.cloud.redis.v1beta1.Instance.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.redis.v1beta1.Instance.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.redis.v1beta1.Instance.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1011, - serialized_end=1056, -) - -_INSTANCE_REDISCONFIGSENTRY = _descriptor.Descriptor( - name="RedisConfigsEntry", - full_name="google.cloud.redis.v1beta1.Instance.RedisConfigsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.redis.v1beta1.Instance.RedisConfigsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.redis.v1beta1.Instance.RedisConfigsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1058, - serialized_end=1109, -) - -_INSTANCE = _descriptor.Descriptor( - name="Instance", - full_name="google.cloud.redis.v1beta1.Instance", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.redis.v1beta1.Instance.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.redis.v1beta1.Instance.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.cloud.redis.v1beta1.Instance.labels", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.redis.v1beta1.Instance.location_id", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="alternative_location_id", - full_name="google.cloud.redis.v1beta1.Instance.alternative_location_id", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="redis_version", - full_name="google.cloud.redis.v1beta1.Instance.redis_version", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reserved_ip_range", - full_name="google.cloud.redis.v1beta1.Instance.reserved_ip_range", - index=6, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="host", - full_name="google.cloud.redis.v1beta1.Instance.host", - index=7, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="port", - full_name="google.cloud.redis.v1beta1.Instance.port", - index=8, - number=11, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current_location_id", - full_name="google.cloud.redis.v1beta1.Instance.current_location_id", - index=9, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.redis.v1beta1.Instance.create_time", - index=10, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.redis.v1beta1.Instance.state", - index=11, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status_message", - full_name="google.cloud.redis.v1beta1.Instance.status_message", - index=12, - number=15, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="redis_configs", - full_name="google.cloud.redis.v1beta1.Instance.redis_configs", - index=13, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tier", - full_name="google.cloud.redis.v1beta1.Instance.tier", - index=14, - number=17, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="memory_size_gb", - full_name="google.cloud.redis.v1beta1.Instance.memory_size_gb", - index=15, - number=18, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="authorized_network", - full_name="google.cloud.redis.v1beta1.Instance.authorized_network", - index=16, - number=20, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="persistence_iam_identity", - full_name="google.cloud.redis.v1beta1.Instance.persistence_iam_identity", - index=17, - number=21, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_INSTANCE_LABELSENTRY, _INSTANCE_REDISCONFIGSENTRY], - enum_types=[_INSTANCE_STATE, _INSTANCE_TIER], - serialized_options=_b( - "\352A]\n\035redis.googleapis.com/Instance\022`__ to which - the instance is connected. If left unspecified, the - ``default`` network will be used. - persistence_iam_identity: - Output only. Cloud IAM identity used by import / export - operations to transfer data to/from Cloud Storage. Format is - "serviceAccount:". The value may change over time for a given - instance so should be checked before each import/export - operation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.Instance) - ), -) -_sym_db.RegisterMessage(Instance) -_sym_db.RegisterMessage(Instance.LabelsEntry) -_sym_db.RegisterMessage(Instance.RedisConfigsEntry) - -ListInstancesRequest = _reflection.GeneratedProtocolMessageType( - "ListInstancesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTANCESREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. - - - Attributes: - parent: - Required. The resource name of the instance location using the - form: ``projects/{project_id}/locations/{location_id}`` where - ``location_id`` refers to a GCP region. - page_size: - The maximum number of items to return. If not specified, a - default value of 1000 will be used by the service. Regardless - of the page\_size value, the response may include a partial - list and a caller should only rely on response's [next\_page\_ - token][CloudRedis.ListInstancesResponse.next\_page\_token] to - determine if there are more instances left to be queried. - page_token: - The next\_page\_token value returned from a previous List - request, if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.ListInstancesRequest) - ), -) -_sym_db.RegisterMessage(ListInstancesRequest) - -ListInstancesResponse = _reflection.GeneratedProtocolMessageType( - "ListInstancesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTINSTANCESRESPONSE, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Response for - [ListInstances][google.cloud.redis.v1beta1.CloudRedis.ListInstances]. - - - Attributes: - instances: - A list of Redis instances in the project in the specified - location, or across all locations. If the ``location_id`` in - the parent field of the request is "-", all regions available - to the project are queried, and the results aggregated. If in - such an aggregated query a location is unavailable, a dummy - Redis entry is included in the response with the "name" field - set to a value of the form - projects/{project\_id}/locations/{location\_id}/instances/- - and the "status" field set to ERROR and "status\_message" - field set to "location not available for ListInstances". - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - unreachable: - Locations that could not be reached. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.ListInstancesResponse) - ), -) -_sym_db.RegisterMessage(ListInstancesResponse) - -GetInstanceRequest = _reflection.GeneratedProtocolMessageType( - "GetInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [GetInstance][google.cloud.redis.v1beta1.CloudRedis.GetInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.GetInstanceRequest) - ), -) -_sym_db.RegisterMessage(GetInstanceRequest) - -CreateInstanceRequest = _reflection.GeneratedProtocolMessageType( - "CreateInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [CreateInstance][google.cloud.redis.v1beta1.CloudRedis.CreateInstance]. - - - Attributes: - parent: - Required. The resource name of the instance location using the - form: ``projects/{project_id}/locations/{location_id}`` where - ``location_id`` refers to a GCP region. - instance_id: - Required. The logical name of the Redis instance in the - customer project with the following restrictions: - Must - contain only lowercase letters, numbers, and hyphens. - Must - start with a letter. - Must be between 1-40 characters. - - Must end with a number or a letter. - Must be unique within - the customer project / location - instance: - Required. A Redis [Instance] resource - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.CreateInstanceRequest) - ), -) -_sym_db.RegisterMessage(CreateInstanceRequest) - -UpdateInstanceRequest = _reflection.GeneratedProtocolMessageType( - "UpdateInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [UpdateInstance][google.cloud.redis.v1beta1.CloudRedis.UpdateInstance]. - - - Attributes: - update_mask: - Required. Mask of fields to update. At least one path must be - supplied in this field. The elements of the repeated paths - field may only include these fields from - [Instance][google.cloud.redis.v1beta1.Instance]: - - ``displayName`` - ``labels`` - ``memorySizeGb`` - - ``redisConfig`` - instance: - Required. Update description. Only fields specified in - update\_mask are updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.UpdateInstanceRequest) - ), -) -_sym_db.RegisterMessage(UpdateInstanceRequest) - -DeleteInstanceRequest = _reflection.GeneratedProtocolMessageType( - "DeleteInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [DeleteInstance][google.cloud.redis.v1beta1.CloudRedis.DeleteInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.DeleteInstanceRequest) - ), -) -_sym_db.RegisterMessage(DeleteInstanceRequest) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""The Cloud Storage location for the input content - - - Attributes: - uri: - Required. Source data URI. (e.g. - 'gs://my\_bucket/my\_object'). - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""The input content - - - Attributes: - source: - Required. Specify source location of input data - gcs_source: - Google Cloud Storage location where input content is located. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -ImportInstanceRequest = _reflection.GeneratedProtocolMessageType( - "ImportInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [Import][google.cloud.redis.v1beta1.CloudRedis.ImportInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - input_config: - Required. Specify data to be imported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.ImportInstanceRequest) - ), -) -_sym_db.RegisterMessage(ImportInstanceRequest) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""The Cloud Storage location for the output content - - - Attributes: - uri: - Required. Data destination URI (e.g. - 'gs://my\_bucket/my\_object'). Existing files will be - overwritten. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""The output content - - - Attributes: - destination: - Required. Specify destination location of output data - gcs_destination: - Google Cloud Storage destination for output content. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -ExportInstanceRequest = _reflection.GeneratedProtocolMessageType( - "ExportInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_EXPORTINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [Export][google.cloud.redis.v1beta1.CloudRedis.ExportInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - output_config: - Required. Specify data to be exported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.ExportInstanceRequest) - ), -) -_sym_db.RegisterMessage(ExportInstanceRequest) - -FailoverInstanceRequest = _reflection.GeneratedProtocolMessageType( - "FailoverInstanceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_FAILOVERINSTANCEREQUEST, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Request for - [Failover][google.cloud.redis.v1beta1.CloudRedis.FailoverInstance]. - - - Attributes: - name: - Required. Redis instance resource name using the form: ``proje - cts/{project_id}/locations/{location_id}/instances/{instance_i - d}`` where ``location_id`` refers to a GCP region. - data_protection_mode: - Optional. Available data protection modes that the user can - choose. If it's unspecified, data protection mode will be - LIMITED\_DATA\_LOSS by default. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.FailoverInstanceRequest) - ), -) -_sym_db.RegisterMessage(FailoverInstanceRequest) - -LocationMetadata = _reflection.GeneratedProtocolMessageType( - "LocationMetadata", - (_message.Message,), - dict( - AvailableZonesEntry=_reflection.GeneratedProtocolMessageType( - "AvailableZonesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONMETADATA_AVAILABLEZONESENTRY, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.LocationMetadata.AvailableZonesEntry) - ), - ), - DESCRIPTOR=_LOCATIONMETADATA, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""This location metadata represents additional configuration - options for a given location where a Redis instance may be created. All - fields are output only. It is returned as content of the - ``google.cloud.location.Location.metadata`` field. - - - Attributes: - available_zones: - Output only. The set of available zones in the location. The - map is keyed by the lowercase ID of each zone, as defined by - GCE. These keys can be specified in ``location_id`` or - ``alternative_location_id`` fields when creating a Redis - instance. - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.LocationMetadata) - ), -) -_sym_db.RegisterMessage(LocationMetadata) -_sym_db.RegisterMessage(LocationMetadata.AvailableZonesEntry) - -ZoneMetadata = _reflection.GeneratedProtocolMessageType( - "ZoneMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_ZONEMETADATA, - __module__="google.cloud.redis_v1beta1.proto.cloud_redis_pb2", - __doc__="""Defines specific information for a particular zone. - Currently empty and reserved for future use only. - - """, - # @@protoc_insertion_point(class_scope:google.cloud.redis.v1beta1.ZoneMetadata) - ), -) -_sym_db.RegisterMessage(ZoneMetadata) - - -DESCRIPTOR._options = None -_INSTANCE_LABELSENTRY._options = None -_INSTANCE_REDISCONFIGSENTRY._options = None -_INSTANCE.fields_by_name["name"]._options = None -_INSTANCE.fields_by_name["location_id"]._options = None -_INSTANCE.fields_by_name["alternative_location_id"]._options = None -_INSTANCE.fields_by_name["redis_version"]._options = None -_INSTANCE.fields_by_name["reserved_ip_range"]._options = None -_INSTANCE.fields_by_name["host"]._options = None -_INSTANCE.fields_by_name["port"]._options = None -_INSTANCE.fields_by_name["current_location_id"]._options = None -_INSTANCE.fields_by_name["create_time"]._options = None -_INSTANCE.fields_by_name["state"]._options = None -_INSTANCE.fields_by_name["status_message"]._options = None -_INSTANCE.fields_by_name["redis_configs"]._options = None -_INSTANCE.fields_by_name["tier"]._options = None -_INSTANCE.fields_by_name["memory_size_gb"]._options = None -_INSTANCE.fields_by_name["authorized_network"]._options = None -_INSTANCE.fields_by_name["persistence_iam_identity"]._options = None -_INSTANCE._options = None -_LISTINSTANCESREQUEST.fields_by_name["parent"]._options = None -_GETINSTANCEREQUEST.fields_by_name["name"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["parent"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["instance_id"]._options = None -_CREATEINSTANCEREQUEST.fields_by_name["instance"]._options = None -_UPDATEINSTANCEREQUEST.fields_by_name["update_mask"]._options = None -_UPDATEINSTANCEREQUEST.fields_by_name["instance"]._options = None -_DELETEINSTANCEREQUEST.fields_by_name["name"]._options = None -_GCSSOURCE.fields_by_name["uri"]._options = None -_IMPORTINSTANCEREQUEST.fields_by_name["name"]._options = None -_IMPORTINSTANCEREQUEST.fields_by_name["input_config"]._options = None -_GCSDESTINATION.fields_by_name["uri"]._options = None -_EXPORTINSTANCEREQUEST.fields_by_name["name"]._options = None -_EXPORTINSTANCEREQUEST.fields_by_name["output_config"]._options = None -_FAILOVERINSTANCEREQUEST.fields_by_name["name"]._options = None -_FAILOVERINSTANCEREQUEST.fields_by_name["data_protection_mode"]._options = None -_LOCATIONMETADATA_AVAILABLEZONESENTRY._options = None -_LOCATIONMETADATA.fields_by_name["available_zones"]._options = None - -_CLOUDREDIS = _descriptor.ServiceDescriptor( - name="CloudRedis", - full_name="google.cloud.redis.v1beta1.CloudRedis", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\024redis.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=3138, - serialized_end=5098, - methods=[ - _descriptor.MethodDescriptor( - name="ListInstances", - full_name="google.cloud.redis.v1beta1.CloudRedis.ListInstances", - index=0, - containing_service=None, - input_type=_LISTINSTANCESREQUEST, - output_type=_LISTINSTANCESRESPONSE, - serialized_options=_b( - "\202\323\344\223\0024\0222/v1beta1/{parent=projects/*/locations/*}/instances\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.GetInstance", - index=1, - containing_service=None, - input_type=_GETINSTANCEREQUEST, - output_type=_INSTANCE, - serialized_options=_b( - "\202\323\344\223\0024\0222/v1beta1/{name=projects/*/locations/*/instances/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.CreateInstance", - index=2, - containing_service=None, - input_type=_CREATEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002>"2/v1beta1/{parent=projects/*/locations/*}/instances:\010instance\332A\033parent,instance_id,instance\312A:\n#google.cloud.redis.v1beta1.Instance\022\023google.protobuf.Any' - ), - ), - _descriptor.MethodDescriptor( - name="UpdateInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.UpdateInstance", - index=3, - containing_service=None, - input_type=_UPDATEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\002G2;/v1beta1/{instance.name=projects/*/locations/*/instances/*}:\010instance\332A\024update_mask,instance\312A:\n#google.cloud.redis.v1beta1.Instance\022\023google.protobuf.Any" - ), - ), - _descriptor.MethodDescriptor( - name="ImportInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.ImportInstance", - index=4, - containing_service=None, - input_type=_IMPORTINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002>"9/v1beta1/{name=projects/*/locations/*/instances/*}:import:\001*\332A\021name,input_config\312A:\n#google.cloud.redis.v1beta1.Instance\022\023google.protobuf.Any' - ), - ), - _descriptor.MethodDescriptor( - name="ExportInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.ExportInstance", - index=5, - containing_service=None, - input_type=_EXPORTINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002>"9/v1beta1/{name=projects/*/locations/*/instances/*}:export:\001*\332A\022name,output_config\312A:\n#google.cloud.redis.v1beta1.Instance\022\023google.protobuf.Any' - ), - ), - _descriptor.MethodDescriptor( - name="FailoverInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.FailoverInstance", - index=6, - containing_service=None, - input_type=_FAILOVERINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002@";/v1beta1/{name=projects/*/locations/*/instances/*}:failover:\001*\332A\031name,data_protection_mode\312A:\n#google.cloud.redis.v1beta1.Instance\022\023google.protobuf.Any' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteInstance", - full_name="google.cloud.redis.v1beta1.CloudRedis.DeleteInstance", - index=7, - containing_service=None, - input_type=_DELETEINSTANCEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - "\202\323\344\223\0024*2/v1beta1/{name=projects/*/locations/*/instances/*}\332A\004name\312A,\n\025google.protobuf.Empty\022\023google.protobuf.Any" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_CLOUDREDIS) - -DESCRIPTOR.services_by_name["CloudRedis"] = _CLOUDREDIS - -# @@protoc_insertion_point(module_scope) diff --git a/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2_grpc.py b/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2_grpc.py deleted file mode 100644 index b25842d334a8..000000000000 --- a/redis/google/cloud/redis_v1beta1/proto/cloud_redis_pb2_grpc.py +++ /dev/null @@ -1,235 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.redis_v1beta1.proto import ( - cloud_redis_pb2 as google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class CloudRedisStub(object): - """Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1beta1 - - The `redis.googleapis.com` service implements the Google Cloud Memorystore - for Redis API and defines the following resource model for managing Redis - instances: - * The service works with a collection of cloud projects, named: `/projects/*` - * Each project has a collection of available locations, named: `/locations/*` - * Each location has a collection of Redis instances, named: `/instances/*` - * As such, Redis instances are resources of the form: - `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - - Note that location_id must be refering to a GCP `region`; for example: - * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListInstances = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/ListInstances", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.FromString, - ) - self.GetInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/GetInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.Instance.FromString, - ) - self.CreateInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/CreateInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.UpdateInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/UpdateInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ImportInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/ImportInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.ExportInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/ExportInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.FailoverInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/FailoverInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.DeleteInstance = channel.unary_unary( - "/google.cloud.redis.v1beta1.CloudRedis/DeleteInstance", - request_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class CloudRedisServicer(object): - """Configures and manages Cloud Memorystore for Redis instances - - Google Cloud Memorystore for Redis v1beta1 - - The `redis.googleapis.com` service implements the Google Cloud Memorystore - for Redis API and defines the following resource model for managing Redis - instances: - * The service works with a collection of cloud projects, named: `/projects/*` - * Each project has a collection of available locations, named: `/locations/*` - * Each location has a collection of Redis instances, named: `/instances/*` - * As such, Redis instances are resources of the form: - `/projects/{project_id}/locations/{location_id}/instances/{instance_id}` - - Note that location_id must be refering to a GCP `region`; for example: - * `projects/redpepper-1290/locations/us-central1/instances/my-redis` - """ - - def ListInstances(self, request, context): - """Lists all Redis instances owned by a project in either the specified - location (region) or all locations. - - The location should have the following format: - * `projects/{project_id}/locations/{location_id}` - - If `location_id` is specified as `-` (wildcard), then all regions - available to the project are queried, and the results are aggregated. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetInstance(self, request, context): - """Gets the details of a specific Redis instance. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateInstance(self, request, context): - """Creates a Redis instance based on the specified tier and memory size. - - By default, the instance is accessible from the project's - [default network](/compute/docs/networks-and-firewalls#networks). - - The creation is executed asynchronously and callers may check the returned - operation to track its progress. Once the operation is completed the Redis - instance will be fully functional. Completed longrunning.Operation will - contain the new instance object in the response field. - - The returned operation is automatically deleted after a few hours, so there - is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateInstance(self, request, context): - """Updates the metadata and configuration of a specific Redis instance. - - Completed longrunning.Operation will contain the new instance object - in the response field. The returned operation is automatically deleted - after a few hours, so there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportInstance(self, request, context): - """Import a Redis RDB snapshot file from Cloud Storage into a Redis instance. - - Redis may stop serving during this operation. Instance state will be - IMPORTING for entire operation. When complete, the instance will contain - only data from the imported file. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ExportInstance(self, request, context): - """Export Redis instance data into a Redis RDB format file in Cloud Storage. - - Redis will continue serving during this operation. - - The returned operation is automatically deleted after a few hours, so - there is no need to call DeleteOperation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def FailoverInstance(self, request, context): - """Initiates a failover of the master node to current replica node for a - specific STANDARD tier Cloud Memorystore for Redis instance. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteInstance(self, request, context): - """Deletes a specific Redis instance. Instance stops serving and data is - deleted. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_CloudRedisServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListInstances": grpc.unary_unary_rpc_method_handler( - servicer.ListInstances, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesRequest.FromString, - response_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ListInstancesResponse.SerializeToString, - ), - "GetInstance": grpc.unary_unary_rpc_method_handler( - servicer.GetInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.GetInstanceRequest.FromString, - response_serializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.Instance.SerializeToString, - ), - "CreateInstance": grpc.unary_unary_rpc_method_handler( - servicer.CreateInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.CreateInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "UpdateInstance": grpc.unary_unary_rpc_method_handler( - servicer.UpdateInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.UpdateInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ImportInstance": grpc.unary_unary_rpc_method_handler( - servicer.ImportInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ImportInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "ExportInstance": grpc.unary_unary_rpc_method_handler( - servicer.ExportInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.ExportInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "FailoverInstance": grpc.unary_unary_rpc_method_handler( - servicer.FailoverInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.FailoverInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "DeleteInstance": grpc.unary_unary_rpc_method_handler( - servicer.DeleteInstance, - request_deserializer=google_dot_cloud_dot_redis__v1beta1_dot_proto_dot_cloud__redis__pb2.DeleteInstanceRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.redis.v1beta1.CloudRedis", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/redis/google/cloud/redis_v1beta1/types.py b/redis/google/cloud/redis_v1beta1/types.py deleted file mode 100644 index c7de16bf64f7..000000000000 --- a/redis/google/cloud/redis_v1beta1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.redis_v1beta1.proto import cloud_redis_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, field_mask_pb2, timestamp_pb2, status_pb2] - -_local_modules = [cloud_redis_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.redis_v1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/redis/noxfile.py b/redis/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/redis/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/redis/setup.cfg b/redis/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/redis/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/redis/setup.py b/redis/setup.py deleted file mode 100644 index 5ed53d6a6119..000000000000 --- a/redis/setup.py +++ /dev/null @@ -1,88 +0,0 @@ -# Copyright 2018 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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-redis" -description = "Google Cloud Memorystore for Redis API client library" -version = "0.3.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] -extras = {} - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/redis/synth.metadata b/redis/synth.metadata deleted file mode 100644 index 57fc4adc4af3..000000000000 --- a/redis/synth.metadata +++ /dev/null @@ -1,202 +0,0 @@ -{ - "updateTime": "2020-01-29T13:26:20.841851Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cf3b61102ed5f36b827bc82ec39be09525f018c8", - "internalRef": "292034635", - "log": "cf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n08b488e0660c59842a7dee0e3e2b65d9e3a514a9\nExposing cloud_catalog.proto (This API is already available through REST)\n\nPiperOrigin-RevId: 288625007\n\na613482977e11ac09fa47687a5d1b5a01efcf794\nUpdate the OS Login v1beta API description to render better in the UI.\n\nPiperOrigin-RevId: 288547940\n\n5e182b8d9943f1b17008d69d4c7e865dc83641a7\nUpdate the OS Login API description to render better in the UI.\n\nPiperOrigin-RevId: 288546443\n\ncb79155f596e0396dd900da93872be7066f6340d\nFix: Add a resource annotation for Agent\nFix: Correct the service name in annotations for Intent and SessionEntityType\n\nPiperOrigin-RevId: 288441307\n\nf7f6e9daec3315fd47cb638789bd8415bf4a27cc\nAdded cloud asset api v1p1beta1\n\nPiperOrigin-RevId: 288427239\n\nf2880f5b342c6345f3dcaad24fcb3c6ca9483654\nBilling account API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 288351810\n\ndc250ffe071729f8f8bef9d6fd0fbbeb0254c666\nFix: Remove incorrect resource annotations in requests\n\nPiperOrigin-RevId: 288321208\n\n91ef2d9dd69807b0b79555f22566fb2d81e49ff9\nAdd GAPIC annotations to Cloud KMS (but do not migrate the GAPIC config yet).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 287999179\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "redis", - "apiVersion": "v1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/redis/artman_redis_v1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "redis", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/redis/artman_redis_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v1beta1/api.rst" - }, - { - "path": "docs/gapic/v1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/redis.py" - }, - { - "path": "google/cloud/redis_v1/__init__.py" - }, - { - "path": "google/cloud/redis_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/redis_v1/gapic/cloud_redis_client.py" - }, - { - "path": "google/cloud/redis_v1/gapic/cloud_redis_client_config.py" - }, - { - "path": "google/cloud/redis_v1/gapic/enums.py" - }, - { - "path": "google/cloud/redis_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/redis_v1/gapic/transports/cloud_redis_grpc_transport.py" - }, - { - "path": "google/cloud/redis_v1/proto/__init__.py" - }, - { - "path": "google/cloud/redis_v1/proto/cloud_redis.proto" - }, - { - "path": "google/cloud/redis_v1/proto/cloud_redis_pb2.py" - }, - { - "path": "google/cloud/redis_v1/proto/cloud_redis_pb2_grpc.py" - }, - { - "path": "google/cloud/redis_v1/types.py" - }, - { - "path": "google/cloud/redis_v1beta1/__init__.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/cloud_redis_client.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/cloud_redis_client_config.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/redis_v1beta1/gapic/transports/cloud_redis_grpc_transport.py" - }, - { - "path": "google/cloud/redis_v1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/redis_v1beta1/proto/cloud_redis.proto" - }, - { - "path": "google/cloud/redis_v1beta1/proto/cloud_redis_pb2.py" - }, - { - "path": "google/cloud/redis_v1beta1/proto/cloud_redis_pb2_grpc.py" - }, - { - "path": "google/cloud/redis_v1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v1/test_cloud_redis_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1beta1/test_cloud_redis_client_v1beta1.py" - } - ] -} \ No newline at end of file diff --git a/redis/synth.py b/redis/synth.py deleted file mode 100644 index b569680461f3..000000000000 --- a/redis/synth.py +++ /dev/null @@ -1,104 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp -import logging - -logging.basicConfig(level=logging.DEBUG) - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -excludes = ["README.rst", "setup.py", "nox*.py", "docs/conf.py", "docs/index.rst"] - -# ---------------------------------------------------------------------------- -# Generate redis GAPIC layer -# ---------------------------------------------------------------------------- -for version in ["v1beta1", "v1"]: - library = gapic.py_library( - "redis", - version, - config_path=f"artman_redis_{version}.yaml", - include_protos=True, - ) - - s.copy(library, excludes=excludes) - -# Fix docstrings -s.replace( - "google/cloud/**/cloud_redis_client.py", - r"resources of the form:\n ``", - r"resources of the form:\n\n ``", -) - -s.replace( - "google/cloud/**/cloud_redis_client.py", - r""" - parent \(str\): Required. The resource name of the instance location using the form: - :: - - `projects/{project_id}/locations/{location_id}` - where ``location_id`` refers to a GCP region""", - r""" - parent (str): Required. The resource name of the instance location using the form ``projects/{project_id}/locations/{location_id}`` - where ``location_id`` refers to a GCP region""", -) - - -s.replace( - "google/cloud/**/cloud_redis_client.py", - r""" - with the following restrictions: - - \* Must contain only lowercase letters, numbers, and hyphens\.""", - r""" - with the following restrictions: - * Must contain only lowercase letters, numbers, and hyphens.""", -) - -s.replace( - "google/cloud/**/cloud_redis_client.py", - r""" - name \(str\): Required. Redis instance resource name using the form: - :: - - `projects/{project_id}/locations/{location_id}/instances/{instance_id}` - where ``location_id`` refers to a GCP region""", - r""" - name (str): Required. Redis instance resource name using the form ``projects/{project_id}/locations/{location_id}/instances/{instance_id}``` - where ``location_id`` refers to a GCP region""", -) - -s.replace( - "google/cloud/**/cloud_redis_client.py", - r""" - fields from ``Instance``: - - \* ``displayName`` - \* ``labels`` - \* ``memorySizeGb`` - \* ``redisConfig``""", - r""" - fields from ``Instance``: ``displayName``, ``labels``, ``memorySizeGb``, and ``redisConfig``.""", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/redis/tests/unit/gapic/v1/test_cloud_redis_client_v1.py b/redis/tests/unit/gapic/v1/test_cloud_redis_client_v1.py deleted file mode 100644 index f9ccc5ea0525..000000000000 --- a/redis/tests/unit/gapic/v1/test_cloud_redis_client_v1.py +++ /dev/null @@ -1,639 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import redis_v1 -from google.cloud.redis_v1 import enums -from google.cloud.redis_v1.proto import cloud_redis_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestCloudRedisClient(object): - def test_list_instances(self): - # Setup Expected Response - next_page_token = "" - instances_element = {} - instances = [instances_element] - expected_response = {"next_page_token": next_page_token, "instances": instances} - expected_response = cloud_redis_pb2.ListInstancesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_instances(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.instances[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ListInstancesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_instances_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_instances(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.get_instance(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.GetInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_instance_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - with pytest.raises(CustomException): - client.get_instance(name) - - def test_create_instance(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb_2 = 1493816946 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb_2, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - instance_id = "test_instance" - tier = enums.Instance.Tier.BASIC - memory_size_gb = 1 - instance = {"tier": tier, "memory_size_gb": memory_size_gb} - - response = client.create_instance(parent, instance_id, instance) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.CreateInstanceRequest( - parent=parent, instance_id=instance_id, instance=instance - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - instance_id = "test_instance" - tier = enums.Instance.Tier.BASIC - memory_size_gb = 1 - instance = {"tier": tier, "memory_size_gb": memory_size_gb} - - response = client.create_instance(parent, instance_id, instance) - exception = response.exception() - assert exception.errors[0] == error - - def test_update_instance(self): - # Setup Expected Response - name = "name3373707" - display_name_2 = "displayName21615000987" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name, - "display_name": display_name_2, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_update_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - paths_element = "display_name" - paths_element_2 = "memory_size_gb" - paths = [paths_element, paths_element_2] - update_mask = {"paths": paths} - display_name = " instance.memory_size_gb=4" - instance = {"display_name": display_name} - - response = client.update_instance(update_mask, instance) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.UpdateInstanceRequest( - update_mask=update_mask, instance=instance - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_update_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - paths_element = "display_name" - paths_element_2 = "memory_size_gb" - paths = [paths_element, paths_element_2] - update_mask = {"paths": paths} - display_name = " instance.memory_size_gb=4" - instance = {"display_name": display_name} - - response = client.update_instance(update_mask, instance) - exception = response.exception() - assert exception.errors[0] == error - - def test_import_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_import_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = "name3373707" - input_config = {} - - response = client.import_instance(name, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ImportInstanceRequest( - name=name, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = "name3373707" - input_config = {} - - response = client.import_instance(name, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = "name3373707" - output_config = {} - - response = client.export_instance(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ExportInstanceRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = "name3373707" - output_config = {} - - response = client.export_instance(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_failover_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_failover_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.failover_instance(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.FailoverInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_failover_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_failover_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.failover_instance(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_delete_instance(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.delete_instance(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.DeleteInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.delete_instance(name) - exception = response.exception() - assert exception.errors[0] == error diff --git a/redis/tests/unit/gapic/v1beta1/test_cloud_redis_client_v1beta1.py b/redis/tests/unit/gapic/v1beta1/test_cloud_redis_client_v1beta1.py deleted file mode 100644 index dd6abf77992d..000000000000 --- a/redis/tests/unit/gapic/v1beta1/test_cloud_redis_client_v1beta1.py +++ /dev/null @@ -1,641 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import redis_v1beta1 -from google.cloud.redis_v1beta1 import enums -from google.cloud.redis_v1beta1.proto import cloud_redis_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestCloudRedisClient(object): - def test_list_instances(self): - # Setup Expected Response - next_page_token = "" - instances_element = {} - instances = [instances_element] - expected_response = {"next_page_token": next_page_token, "instances": instances} - expected_response = cloud_redis_pb2.ListInstancesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_instances(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.instances[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ListInstancesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_instances_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_instances(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.get_instance(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.GetInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_instance_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - with pytest.raises(CustomException): - client.get_instance(name) - - def test_create_instance(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb_2 = 1493816946 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb_2, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_create_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - instance_id = "test_instance" - tier = enums.Instance.Tier.BASIC - memory_size_gb = 1 - instance = {"tier": tier, "memory_size_gb": memory_size_gb} - - response = client.create_instance(parent, instance_id, instance) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.CreateInstanceRequest( - parent=parent, instance_id=instance_id, instance=instance - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_create_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - instance_id = "test_instance" - tier = enums.Instance.Tier.BASIC - memory_size_gb = 1 - instance = {"tier": tier, "memory_size_gb": memory_size_gb} - - response = client.create_instance(parent, instance_id, instance) - exception = response.exception() - assert exception.errors[0] == error - - def test_update_instance(self): - # Setup Expected Response - name = "name3373707" - display_name_2 = "displayName21615000987" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb_2 = 1493816946 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name, - "display_name": display_name_2, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb_2, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_update_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - paths_element = "display_name" - paths_element_2 = "memory_size_gb" - paths = [paths_element, paths_element_2] - update_mask = {"paths": paths} - display_name = "UpdatedDisplayName" - memory_size_gb = 4 - instance = {"display_name": display_name, "memory_size_gb": memory_size_gb} - - response = client.update_instance(update_mask, instance) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.UpdateInstanceRequest( - update_mask=update_mask, instance=instance - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_update_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - paths_element = "display_name" - paths_element_2 = "memory_size_gb" - paths = [paths_element, paths_element_2] - update_mask = {"paths": paths} - display_name = "UpdatedDisplayName" - memory_size_gb = 4 - instance = {"display_name": display_name, "memory_size_gb": memory_size_gb} - - response = client.update_instance(update_mask, instance) - exception = response.exception() - assert exception.errors[0] == error - - def test_import_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_import_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = "name3373707" - input_config = {} - - response = client.import_instance(name, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ImportInstanceRequest( - name=name, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = "name3373707" - input_config = {} - - response = client.import_instance(name, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_export_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_export_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = "name3373707" - output_config = {} - - response = client.export_instance(name, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.ExportInstanceRequest( - name=name, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_export_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_export_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = "name3373707" - output_config = {} - - response = client.export_instance(name, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_failover_instance(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - location_id = "locationId552319461" - alternative_location_id = "alternativeLocationId-718920621" - redis_version = "redisVersion-685310444" - reserved_ip_range = "reservedIpRange-1082940580" - host = "host3208616" - port = 3446913 - current_location_id = "currentLocationId1312712735" - status_message = "statusMessage-239442758" - memory_size_gb = 34199707 - authorized_network = "authorizedNetwork-1733809270" - persistence_iam_identity = "persistenceIamIdentity1061944584" - expected_response = { - "name": name_2, - "display_name": display_name, - "location_id": location_id, - "alternative_location_id": alternative_location_id, - "redis_version": redis_version, - "reserved_ip_range": reserved_ip_range, - "host": host, - "port": port, - "current_location_id": current_location_id, - "status_message": status_message, - "memory_size_gb": memory_size_gb, - "authorized_network": authorized_network, - "persistence_iam_identity": persistence_iam_identity, - } - expected_response = cloud_redis_pb2.Instance(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_failover_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.failover_instance(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.FailoverInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_failover_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_failover_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.failover_instance(name) - exception = response.exception() - assert exception.errors[0] == error - - def test_delete_instance(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_delete_instance", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.delete_instance(name) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_redis_pb2.DeleteInstanceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_instance_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_delete_instance_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = redis_v1beta1.CloudRedisClient() - - # Setup Request - name = client.instance_path("[PROJECT]", "[LOCATION]", "[INSTANCE]") - - response = client.delete_instance(name) - exception = response.exception() - assert exception.errors[0] == error diff --git a/speech/.coveragerc b/speech/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/speech/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/speech/.flake8 b/speech/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/speech/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/speech/.repo-metadata.json b/speech/.repo-metadata.json deleted file mode 100644 index 18500b9ac8a0..000000000000 --- a/speech/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "speech", - "name_pretty": "Cloud Speech", - "product_documentation": "https://cloud.google.com/speech-to-text/docs/", - "client_documentation": "https://googleapis.dev/python/speech/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559758", - "release_level": "ga", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-speech", - "api_id": "speech.googleapis.com", - "requires_billing": false -} \ No newline at end of file diff --git a/speech/CHANGELOG.md b/speech/CHANGELOG.md deleted file mode 100644 index 68d1538cc2df..000000000000 --- a/speech/CHANGELOG.md +++ /dev/null @@ -1,251 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-speech/#history - -## 1.3.1 - -12-06-2019 13:05 PST - -### Implementation Changes -- Increase timeout values in client config (via synth). ([#9922](https://github.com/googleapis/google-cloud-python/pull/9922)) - -## 1.3.0 - -11-21-2019 14:03 PST - - -### Implementation Changes -- Mark `Recognize` as idempotent (via synth). ([#9874](https://github.com/googleapis/google-cloud-python/pull/9874)) -- Re-add unused `speaker_tag`; update spacing in docs templates (via synth). ([#9765](https://github.com/googleapis/google-cloud-python/pull/9765)) -- Move `speaker_tag` field from `SpeakerDiarizationConfig` to `WordInfo` (via synth). ([#9576](https://github.com/googleapis/google-cloud-python/pull/9576)) -- Remove send/recv msg size limit (via synth). ([#8969](https://github.com/googleapis/google-cloud-python/pull/8969)) - -### New Features -- Add speaker diarization configuration support (via synth). ([#9202](https://github.com/googleapis/google-cloud-python/pull/9202)) -- Add `SpeakerDiarizationConfig`, deprecate enable_speaker_diarization and diarization_speaker_count (via synth). ([#8795](https://github.com/googleapis/google-cloud-python/pull/8795)) - -### Documentation -- Add python 2 sunset banner to documentation. ([#9036](https://github.com/googleapis/google-cloud-python/pull/9036)) -- Reorder samples. ([#9313](https://github.com/googleapis/google-cloud-python/pull/9313)) -- Update docstrings (via synth). ([#9292](https://github.com/googleapis/google-cloud-python/pull/9292)) -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Add generated code samples. ([#9153](https://github.com/googleapis/google-cloud-python/pull/9153)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatibility badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -### Internal / Testing Changes -- Add v1p1beta1 systests for longrunning / streaming recognize. ([#9287](https://github.com/googleapis/google-cloud-python/pull/9287)) -- Add v1 systests for longrunning / streaming recognize. ([#9285](https://github.com/googleapis/google-cloud-python/pull/9285)) -- Update samples manifest (via synth). ([#9211](https://github.com/googleapis/google-cloud-python/pull/9211)) - -## 1.2.0 - -07-24-2019 17:35 PDT - -### New Features -- Add 'client_options' support (via synth). ([#8534](https://github.com/googleapis/google-cloud-python/pull/8534)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) -- Pin black version (via synth). ([#8596](https://github.com/googleapis/google-cloud-python/pull/8596)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -## 1.1.0 - -06-27-2019 16:55 PDT - -### Implementation Changes -- Allow kwargs to be passed to 'create_channel' (via synth). ([#8428](https://github.com/googleapis/google-cloud-python/pull/8428)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Increase speech max received msg size to 256 MiB ([#8338](https://github.com/googleapis/google-cloud-python/pull/8338)) -- Add MP3 to Audio Encoding and add boost to Speech Context (via synth). ([#8109](https://github.com/googleapis/google-cloud-python/pull/8109)) -- Add Recognition Metadata (via synth). ([#7961](https://github.com/googleapis/google-cloud-python/pull/7961)) - -### Documentation -- Update to show 'google-cloud-speech' is GA. ([#8453](https://github.com/googleapis/google-cloud-python/pull/8453)) -- Tweak 'SpeechContext' docstring (via synth). ([#8223](https://github.com/googleapis/google-cloud-python/pull/8223)) - -### Internal / Testing Changes -- All: Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- (Re)-blacken (via synth). ([#8446](https://github.com/googleapis/google-cloud-python/pull/8446)) -- Add disclaimer to auto-generated template files (via synth). ([#8328](https://github.com/googleapis/google-cloud-python/pull/8328)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8252](https://github.com/googleapis/google-cloud-python/pull/8252)) -- Fix coverage in 'types.py' (via synth). ([#8164](https://github.com/googleapis/google-cloud-python/pull/8164)) -- Blacken noxfile.py, setup.py (via synth). ([#8132](https://github.com/googleapis/google-cloud-python/pull/8132)) -- Add empty lines. ([#8072](https://github.com/googleapis/google-cloud-python/pull/8072)) -- Update noxfile (via synth). ([#7836](https://github.com/googleapis/google-cloud-python/pull/7836)) -- Add nox session `docs` (via synth). ([#7782](https://github.com/googleapis/google-cloud-python/pull/7782)) - -## 1.0.0 - -03-18-2019 08:05 PDT - - -### Implementation Changes -- Remove unused message exports. ([#7275](https://github.com/googleapis/google-cloud-python/pull/7275)) - -### New Features -- Promote google-cloud-speech to GA ([#7525](https://github.com/googleapis/google-cloud-python/pull/7525)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) - -### Internal / Testing Changes -- Speech: copy lintified proto files (via synth). -- Add clarifying comment to blacken nox target. ([#7404](https://github.com/googleapis/google-cloud-python/pull/7404)) -- Copy proto files alongside protoc versions. Remove unneeded utf-8 header. - -## 0.36.3 - -01-31-2019 09:57 PST - - -### New Features -- Add 'RecognitionConfig.audio_channel_count' field via synth. ([#7240](https://github.com/googleapis/google-cloud-python/pull/7240)) - -### Documentation -- Modify file headers. ([#7158](https://github.com/googleapis/google-cloud-python/pull/7158)) - -### Internal / Testing Changes -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.36.2 - -01-10-2019 15:36 PST - -### Implementation Changes -- Protoc-generated serialization update. ([#7106](https://github.com/googleapis/google-cloud-python/pull/7106)) - -### Documentation -- Regenerate speech to change quote chars in docstr. -- Pick up stub docstring fix in GAPIC generator. ([#6982](https://github.com/googleapis/google-cloud-python/pull/6982)) - -## 0.36.1 - -12-18-2018 09:46 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes to GAIPC generator. ([#6508](https://github.com/googleapis/google-cloud-python/pull/6508)) -- Add `result_end_time`, docstring changes via synth. ([#6462](https://github.com/googleapis/google-cloud-python/pull/6462)) -- Assorted synth fixups / cleanups ([#6400](https://github.com/googleapis/google-cloud-python/pull/6400)) -- Fix `client_info` bug, update docstrings and timeouts. ([#6421](https://github.com/googleapis/google-cloud-python/pull/6421)) -- Re-generate library using speech/synth.py ([#5979](https://github.com/googleapis/google-cloud-python/pull/5979)) - -### Dependencies -- Bump minimum `api_core` version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) -- Clarify passed arguments in speech examples. ([#6857](https://github.com/googleapis/google-cloud-python/pull/6857)) -- Docs: normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Fix client library URL. ([#6052](https://github.com/googleapis/google-cloud-python/pull/6052)) -- Prep docs for repo split. ([#6017](https://github.com/googleapis/google-cloud-python/pull/6017)) - -### Internal / Testing Changes -- Synth.metadata. ([#6868](https://github.com/googleapis/google-cloud-python/pull/6868)) -- Update noxfile. -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Add / fix badges for PyPI / versions. ([#6158](https://github.com/googleapis/google-cloud-python/pull/6158)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) - -## 0.36.0 - -### New Features - -- Re-generate the library to pick up changes and new features in the underlying API. ([#5915](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5915)) - -### Documentation - -- Fix broken links to description of 'Beta' ([#5917](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5917)) -- Replace links to '/stable/' with '/latest/'. ([#5901](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5901)) - -## 0.35.0 - -### Implementation Changes - -- Re-generated the library to pick up new API features. (#5577) - -### Internal / Testing Changes - -- Add Test runs for Python 3.7 and remove 3.4 (#5295) -- Avoid overwriting '__module__' of messages from shared modules. (#5364) -- Modify system tests to use prerelease versions of grpcio (#5304) - -## 0.34.0 - -### Implementation Changes -- Regenerate GAPIC to account for the removal of GoogleDataCollectionConfig and google_data_collection_opt_in (#5235) - -## 0.33.0 - -### New Features - -- Add Audio Logging and Recognition Metadata. (#5123) - -### Internal / Testing Changes - -- Fix bad trove classifier - -## 0.32.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) - -## 0.31.1 - -### Bugfixes - -- Fix speech helpers to properly pass retry and timeout args. (#4828, #4830) - -## 0.31.0 - -This is the (hopefully) final release candidate before 1.0. - -### Breaking Changes - -- The deprecated Speech layer (deprecated since 0.27.0) has been removed. If you are still using it, the [migration guide](https://cloud.google.com/speech/docs/python-client-migration) is still available. -- The following changes are _technically_ breaking but very unlikely to affect you directly: - * `google.cloud.gapic.speech.v1` moved to `google.cloud.speech_v1.gapic`, in accordance with more recent clients. - * `google.cloud.proto.speech.v1` moved to `google.cloud.speech_v1.proto`, in accordance with more recent clients. - -### Dependencies - - * Removed dependency on `google-gax`. - * Added dependency on `google-api-core`, its replacement. - -## 0.30.0 - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) -- Deferring to `google-api-core` for `grpcio` and - `googleapis-common-protos`dependencies (#4096, #4098) - -PyPI: https://pypi.org/project/google-cloud-speech/0.30.0/ diff --git a/speech/LICENSE b/speech/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/speech/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/speech/MANIFEST.in b/speech/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/speech/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/speech/README.rst b/speech/README.rst deleted file mode 100644 index 3cdf9fda5668..000000000000 --- a/speech/README.rst +++ /dev/null @@ -1,109 +0,0 @@ -Python Client for Cloud Speech API -================================== - - -|GA| |pypi| |versions| - -The `Cloud Speech API`_ enables developers to convert audio to text by applying -powerful neural network models. The API recognizes over 80 languages and -variants, to support your global user base. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#general-availability -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-speech.svg - :target: https://pypi.org/project/google-cloud-speech/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-speech.svg - :target: https://pypi.org/project/google-cloud-speech/ -.. _Cloud Speech API: https://cloud.google.com/speech -.. _Client Library Documentation: https://googleapis.dev/python/speech/latest -.. _Product Documentation: https://cloud.google.com/speech - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Speech API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Speech API.: https://cloud.google.com/speech -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-speech - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-speech - -Example Usage -~~~~~~~~~~~~~ - -.. code:: py - - from google.cloud import speech_v1 - from google.cloud.speech_v1 import enums - - client = speech_v1.SpeechClient() - - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = 'en-US' - config = {'encoding': encoding, 'sample_rate_hertz': sample_rate_hertz, 'language_code': language_code} - uri = 'gs://bucket_name/file_name.flac' - audio = {'uri': uri} - - response = client.recognize(config, audio) - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Speech API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. - APIs that we cover. diff --git a/speech/docs/README.rst b/speech/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/speech/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/speech/docs/_static/custom.css b/speech/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/speech/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/speech/docs/_templates/layout.html b/speech/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/speech/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/speech/docs/changelog.md b/speech/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/speech/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/speech/docs/conf.py b/speech/docs/conf.py deleted file mode 100644 index 75ca066ef747..000000000000 --- a/speech/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-speech documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-speech" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-speech-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-speech.tex", - u"google-cloud-speech Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-speech", - u"google-cloud-speech Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-speech", - u"google-cloud-speech Documentation", - author, - "google-cloud-speech", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/speech/docs/gapic/v1/api.rst b/speech/docs/gapic/v1/api.rst deleted file mode 100644 index a04f18ad6ba1..000000000000 --- a/speech/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Speech-to-Text API -=================================== - -.. automodule:: google.cloud.speech_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/speech/docs/gapic/v1/types.rst b/speech/docs/gapic/v1/types.rst deleted file mode 100644 index 71a61184ef32..000000000000 --- a/speech/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Speech-to-Text API Client -========================================= - -.. automodule:: google.cloud.speech_v1.types - :members: \ No newline at end of file diff --git a/speech/docs/gapic/v1p1beta1/api.rst b/speech/docs/gapic/v1p1beta1/api.rst deleted file mode 100644 index 9493c970c2bc..000000000000 --- a/speech/docs/gapic/v1p1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Speech-to-Text API -=================================== - -.. automodule:: google.cloud.speech_v1p1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/speech/docs/gapic/v1p1beta1/types.rst b/speech/docs/gapic/v1p1beta1/types.rst deleted file mode 100644 index 6ce93d567607..000000000000 --- a/speech/docs/gapic/v1p1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Speech-to-Text API Client -========================================= - -.. automodule:: google.cloud.speech_v1p1beta1.types - :members: \ No newline at end of file diff --git a/speech/docs/index.rst b/speech/docs/index.rst deleted file mode 100644 index 02f947a7e224..000000000000 --- a/speech/docs/index.rst +++ /dev/null @@ -1,282 +0,0 @@ -.. include:: README.rst - -Using the Library ------------------ - -Asynchronous Recognition -~~~~~~~~~~~~~~~~~~~~~~~~ - -The :meth:`~.speech_v1.SpeechClient.long_running_recognize` method -sends audio data to the Speech API and initiates a Long Running Operation. - -Using this operation, you can periodically poll for recognition results. -Use asynchronous requests for audio data of any duration up to 80 minutes. - -See: `Speech Asynchronous Recognize`_ - - -.. code-block:: python - - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> audio = speech.types.RecognitionAudio( - ... uri='gs://my-bucket/recording.flac') - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100) - >>> operation = client.long_running_recognize(config=config, audio=audio) - >>> op_result = operation.result() - >>> for result in op_result.results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print(alternative.transcript) - ... print(alternative.confidence) - ==================== - 'how old is the Brooklyn Bridge' - 0.98267895 - - -Synchronous Recognition -~~~~~~~~~~~~~~~~~~~~~~~ - -The :meth:`~.speech_v1.SpeechClient.recognize` method converts speech -data to text and returns alternative text transcriptions. - -This example uses ``language_code='en-GB'`` to better recognize a dialect from -Great Britain. - -.. code-block:: python - - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> audio = speech.types.RecognitionAudio( - ... uri='gs://my-bucket/recording.flac') - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100) - >>> results = client.recognize(config=config, audio=audio) - >>> for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ==================== - transcript: Hello, this is a test - confidence: 0.81 - ==================== - transcript: Hello, this is one test - confidence: 0 - -Example of using the profanity filter. - -.. code-block:: python - - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> audio = speech.types.RecognitionAudio( - ... uri='gs://my-bucket/recording.flac') - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100, - ... profanity_filter=True) - >>> results = client.recognize(config=config, audio=audio) - >>> for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ==================== - transcript: Hello, this is a f****** test - confidence: 0.81 - -Using speech context hints to get better results. This can be used to improve -the accuracy for specific words and phrases. This can also be used to add new -words to the vocabulary of the recognizer. - -.. code-block:: python - - >>> from google.cloud import speech - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> audio = speech.types.RecognitionAudio( - ... uri='gs://my-bucket/recording.flac') - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100, - ... speech_contexts=[speech.types.SpeechContext( - ... phrases=['hi', 'good afternoon'], - ... )]) - >>> results = client.recognize(config=config, audio=audio) - >>> for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ==================== - transcript: Hello, this is a test - confidence: 0.81 - - -Streaming Recognition -~~~~~~~~~~~~~~~~~~~~~ - -The :meth:`~speech_v1.SpeechClient.streaming_recognize` method converts -speech data to possible text alternatives on the fly. - -.. note:: - Streaming recognition requests are limited to 1 minute of audio. - - See: https://cloud.google.com/speech/limits#content - -.. code-block:: python - - >>> import io - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100, - ... ) - >>> with io.open('./hello.wav', 'rb') as stream: - ... requests = [speech.types.StreamingRecognizeRequest( - ... audio_content=stream.read(), - ... )] - >>> results = sample.streaming_recognize( - ... config=speech.types.StreamingRecognitionConfig(config=config), - ... requests, - ... ) - >>> for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ==================== - transcript: hello thank you for using Google Cloud platform - confidence: 0.927983105183 - - -By default the API will perform continuous recognition -(continuing to process audio even if the speaker in the audio pauses speaking) -until the client closes the output stream or until the maximum time limit has -been reached. - -If you only want to recognize a single utterance you can set -``single_utterance`` to :data:`True` and only one result will be returned. - -See: `Single Utterance`_ - -.. code-block:: python - - >>> import io - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100, - ... ) - >>> with io.open('./hello-pause-goodbye.wav', 'rb') as stream: - ... requests = [speech.types.StreamingRecognizeRequest( - ... audio_content=stream.read(), - ... )] - >>> results = sample.streaming_recognize( - ... config=speech.types.StreamingRecognitionConfig( - ... config=config, - ... single_utterance=False, - ... ), - ... requests, - ... ) - >>> for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ... for result in results: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ==================== - transcript: testing a pause - confidence: 0.933770477772 - -If ``interim_results`` is set to :data:`True`, interim results -(tentative hypotheses) may be returned as they become available. - -.. code-block:: python - - >>> import io - >>> from google.cloud import speech - >>> client = speech.SpeechClient() - >>> config = speech.types.RecognitionConfig( - ... encoding=speech.enums.RecognitionConfig.AudioEncoding.LINEAR16, - ... language_code='en-US', - ... sample_rate_hertz=44100, - ... ) - >>> with io.open('./hello.wav', 'rb') as stream: - ... requests = [speech.types.StreamingRecognizeRequest( - ... audio_content=stream.read(), - ... )] - >>> config = speech.types.StreamingRecognitionConfig(config=config) - >>> responses = client.streaming_recognize(config,requests) - >>> for response in responses: - ... for result in response: - ... for alternative in result.alternatives: - ... print('=' * 20) - ... print('transcript: ' + alternative.transcript) - ... print('confidence: ' + str(alternative.confidence)) - ... print('is_final:' + str(result.is_final)) - ==================== - 'he' - None - False - ==================== - 'hell' - None - False - ==================== - 'hello' - 0.973458576 - True - - -.. _Single Utterance: https://cloud.google.com/speech/reference/rpc/google.cloud.speech.v1beta1#streamingrecognitionconfig -.. _sync_recognize: https://cloud.google.com/speech/reference/rest/v1beta1/speech/syncrecognize -.. _Speech Asynchronous Recognize: https://cloud.google.com/speech/reference/rest/v1beta1/speech/asyncrecognize - - -API Reference -------------- - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - -A new beta release, spelled ``v1p1beta1``, is provided to provide for preview -of upcoming features. In order to use this, you will want to import from -``google.cloud.speech_v1p1beta1`` in lieu of ``google.cloud.speech``. - -An API and type reference is provided the first beta also: - -.. toctree:: - :maxdepth: 2 - - gapic/v1p1beta1/api - gapic/v1p1beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-speech`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/speech/google/__init__.py b/speech/google/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/speech/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/speech/google/cloud/__init__.py b/speech/google/cloud/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/speech/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/speech/google/cloud/speech.py b/speech/google/cloud/speech.py deleted file mode 100644 index 792e3f6719de..000000000000 --- a/speech/google/cloud/speech.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.speech_v1 import SpeechClient -from google.cloud.speech_v1 import enums -from google.cloud.speech_v1 import types - - -__all__ = ("enums", "types", "SpeechClient") diff --git a/speech/google/cloud/speech_v1/__init__.py b/speech/google/cloud/speech_v1/__init__.py deleted file mode 100644 index 81314685022a..000000000000 --- a/speech/google/cloud/speech_v1/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.speech_v1.gapic import speech_client -from google.cloud.speech_v1.gapic import enums - -from google.cloud.speech_v1.helpers import SpeechHelpers -from google.cloud.speech_v1 import types - - -class SpeechClient(SpeechHelpers, speech_client.SpeechClient): - __doc__ = speech_client.SpeechClient.__doc__ - enums = enums - types = types - - -__all__ = ("enums", "SpeechClient", "types") diff --git a/speech/google/cloud/speech_v1/gapic/__init__.py b/speech/google/cloud/speech_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1/gapic/enums.py b/speech/google/cloud/speech_v1/gapic/enums.py deleted file mode 100644 index fa6218ab83bd..000000000000 --- a/speech/google/cloud/speech_v1/gapic/enums.py +++ /dev/null @@ -1,196 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class RecognitionConfig(object): - class AudioEncoding(enum.IntEnum): - """ - The encoding of the audio data sent in the request. - - All encodings support only 1 channel (mono) audio, unless the - ``audio_channel_count`` and ``enable_separate_recognition_per_channel`` - fields are set. - - For best results, the audio source should be captured and transmitted - using a lossless encoding (``FLAC`` or ``LINEAR16``). The accuracy of - the speech recognition can be reduced if lossy codecs are used to - capture or transmit audio, particularly if background noise is present. - Lossy codecs include ``MULAW``, ``AMR``, ``AMR_WB``, ``OGG_OPUS``, - ``SPEEX_WITH_HEADER_BYTE``, and ``MP3``. - - The ``FLAC`` and ``WAV`` audio file formats include a header that - describes the included audio content. You can request recognition for - ``WAV`` files that contain either ``LINEAR16`` or ``MULAW`` encoded - audio. If you send ``FLAC`` or ``WAV`` audio file format in your - request, you do not need to specify an ``AudioEncoding``; the audio - encoding format is determined from the file header. If you specify an - ``AudioEncoding`` when you send send ``FLAC`` or ``WAV`` audio, the - encoding configuration must match the encoding described in the audio - header; otherwise the request returns an - ``google.rpc.Code.INVALID_ARGUMENT`` error code. - - Attributes: - ENCODING_UNSPECIFIED (int): Not specified. - LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). - FLAC (int): ``FLAC`` (Free Lossless Audio Codec) is the recommended encoding because - it is lossless--therefore recognition is not compromised--and requires - only about half the bandwidth of ``LINEAR16``. ``FLAC`` stream encoding - supports 16-bit and 24-bit samples, however, not all fields in - ``STREAMINFO`` are supported. - MULAW (int): 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - AMR (int): Adaptive Multi-Rate Narrowband codec. ``sample_rate_hertz`` must be - 8000. - AMR_WB (int): Adaptive Multi-Rate Wideband codec. ``sample_rate_hertz`` must be 16000. - OGG_OPUS (int): Opus encoded audio frames in Ogg container - (`OggOpus `__). ``sample_rate_hertz`` - must be one of 8000, 12000, 16000, 24000, or 48000. - SPEEX_WITH_HEADER_BYTE (int): Although the use of lossy encodings is not recommended, if a very low - bitrate encoding is required, ``OGG_OPUS`` is highly preferred over - Speex encoding. The `Speex `__ encoding supported by - Cloud Speech API has a header byte in each block, as in MIME type - ``audio/x-speex-with-header-byte``. It is a variant of the RTP Speex - encoding defined in `RFC 5574 `__. - The stream is a sequence of blocks, one block per RTP packet. Each block - starts with a byte containing the length of the block, in bytes, - followed by one or more frames of Speex data, padded to an integral - number of bytes (octets) as specified in RFC 5574. In other words, each - RTP header is replaced with a single byte containing the block length. - Only Speex wideband is supported. ``sample_rate_hertz`` must be 16000. - """ - - ENCODING_UNSPECIFIED = 0 - LINEAR16 = 1 - FLAC = 2 - MULAW = 3 - AMR = 4 - AMR_WB = 5 - OGG_OPUS = 6 - SPEEX_WITH_HEADER_BYTE = 7 - - -class RecognitionMetadata(object): - class InteractionType(enum.IntEnum): - """ - Use case categories that the audio recognition request can be described - by. - - Attributes: - INTERACTION_TYPE_UNSPECIFIED (int): Use case is either unknown or is something other than one of the other - values below. - DISCUSSION (int): Multiple people in a conversation or discussion. For example in a - meeting with two or more people actively participating. Typically all - the primary people speaking would be in the same room (if not, see - PHONE\_CALL) - PRESENTATION (int): One or more persons lecturing or presenting to others, mostly - uninterrupted. - PHONE_CALL (int): A phone-call or video-conference in which two or more people, who are - not in the same room, are actively participating. - VOICEMAIL (int): A recorded message intended for another person to listen to. - PROFESSIONALLY_PRODUCED (int): Professionally produced audio (eg. TV Show, Podcast). - VOICE_SEARCH (int): Transcribe spoken questions and queries into text. - VOICE_COMMAND (int): Transcribe voice commands, such as for controlling a device. - DICTATION (int): Transcribe speech to text to create a written document, such as a - text-message, email or report. - """ - - INTERACTION_TYPE_UNSPECIFIED = 0 - DISCUSSION = 1 - PRESENTATION = 2 - PHONE_CALL = 3 - VOICEMAIL = 4 - PROFESSIONALLY_PRODUCED = 5 - VOICE_SEARCH = 6 - VOICE_COMMAND = 7 - DICTATION = 8 - - class MicrophoneDistance(enum.IntEnum): - """ - Enumerates the types of capture settings describing an audio file. - - Attributes: - MICROPHONE_DISTANCE_UNSPECIFIED (int): Audio type is not known. - NEARFIELD (int): The audio was captured from a closely placed microphone. Eg. phone, - dictaphone, or handheld microphone. Generally if there speaker is within - 1 meter of the microphone. - MIDFIELD (int): The speaker if within 3 meters of the microphone. - FARFIELD (int): The speaker is more than 3 meters away from the microphone. - """ - - MICROPHONE_DISTANCE_UNSPECIFIED = 0 - NEARFIELD = 1 - MIDFIELD = 2 - FARFIELD = 3 - - class OriginalMediaType(enum.IntEnum): - """ - The original media the speech was recorded on. - - Attributes: - ORIGINAL_MEDIA_TYPE_UNSPECIFIED (int): Unknown original media type. - AUDIO (int): The speech data is an audio recording. - VIDEO (int): The speech data originally recorded on a video. - """ - - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 - AUDIO = 1 - VIDEO = 2 - - class RecordingDeviceType(enum.IntEnum): - """ - The type of device the speech was recorded with. - - Attributes: - RECORDING_DEVICE_TYPE_UNSPECIFIED (int): The recording device is unknown. - SMARTPHONE (int): Speech was recorded on a smartphone. - PC (int): Speech was recorded using a personal computer or tablet. - PHONE_LINE (int): Speech was recorded over a phone line. - VEHICLE (int): Speech was recorded in a vehicle. - OTHER_OUTDOOR_DEVICE (int): Speech was recorded outdoors. - OTHER_INDOOR_DEVICE (int): Speech was recorded indoors. - """ - - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 - SMARTPHONE = 1 - PC = 2 - PHONE_LINE = 3 - VEHICLE = 4 - OTHER_OUTDOOR_DEVICE = 5 - OTHER_INDOOR_DEVICE = 6 - - -class StreamingRecognizeResponse(object): - class SpeechEventType(enum.IntEnum): - """ - Indicates the type of speech event. - - Attributes: - SPEECH_EVENT_UNSPECIFIED (int): No speech event specified. - END_OF_SINGLE_UTTERANCE (int): This event indicates that the server has detected the end of the user's - speech utterance and expects no additional speech. Therefore, the server - will not process additional audio (although it may subsequently return - additional results). The client should stop sending additional audio - data, half-close the gRPC connection, and wait for any additional - results until the server closes the gRPC connection. This event is only - sent if ``single_utterance`` was set to ``true``, and is not used - otherwise. - """ - - SPEECH_EVENT_UNSPECIFIED = 0 - END_OF_SINGLE_UTTERANCE = 1 diff --git a/speech/google/cloud/speech_v1/gapic/speech_client.py b/speech/google/cloud/speech_v1/gapic/speech_client.py deleted file mode 100644 index 83cb7f4452ce..000000000000 --- a/speech/google/cloud/speech_v1/gapic/speech_client.py +++ /dev/null @@ -1,412 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.speech.v1 Speech API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.speech_v1.gapic import enums -from google.cloud.speech_v1.gapic import speech_client_config -from google.cloud.speech_v1.gapic.transports import speech_grpc_transport -from google.cloud.speech_v1.proto import cloud_speech_pb2 -from google.cloud.speech_v1.proto import cloud_speech_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-speech").version - - -class SpeechClient(object): - """Service that implements Google Cloud Speech API.""" - - SERVICE_ADDRESS = "speech.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.speech.v1.Speech" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - SpeechClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.SpeechGrpcTransport, - Callable[[~.Credentials, type], ~.SpeechGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = speech_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=speech_grpc_transport.SpeechGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = speech_grpc_transport.SpeechGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def recognize( - self, - config, - audio, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - - Example: - >>> from google.cloud import speech_v1 - >>> from google.cloud.speech_v1 import enums - >>> - >>> client = speech_v1.SpeechClient() - >>> - >>> encoding = enums.RecognitionConfig.AudioEncoding.FLAC - >>> sample_rate_hertz = 44100 - >>> language_code = 'en-US' - >>> config = {'encoding': encoding, 'sample_rate_hertz': sample_rate_hertz, 'language_code': language_code} - >>> uri = 'gs://bucket_name/file_name.flac' - >>> audio = {'uri': uri} - >>> - >>> response = client.recognize(config, audio) - - Args: - config (Union[dict, ~google.cloud.speech_v1.types.RecognitionConfig]): Required. Provides information to the recognizer that specifies how to - process the request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1.types.RecognitionConfig` - audio (Union[dict, ~google.cloud.speech_v1.types.RecognitionAudio]): Required. The audio data to be recognized. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1.types.RecognitionAudio` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.speech_v1.types.RecognizeResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.recognize, - default_retry=self._method_configs["Recognize"].retry, - default_timeout=self._method_configs["Recognize"].timeout, - client_info=self._client_info, - ) - - request = cloud_speech_pb2.RecognizeRequest(config=config, audio=audio) - return self._inner_api_calls["recognize"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def long_running_recognize( - self, - config, - audio, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - ``Operation.error`` or an ``Operation.response`` which contains a - ``LongRunningRecognizeResponse`` message. For more information on - asynchronous speech recognition, see the - `how-to `__. - - Example: - >>> from google.cloud import speech_v1 - >>> from google.cloud.speech_v1 import enums - >>> - >>> client = speech_v1.SpeechClient() - >>> - >>> encoding = enums.RecognitionConfig.AudioEncoding.FLAC - >>> sample_rate_hertz = 44100 - >>> language_code = 'en-US' - >>> config = {'encoding': encoding, 'sample_rate_hertz': sample_rate_hertz, 'language_code': language_code} - >>> uri = 'gs://bucket_name/file_name.flac' - >>> audio = {'uri': uri} - >>> - >>> response = client.long_running_recognize(config, audio) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - config (Union[dict, ~google.cloud.speech_v1.types.RecognitionConfig]): Required. Provides information to the recognizer that specifies how to - process the request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1.types.RecognitionConfig` - audio (Union[dict, ~google.cloud.speech_v1.types.RecognitionAudio]): Required. The audio data to be recognized. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1.types.RecognitionAudio` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.speech_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "long_running_recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "long_running_recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.long_running_recognize, - default_retry=self._method_configs["LongRunningRecognize"].retry, - default_timeout=self._method_configs["LongRunningRecognize"].timeout, - client_info=self._client_info, - ) - - request = cloud_speech_pb2.LongRunningRecognizeRequest( - config=config, audio=audio - ) - operation = self._inner_api_calls["long_running_recognize"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_speech_pb2.LongRunningRecognizeResponse, - metadata_type=cloud_speech_pb2.LongRunningRecognizeMetadata, - ) - - def streaming_recognize( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - - EXPERIMENTAL: This method interface might change in the future. - - Example: - >>> from google.cloud import speech_v1 - >>> - >>> client = speech_v1.SpeechClient() - >>> - >>> request = {} - >>> - >>> requests = [request] - >>> for element in client.streaming_recognize(requests): - ... # process element - ... pass - - Args: - requests (iterator[dict|google.cloud.speech_v1.proto.cloud_speech_pb2.StreamingRecognizeRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.speech_v1.types.StreamingRecognizeRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - Iterable[~google.cloud.speech_v1.types.StreamingRecognizeResponse]. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "streaming_recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "streaming_recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.streaming_recognize, - default_retry=self._method_configs["StreamingRecognize"].retry, - default_timeout=self._method_configs["StreamingRecognize"].timeout, - client_info=self._client_info, - ) - - return self._inner_api_calls["streaming_recognize"]( - requests, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/speech/google/cloud/speech_v1/gapic/speech_client_config.py b/speech/google/cloud/speech_v1/gapic/speech_client_config.py deleted file mode 100644 index 555d3f2a7005..000000000000 --- a/speech/google/cloud/speech_v1/gapic/speech_client_config.py +++ /dev/null @@ -1,38 +0,0 @@ -config = { - "interfaces": { - "google.cloud.speech.v1.Speech": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 1000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 1000000, - "total_timeout_millis": 5000000, - } - }, - "methods": { - "Recognize": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "LongRunningRecognize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StreamingRecognize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/speech/google/cloud/speech_v1/gapic/transports/__init__.py b/speech/google/cloud/speech_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py b/speech/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py deleted file mode 100644 index c0d9c39d2d0c..000000000000 --- a/speech/google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.speech_v1.proto import cloud_speech_pb2_grpc - - -class SpeechGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.speech.v1 Speech API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="speech.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"speech_stub": cloud_speech_pb2_grpc.SpeechStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="speech.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.recognize`. - - Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].Recognize - - @property - def long_running_recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.long_running_recognize`. - - Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - ``Operation.error`` or an ``Operation.response`` which contains a - ``LongRunningRecognizeResponse`` message. For more information on - asynchronous speech recognition, see the - `how-to `__. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].LongRunningRecognize - - @property - def streaming_recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.streaming_recognize`. - - Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].StreamingRecognize diff --git a/speech/google/cloud/speech_v1/helpers.py b/speech/google/cloud/speech_v1/helpers.py deleted file mode 100644 index 26f17dbe52d3..000000000000 --- a/speech/google/cloud/speech_v1/helpers.py +++ /dev/null @@ -1,102 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -import google.api_core.gapic_v1.method - - -class SpeechHelpers(object): - """A set of convenience methods to make the Speech client easier to use. - - This class should be considered abstract; it is used as a superclass - in a multiple-inheritance construction alongside the applicable GAPIC. - See the :class:`~google.cloud.speech_v1.SpeechClient`. - """ - - def streaming_recognize( - self, - config, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - ): - """Perform bi-directional speech recognition. - - This method allows you to receive results while sending audio; - it is only available via. gRPC (not REST). - - .. warning:: - - This method is EXPERIMENTAL. Its interface might change in the - future. - - Example: - >>> from google.cloud.speech_v1 import enums - >>> from google.cloud.speech_v1 import SpeechClient - >>> from google.cloud.speech_v1 import types - >>> client = SpeechClient() - >>> config = types.StreamingRecognitionConfig( - ... config=types.RecognitionConfig( - ... encoding=enums.RecognitionConfig.AudioEncoding.FLAC, - ... ), - ... ) - >>> request = types.StreamingRecognizeRequest(audio_content=b'...') - >>> requests = [request] - >>> for element in client.streaming_recognize(config, requests): - ... # process element - ... pass - - Args: - config (:class:`~.types.StreamingRecognitionConfig`): The - configuration to use for the stream. - requests (Iterable[:class:`~.types.StreamingRecognizeRequest`]): - The input objects. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Returns: - Iterable[:class:`~.types.StreamingRecognizeResponse`] - - Raises: - :exc:`google.gax.errors.GaxError` if the RPC is aborted. - :exc:`ValueError` if the parameters are invalid. - """ - return super(SpeechHelpers, self).streaming_recognize( - self._streaming_request_iterable(config, requests), - retry=retry, - timeout=timeout, - ) - - def _streaming_request_iterable(self, config, requests): - """A generator that yields the config followed by the requests. - - Args: - config (~.speech_v1.types.StreamingRecognitionConfig): The - configuration to use for the stream. - requests (Iterable[~.speech_v1.types.StreamingRecognizeRequest]): - The input objects. - - Returns: - Iterable[~.speech_v1.types.StreamingRecognizeRequest]): The - correctly formatted input for - :meth:`~.speech_v1.SpeechClient.streaming_recognize`. - """ - yield self.types.StreamingRecognizeRequest(streaming_config=config) - for request in requests: - yield request diff --git a/speech/google/cloud/speech_v1/proto/__init__.py b/speech/google/cloud/speech_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1/proto/cloud_speech.proto b/speech/google/cloud/speech_v1/proto/cloud_speech.proto deleted file mode 100644 index f343fa21da85..000000000000 --- a/speech/google/cloud/speech_v1/proto/cloud_speech.proto +++ /dev/null @@ -1,759 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.speech.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { - } -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // The number of channels in the input audio data. - // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. - // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - // If `0` or omitted, defaults to one channel (mono). - // Note: We only recognize the first channel by default. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Array of [SpeechContext][google.cloud.speech.v1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/context-strength). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - // Note: This is currently offered as an experimental service, complimentary - // to all users. In the future this may be exclusively available as a - // premium feature. - bool enable_automatic_punctuation = 11; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; - - // Unused. - int32 speaker_tag = 5 - [(google.api.field_behavior) = OUTPUT_ONLY, deprecated = true]; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of ten `StreamingRecognizeResponse`s that might -// be returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of - // the language in this result. This language code was detected to have the - // most likelihood of being spoken in the audio. - string language_code = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/speech/google/cloud/speech_v1/proto/cloud_speech_pb2.py b/speech/google/cloud/speech_v1/proto/cloud_speech_pb2.py deleted file mode 100644 index d73b7c0ed160..000000000000 --- a/speech/google/cloud/speech_v1/proto/cloud_speech_pb2.py +++ /dev/null @@ -1,2640 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech_v1/proto/cloud_speech.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/speech_v1/proto/cloud_speech.proto", - package="google.cloud.speech.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.speech.v1B\013SpeechProtoP\001Z\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02"\x9b\x01\n\x1bLongRunningRecognizeRequest\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12<\n\x05\x61udio\x18\x02 \x01(\x0b\x32(.google.cloud.speech.v1.RecognitionAudioB\x03\xe0\x41\x02"\x99\x01\n\x19StreamingRecognizeRequest\x12N\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request"\x8f\x01\n\x1aStreamingRecognitionConfig\x12>\n\x06\x63onfig\x18\x01 \x01(\x0b\x32).google.cloud.speech.v1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08"\xdf\x05\n\x11RecognitionConfig\x12I\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32\x37.google.cloud.speech.v1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12>\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32%.google.cloud.speech.v1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12L\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x30.google.cloud.speech.v1.SpeakerDiarizationConfig\x12=\n\x08metadata\x18\t \x01(\x0b\x32+.google.cloud.speech.v1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08"\x8b\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07"\x90\x01\n\x18SpeakerDiarizationConfig\x12"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05\x12\x1a\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x05\x18\x01\xe0\x41\x03"\xa0\x08\n\x13RecognitionMetadata\x12U\n\x10interaction_type\x18\x01 \x01(\x0e\x32;.google.cloud.speech.v1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12[\n\x13microphone_distance\x18\x04 \x01(\x0e\x32>.google.cloud.speech.v1.RecognitionMetadata.MicrophoneDistance\x12Z\n\x13original_media_type\x18\x05 \x01(\x0e\x32=.google.cloud.speech.v1.RecognitionMetadata.OriginalMediaType\x12^\n\x15recording_device_type\x18\x06 \x01(\x0e\x32?.google.cloud.speech.v1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06" \n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source"U\n\x11RecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult"`\n\x1cLongRunningRecognizeResponse\x12@\n\x07results\x18\x02 \x03(\x0b\x32/.google.cloud.speech.v1.SpeechRecognitionResult"\x9e\x01\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xb1\x02\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x43\n\x07results\x18\x02 \x03(\x0b\x32\x32.google.cloud.speech.v1.StreamingRecognitionResult\x12]\n\x11speech_event_type\x18\x04 \x01(\x0e\x32\x42.google.cloud.speech.v1.StreamingRecognizeResponse.SpeechEventType"L\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01"\xf2\x01\n\x1aStreamingRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x1a\n\rlanguage_code\x18\x06 \x01(\tB\x03\xe0\x41\x03"z\n\x17SpeechRecognitionResult\x12J\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x34.google.cloud.speech.v1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05"w\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12/\n\x05words\x18\x03 \x03(\x0b\x32 .google.cloud.speech.v1.WordInfo"\x8e\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x18\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03\x32\xd1\x04\n\x06Speech\x12\x90\x01\n\tRecognize\x12(.google.cloud.speech.v1.RecognizeRequest\x1a).google.cloud.speech.v1.RecognizeResponse".\x82\xd3\xe4\x93\x02\x19"\x14/v1/speech:recognize:\x01*\xda\x41\x0c\x63onfig,audio\x12\xe4\x01\n\x14LongRunningRecognize\x12\x33.google.cloud.speech.v1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation"x\x82\xd3\xe4\x93\x02$"\x1f/v1/speech:longrunningrecognize:\x01*\xda\x41\x0c\x63onfig,audio\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\x12\x81\x01\n\x12StreamingRecognize\x12\x31.google.cloud.speech.v1.StreamingRecognizeRequest\x1a\x32.google.cloud.speech.v1.StreamingRecognizeResponse"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBr\n\x1a\x63om.google.cloud.speech.v1B\x0bSpeechProtoP\x01Z`__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeRequest) - ), -) -_sym_db.RegisterMessage(StreamingRecognizeRequest) - -StreamingRecognitionConfig = _reflection.GeneratedProtocolMessageType( - "StreamingRecognitionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNITIONCONFIG, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Provides information to the recognizer that specifies how - to process the request. - - - Attributes: - config: - Required. Provides information to the recognizer that - specifies how to process the request. - single_utterance: - If ``false`` or omitted, the recognizer will perform - continuous recognition (continuing to wait for and process - audio even if the user pauses speaking) until the client - closes the input stream (gRPC API) or until the maximum time - limit has been reached. May return multiple - ``StreamingRecognitionResult``\ s with the ``is_final`` flag - set to ``true``. If ``true``, the recognizer will detect a - single spoken utterance. When it detects that the user has - paused or stopped speaking, it will return an - ``END_OF_SINGLE_UTTERANCE`` event and cease recognition. It - will return no more than one ``StreamingRecognitionResult`` - with the ``is_final`` flag set to ``true``. - interim_results: - If ``true``, interim results (tentative hypotheses) may be - returned as they become available (these interim results are - indicated with the ``is_final=false`` flag). If ``false`` or - omitted, only ``is_final=true`` result(s) are returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionConfig) - ), -) -_sym_db.RegisterMessage(StreamingRecognitionConfig) - -RecognitionConfig = _reflection.GeneratedProtocolMessageType( - "RecognitionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONCONFIG, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Provides information to the recognizer that specifies how - to process the request. - - - Attributes: - encoding: - Encoding of audio data sent in all ``RecognitionAudio`` - messages. This field is optional for ``FLAC`` and ``WAV`` - audio files and required for all other audio formats. For - details, see [AudioEncoding][google.cloud.speech.v1.Recognitio - nConfig.AudioEncoding]. - sample_rate_hertz: - Sample rate in Hertz of the audio data sent in all - ``RecognitionAudio`` messages. Valid values are: 8000-48000. - 16000 is optimal. For best results, set the sampling rate of - the audio source to 16000 Hz. If that's not possible, use the - native sample rate of the audio source (instead of re- - sampling). This field is optional for FLAC and WAV audio - files, but is required for all other audio formats. For - details, see [AudioEncoding][google.cloud.speech.v1.Recognitio - nConfig.AudioEncoding]. - audio_channel_count: - The number of channels in the input audio data. ONLY set this - for MULTI-CHANNEL recognition. Valid values for LINEAR16 and - FLAC are ``1``-``8``. Valid values for OGG\_OPUS are - '1'-'254'. Valid value for MULAW, AMR, AMR\_WB and - SPEEX\_WITH\_HEADER\_BYTE is only ``1``. If ``0`` or omitted, - defaults to one channel (mono). Note: We only recognize the - first channel by default. To perform independent recognition - on each channel set - ``enable_separate_recognition_per_channel`` to 'true'. - enable_separate_recognition_per_channel: - This needs to be set to ``true`` explicitly and - ``audio_channel_count`` > 1 to get each channel recognized - separately. The recognition result will contain a - ``channel_tag`` field to state which channel that result - belongs to. If this is not true, we will only recognize the - first channel. The request is billed cumulatively for all - channels recognized: ``audio_channel_count`` multiplied by the - length of the audio. - language_code: - Required. The language of the supplied audio as a `BCP-47 - `__ language - tag. Example: "en-US". See `Language Support - `__ - for a list of the currently supported language codes. - max_alternatives: - Maximum number of recognition hypotheses to be returned. - Specifically, the maximum number of - ``SpeechRecognitionAlternative`` messages within each - ``SpeechRecognitionResult``. The server may return fewer than - ``max_alternatives``. Valid values are ``0``-``30``. A value - of ``0`` or ``1`` will return a maximum of one. If omitted, - will return a maximum of one. - profanity_filter: - If set to ``true``, the server will attempt to filter out - profanities, replacing all but the initial character in each - filtered word with asterisks, e.g. "f\*\*\*". If set to - ``false`` or omitted, profanities won't be filtered out. - speech_contexts: - Array of - [SpeechContext][google.cloud.speech.v1.SpeechContext]. A means - to provide context to assist the speech recognition. For more - information, see `speech adaptation - `__. - enable_word_time_offsets: - If ``true``, the top result includes a list of words and the - start and end time offsets (timestamps) for those words. If - ``false``, no word-level time offset information is returned. - The default is ``false``. - enable_automatic_punctuation: - If 'true', adds punctuation to recognition result hypotheses. - This feature is only available in select languages. Setting - this for requests in other languages has no effect at all. The - default 'false' value does not add punctuation to result - hypotheses. Note: This is currently offered as an experimental - service, complimentary to all users. In the future this may be - exclusively available as a premium feature. - diarization_config: - Config to enable speaker diarization and set additional - parameters to make diarization better suited for your - application. Note: When this is enabled, we send all the words - from the beginning of the audio for the top alternative in - every consecutive STREAMING responses. This is done in order - to improve our speaker tags as our models learn to identify - the speakers in the conversation over time. For non-streaming - requests, the diarization results will be provided only in the - top alternative of the FINAL SpeechRecognitionResult. - metadata: - Metadata regarding this request. - model: - Which model to select for the given request. Select the model - best suited to your domain to get best results. If a model is - not explicitly specified, then we auto-select a model based on - the parameters in the RecognitionConfig. .. raw:: html - .. raw:: html :: - .. raw:: html .. raw:: - html :: - .. - raw:: html .. raw:: html :: - .. raw:: html .. raw:: - html :: - .. - raw:: html .. raw:: html :: - .. raw:: - html .. raw:: html
ModelDescription
command_and_search Best for - short queries such as voice commands or voice search.
phone_call Best for audio that - originated from a phone call (typically recorded at an - 8khz sampling rate).
videoBest for audio that originated from from video or includes - multiple speakers. Ideally the audio is recorded at a - 16khz or greater sampling rate. This is a premium - model that costs more than the standard rate.
default Best for audio that is - not one of the specific audio models. For example, - long-form audio. Ideally the audio is high-fidelity, - recorded at a 16khz or greater sampling rate.
- use_enhanced: - Set to true to use an enhanced model for speech recognition. - If ``use_enhanced`` is set to true and the ``model`` field is - not set, then an appropriate enhanced model is chosen if an - enhanced model exists for the audio. If ``use_enhanced`` is - true and an enhanced version of the specified model does not - exist, then the speech is recognized using the standard - version of the specified model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionConfig) - ), -) -_sym_db.RegisterMessage(RecognitionConfig) - -SpeakerDiarizationConfig = _reflection.GeneratedProtocolMessageType( - "SpeakerDiarizationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SPEAKERDIARIZATIONCONFIG, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Config to enable speaker diarization. - - - Attributes: - enable_speaker_diarization: - If 'true', enables speaker detection for each recognized word - in the top alternative of the recognition result using a - speaker\_tag provided in the WordInfo. - min_speaker_count: - Minimum number of speakers in the conversation. This range - gives you more flexibility by allowing the system to - automatically determine the correct number of speakers. If not - set, the default value is 2. - max_speaker_count: - Maximum number of speakers in the conversation. This range - gives you more flexibility by allowing the system to - automatically determine the correct number of speakers. If not - set, the default value is 6. - speaker_tag: - Unused. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeakerDiarizationConfig) - ), -) -_sym_db.RegisterMessage(SpeakerDiarizationConfig) - -RecognitionMetadata = _reflection.GeneratedProtocolMessageType( - "RecognitionMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONMETADATA, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Description of audio data to be recognized. - - - Attributes: - interaction_type: - The use case most closely describing the audio content to be - recognized. - industry_naics_code_of_audio: - The industry vertical to which this speech recognition request - most closely applies. This is most indicative of the topics - contained in the audio. Use the 6-digit NAICS code to identify - the industry vertical - see https://www.naics.com/search/. - microphone_distance: - The audio type that most closely describes the audio being - recognized. - original_media_type: - The original media the speech was recorded on. - recording_device_type: - The type of device the speech was recorded with. - recording_device_name: - The device used to make the recording. Examples 'Nexus 5X' or - 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - 'Cardioid Microphone'. - original_mime_type: - Mime type of the original audio file. For example - ``audio/m4a``, ``audio/x-alaw-basic``, ``audio/mp3``, - ``audio/3gpp``. A list of possible audio mime types is - maintained at http://www.iana.org/assignments/media- - types/media-types.xhtml#audio - audio_topic: - Description of the content. Eg. "Recordings of federal supreme - court hearings from 2012". - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionMetadata) - ), -) -_sym_db.RegisterMessage(RecognitionMetadata) - -SpeechContext = _reflection.GeneratedProtocolMessageType( - "SpeechContext", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHCONTEXT, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Provides "hints" to the speech recognizer to favor - specific words and phrases in the results. - - - Attributes: - phrases: - A list of strings containing words and phrases "hints" so that - the speech recognition is more likely to recognize them. This - can be used to improve the accuracy for specific words and - phrases, for example, if specific commands are typically - spoken by the user. This can also be used to add additional - words to the vocabulary of the recognizer. See `usage limits - `__. - List items can also be set to classes for groups of words that - represent common concepts that occur in natural language. For - example, rather than providing phrase hints for every month of - the year, using the $MONTH class improves the likelihood of - correctly transcribing audio that includes months. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechContext) - ), -) -_sym_db.RegisterMessage(SpeechContext) - -RecognitionAudio = _reflection.GeneratedProtocolMessageType( - "RecognitionAudio", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONAUDIO, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Contains audio data in the encoding specified in the - ``RecognitionConfig``. Either ``content`` or ``uri`` must be supplied. - Supplying both or neither returns - [google.rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT]. - See `content - limits `__. - - - Attributes: - audio_source: - The audio source, which is either inline content or a Google - Cloud Storage uri. - content: - The audio data bytes encoded as specified in - ``RecognitionConfig``. Note: as with all bytes fields, proto - buffers use a pure binary representation, whereas JSON - representations use base64. - uri: - URI that points to a file that contains audio data bytes as - specified in ``RecognitionConfig``. The file must not be - compressed (for example, gzip). Currently, only Google Cloud - Storage URIs are supported, which must be specified in the - following format: ``gs://bucket_name/object_name`` (other URI - formats return [google.rpc.Code.INVALID\_ARGUMENT][google.rpc. - Code.INVALID\_ARGUMENT]). For more information, see `Request - URIs `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognitionAudio) - ), -) -_sym_db.RegisterMessage(RecognitionAudio) - -RecognizeResponse = _reflection.GeneratedProtocolMessageType( - "RecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNIZERESPONSE, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""The only message returned to the client by the - ``Recognize`` method. It contains the result as zero or more sequential - ``SpeechRecognitionResult`` messages. - - - Attributes: - results: - Sequential list of transcription results corresponding to - sequential portions of audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.RecognizeResponse) - ), -) -_sym_db.RegisterMessage(RecognizeResponse) - -LongRunningRecognizeResponse = _reflection.GeneratedProtocolMessageType( - "LongRunningRecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LONGRUNNINGRECOGNIZERESPONSE, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""The only message returned to the client by the - ``LongRunningRecognize`` method. It contains the result as zero or more - sequential ``SpeechRecognitionResult`` messages. It is included in the - ``result.response`` field of the ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` - service. - - - Attributes: - results: - Sequential list of transcription results corresponding to - sequential portions of audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeResponse) - ), -) -_sym_db.RegisterMessage(LongRunningRecognizeResponse) - -LongRunningRecognizeMetadata = _reflection.GeneratedProtocolMessageType( - "LongRunningRecognizeMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LONGRUNNINGRECOGNIZEMETADATA, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Describes the progress of a long-running - ``LongRunningRecognize`` call. It is included in the ``metadata`` field - of the ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - progress_percent: - Approximate percentage of audio processed thus far. Guaranteed - to be 100 when the audio is fully processed and the results - are available. - start_time: - Time when the request was received. - last_update_time: - Time of the most recent processing update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.LongRunningRecognizeMetadata) - ), -) -_sym_db.RegisterMessage(LongRunningRecognizeMetadata) - -StreamingRecognizeResponse = _reflection.GeneratedProtocolMessageType( - "StreamingRecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNIZERESPONSE, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""\ ``StreamingRecognizeResponse`` is the only message - returned to the client by ``StreamingRecognize``. A series of zero or - more ``StreamingRecognizeResponse`` messages are streamed back to the - client. If there is no recognizable audio, and ``single_utterance`` is - set to false, then no messages are streamed back to the client. - - Here's an example of a series of ten ``StreamingRecognizeResponse``\ s - that might be returned while processing audio: - - 1. results { alternatives { transcript: "tube" } stability: 0.01 } - - 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - - 3. results { alternatives { transcript: "to be" } stability: 0.9 } - results { alternatives { transcript: " or not to be" } stability: - 0.01 } - - 4. results { alternatives { transcript: "to be or not to be" confidence: - 0.92 } alternatives { transcript: "to bee or not to bee" } is\_final: - true } - - 5. results { alternatives { transcript: " that's" } stability: 0.01 } - - 6. results { alternatives { transcript: " that is" } stability: 0.9 } - results { alternatives { transcript: " the question" } stability: - 0.01 } - - 7. results { alternatives { transcript: " that is the question" - confidence: 0.98 } alternatives { transcript: " that was the - question" } is\_final: true } - - Notes: - - - Only two of the above responses #4 and #7 contain final results; they - are indicated by ``is_final: true``. Concatenating these together - generates the full transcript: "to be or not to be that is the - question". - - - The others contain interim ``results``. #3 and #6 contain two interim - ``results``: the first portion has a high stability and is less - likely to change; the second portion has a low stability and is very - likely to change. A UI designer might choose to show only high - stability ``results``. - - - The specific ``stability`` and ``confidence`` values shown above are - only for illustrative purposes. Actual values may vary. - - - In each response, only one of these fields will be set: ``error``, - ``speech_event_type``, or one or more (repeated) ``results``. - - - Attributes: - error: - If set, returns a [google.rpc.Status][google.rpc.Status] - message that specifies the error for the operation. - results: - This repeated list contains zero or more results that - correspond to consecutive portions of the audio currently - being processed. It contains zero or one ``is_final=true`` - result (the newly settled portion), followed by zero or more - ``is_final=false`` results (the interim results). - speech_event_type: - Indicates the type of speech event. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognizeResponse) - ), -) -_sym_db.RegisterMessage(StreamingRecognizeResponse) - -StreamingRecognitionResult = _reflection.GeneratedProtocolMessageType( - "StreamingRecognitionResult", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNITIONRESULT, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""A streaming speech recognition result corresponding to a - portion of the audio that is currently being processed. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - is_final: - If ``false``, this ``StreamingRecognitionResult`` represents - an interim result that may change. If ``true``, this is the - final time the speech service will return this particular - ``StreamingRecognitionResult``, the recognizer will not return - any further hypotheses for this portion of the transcript and - corresponding audio. - stability: - An estimate of the likelihood that the recognizer will not - change its guess about this interim result. Values range from - 0.0 (completely unstable) to 1.0 (completely stable). This - field is only provided for interim results - (``is_final=false``). The default of 0.0 is a sentinel value - indicating ``stability`` was not set. - result_end_time: - Time offset of the end of this result relative to the - beginning of the audio. - channel_tag: - For multi-channel audio, this is the channel number - corresponding to the recognized result for the audio from that - channel. For audio\_channel\_count = N, its output values can - range from '1' to 'N'. - language_code: - The `BCP-47 `__ - language tag of the language in this result. This language - code was detected to have the most likelihood of being spoken - in the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.StreamingRecognitionResult) - ), -) -_sym_db.RegisterMessage(StreamingRecognitionResult) - -SpeechRecognitionResult = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionResult", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONRESULT, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""A speech recognition result corresponding to a portion of - the audio. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - channel_tag: - For multi-channel audio, this is the channel number - corresponding to the recognized result for the audio from that - channel. For audio\_channel\_count = N, its output values can - range from '1' to 'N'. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionResult) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionResult) - -SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionAlternative", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONALTERNATIVE, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Alternative hypotheses (a.k.a. n-best list). - - - Attributes: - transcript: - Transcript text representing the words that the user spoke. - confidence: - The confidence estimate between 0.0 and 1.0. A higher number - indicates an estimated greater likelihood that the recognized - words are correct. This field is set only for the top - alternative of a non-streaming result or, of a streaming - result where ``is_final=true``. This field is not guaranteed - to be accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - words: - A list of word-specific information for each recognized word. - Note: When ``enable_speaker_diarization`` is true, you will - see all the words from the beginning of the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.SpeechRecognitionAlternative) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionAlternative) - -WordInfo = _reflection.GeneratedProtocolMessageType( - "WordInfo", - (_message.Message,), - dict( - DESCRIPTOR=_WORDINFO, - __module__="google.cloud.speech_v1.proto.cloud_speech_pb2", - __doc__="""Word-specific information for recognized words. - - - Attributes: - start_time: - Time offset relative to the beginning of the audio, and - corresponding to the start of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - end_time: - Time offset relative to the beginning of the audio, and - corresponding to the end of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - word: - The word corresponding to this set of information. - speaker_tag: - A distinct integer value is assigned for every speaker within - the audio. This field specifies which one of those speakers - was detected to have spoken this word. Value ranges from '1' - to diarization\_speaker\_count. speaker\_tag is set if - enable\_speaker\_diarization = 'true' and only in the top - alternative. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1.WordInfo) - ), -) -_sym_db.RegisterMessage(WordInfo) - - -DESCRIPTOR._options = None -_RECOGNIZEREQUEST.fields_by_name["config"]._options = None -_RECOGNIZEREQUEST.fields_by_name["audio"]._options = None -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["config"]._options = None -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["audio"]._options = None -_STREAMINGRECOGNITIONCONFIG.fields_by_name["config"]._options = None -_RECOGNITIONCONFIG.fields_by_name["language_code"]._options = None -_SPEAKERDIARIZATIONCONFIG.fields_by_name["speaker_tag"]._options = None -_STREAMINGRECOGNITIONRESULT.fields_by_name["language_code"]._options = None -_WORDINFO.fields_by_name["speaker_tag"]._options = None - -_SPEECH = _descriptor.ServiceDescriptor( - name="Speech", - full_name="google.cloud.speech.v1.Speech", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025speech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=4262, - serialized_end=4855, - methods=[ - _descriptor.MethodDescriptor( - name="Recognize", - full_name="google.cloud.speech.v1.Speech.Recognize", - index=0, - containing_service=None, - input_type=_RECOGNIZEREQUEST, - output_type=_RECOGNIZERESPONSE, - serialized_options=_b( - '\202\323\344\223\002\031"\024/v1/speech:recognize:\001*\332A\014config,audio' - ), - ), - _descriptor.MethodDescriptor( - name="LongRunningRecognize", - full_name="google.cloud.speech.v1.Speech.LongRunningRecognize", - index=1, - containing_service=None, - input_type=_LONGRUNNINGRECOGNIZEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002$"\037/v1/speech:longrunningrecognize:\001*\332A\014config,audio\312A<\n\034LongRunningRecognizeResponse\022\034LongRunningRecognizeMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="StreamingRecognize", - full_name="google.cloud.speech.v1.Speech.StreamingRecognize", - index=2, - containing_service=None, - input_type=_STREAMINGRECOGNIZEREQUEST, - output_type=_STREAMINGRECOGNIZERESPONSE, - serialized_options=None, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_SPEECH) - -DESCRIPTOR.services_by_name["Speech"] = _SPEECH - -# @@protoc_insertion_point(module_scope) diff --git a/speech/google/cloud/speech_v1/proto/cloud_speech_pb2_grpc.py b/speech/google/cloud/speech_v1/proto/cloud_speech_pb2_grpc.py deleted file mode 100644 index a7ddcb9c8865..000000000000 --- a/speech/google/cloud/speech_v1/proto/cloud_speech_pb2_grpc.py +++ /dev/null @@ -1,93 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.speech_v1.proto import ( - cloud_speech_pb2 as google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class SpeechStub(object): - """Service that implements Google Cloud Speech API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Recognize = channel.unary_unary( - "/google.cloud.speech.v1.Speech/Recognize", - request_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.FromString, - ) - self.LongRunningRecognize = channel.unary_unary( - "/google.cloud.speech.v1.Speech/LongRunningRecognize", - request_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.StreamingRecognize = channel.stream_stream( - "/google.cloud.speech.v1.Speech/StreamingRecognize", - request_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.FromString, - ) - - -class SpeechServicer(object): - """Service that implements Google Cloud Speech API. - """ - - def Recognize(self, request, context): - """Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LongRunningRecognize(self, request, context): - """Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - `Operation.error` or an `Operation.response` which contains - a `LongRunningRecognizeResponse` message. - For more information on asynchronous speech recognition, see the - [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StreamingRecognize(self, request_iterator, context): - """Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_SpeechServicer_to_server(servicer, server): - rpc_method_handlers = { - "Recognize": grpc.unary_unary_rpc_method_handler( - servicer.Recognize, - request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.FromString, - response_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.SerializeToString, - ), - "LongRunningRecognize": grpc.unary_unary_rpc_method_handler( - servicer.LongRunningRecognize, - request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "StreamingRecognize": grpc.stream_stream_rpc_method_handler( - servicer.StreamingRecognize, - request_deserializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.FromString, - response_serializer=google_dot_cloud_dot_speech__v1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.speech.v1.Speech", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/speech/google/cloud/speech_v1/types.py b/speech/google/cloud/speech_v1/types.py deleted file mode 100644 index f2bd717a7a06..000000000000 --- a/speech/google/cloud/speech_v1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.speech_v1.proto import cloud_speech_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [cloud_speech_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.speech_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/speech/google/cloud/speech_v1p1beta1/__init__.py b/speech/google/cloud/speech_v1p1beta1/__init__.py deleted file mode 100644 index b68a395372f9..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 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. - -from __future__ import absolute_import - -from google.cloud.speech_v1p1beta1 import types -from google.cloud.speech_v1p1beta1.gapic import enums -from google.cloud.speech_v1p1beta1.gapic import speech_client - -from google.cloud.speech_v1.helpers import SpeechHelpers - - -class SpeechClient(SpeechHelpers, speech_client.SpeechClient): - __doc__ = speech_client.SpeechClient.__doc__ - enums = enums - types = types - - -__all__ = ("enums", "types", "SpeechClient") diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/__init__.py b/speech/google/cloud/speech_v1p1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/enums.py b/speech/google/cloud/speech_v1p1beta1/gapic/enums.py deleted file mode 100644 index 3616356fa51d..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/gapic/enums.py +++ /dev/null @@ -1,200 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class RecognitionConfig(object): - class AudioEncoding(enum.IntEnum): - """ - The encoding of the audio data sent in the request. - - All encodings support only 1 channel (mono) audio, unless the - ``audio_channel_count`` and ``enable_separate_recognition_per_channel`` - fields are set. - - For best results, the audio source should be captured and transmitted - using a lossless encoding (``FLAC`` or ``LINEAR16``). The accuracy of - the speech recognition can be reduced if lossy codecs are used to - capture or transmit audio, particularly if background noise is present. - Lossy codecs include ``MULAW``, ``AMR``, ``AMR_WB``, ``OGG_OPUS``, - ``SPEEX_WITH_HEADER_BYTE``, and ``MP3``. - - The ``FLAC`` and ``WAV`` audio file formats include a header that - describes the included audio content. You can request recognition for - ``WAV`` files that contain either ``LINEAR16`` or ``MULAW`` encoded - audio. If you send ``FLAC`` or ``WAV`` audio file format in your - request, you do not need to specify an ``AudioEncoding``; the audio - encoding format is determined from the file header. If you specify an - ``AudioEncoding`` when you send send ``FLAC`` or ``WAV`` audio, the - encoding configuration must match the encoding described in the audio - header; otherwise the request returns an - ``google.rpc.Code.INVALID_ARGUMENT`` error code. - - Attributes: - ENCODING_UNSPECIFIED (int): Not specified. - LINEAR16 (int): Uncompressed 16-bit signed little-endian samples (Linear PCM). - FLAC (int): ``FLAC`` (Free Lossless Audio Codec) is the recommended encoding because - it is lossless--therefore recognition is not compromised--and requires - only about half the bandwidth of ``LINEAR16``. ``FLAC`` stream encoding - supports 16-bit and 24-bit samples, however, not all fields in - ``STREAMINFO`` are supported. - MULAW (int): 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - AMR (int): Adaptive Multi-Rate Narrowband codec. ``sample_rate_hertz`` must be - 8000. - AMR_WB (int): Adaptive Multi-Rate Wideband codec. ``sample_rate_hertz`` must be 16000. - OGG_OPUS (int): Opus encoded audio frames in Ogg container - (`OggOpus `__). ``sample_rate_hertz`` - must be one of 8000, 12000, 16000, 24000, or 48000. - SPEEX_WITH_HEADER_BYTE (int): Although the use of lossy encodings is not recommended, if a very low - bitrate encoding is required, ``OGG_OPUS`` is highly preferred over - Speex encoding. The `Speex `__ encoding supported by - Cloud Speech API has a header byte in each block, as in MIME type - ``audio/x-speex-with-header-byte``. It is a variant of the RTP Speex - encoding defined in `RFC 5574 `__. - The stream is a sequence of blocks, one block per RTP packet. Each block - starts with a byte containing the length of the block, in bytes, - followed by one or more frames of Speex data, padded to an integral - number of bytes (octets) as specified in RFC 5574. In other words, each - RTP header is replaced with a single byte containing the block length. - Only Speex wideband is supported. ``sample_rate_hertz`` must be 16000. - MP3 (int): MP3 audio. Support all standard MP3 bitrates (which range from 32-320 - kbps). When using this encoding, ``sample_rate_hertz`` can be optionally - unset if not known. - """ - - ENCODING_UNSPECIFIED = 0 - LINEAR16 = 1 - FLAC = 2 - MULAW = 3 - AMR = 4 - AMR_WB = 5 - OGG_OPUS = 6 - SPEEX_WITH_HEADER_BYTE = 7 - MP3 = 8 - - -class RecognitionMetadata(object): - class InteractionType(enum.IntEnum): - """ - Use case categories that the audio recognition request can be described - by. - - Attributes: - INTERACTION_TYPE_UNSPECIFIED (int): Use case is either unknown or is something other than one of the other - values below. - DISCUSSION (int): Multiple people in a conversation or discussion. For example in a - meeting with two or more people actively participating. Typically all - the primary people speaking would be in the same room (if not, see - PHONE\_CALL) - PRESENTATION (int): One or more persons lecturing or presenting to others, mostly - uninterrupted. - PHONE_CALL (int): A phone-call or video-conference in which two or more people, who are - not in the same room, are actively participating. - VOICEMAIL (int): A recorded message intended for another person to listen to. - PROFESSIONALLY_PRODUCED (int): Professionally produced audio (eg. TV Show, Podcast). - VOICE_SEARCH (int): Transcribe spoken questions and queries into text. - VOICE_COMMAND (int): Transcribe voice commands, such as for controlling a device. - DICTATION (int): Transcribe speech to text to create a written document, such as a - text-message, email or report. - """ - - INTERACTION_TYPE_UNSPECIFIED = 0 - DISCUSSION = 1 - PRESENTATION = 2 - PHONE_CALL = 3 - VOICEMAIL = 4 - PROFESSIONALLY_PRODUCED = 5 - VOICE_SEARCH = 6 - VOICE_COMMAND = 7 - DICTATION = 8 - - class MicrophoneDistance(enum.IntEnum): - """ - Enumerates the types of capture settings describing an audio file. - - Attributes: - MICROPHONE_DISTANCE_UNSPECIFIED (int): Audio type is not known. - NEARFIELD (int): The audio was captured from a closely placed microphone. Eg. phone, - dictaphone, or handheld microphone. Generally if there speaker is within - 1 meter of the microphone. - MIDFIELD (int): The speaker if within 3 meters of the microphone. - FARFIELD (int): The speaker is more than 3 meters away from the microphone. - """ - - MICROPHONE_DISTANCE_UNSPECIFIED = 0 - NEARFIELD = 1 - MIDFIELD = 2 - FARFIELD = 3 - - class OriginalMediaType(enum.IntEnum): - """ - The original media the speech was recorded on. - - Attributes: - ORIGINAL_MEDIA_TYPE_UNSPECIFIED (int): Unknown original media type. - AUDIO (int): The speech data is an audio recording. - VIDEO (int): The speech data originally recorded on a video. - """ - - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0 - AUDIO = 1 - VIDEO = 2 - - class RecordingDeviceType(enum.IntEnum): - """ - The type of device the speech was recorded with. - - Attributes: - RECORDING_DEVICE_TYPE_UNSPECIFIED (int): The recording device is unknown. - SMARTPHONE (int): Speech was recorded on a smartphone. - PC (int): Speech was recorded using a personal computer or tablet. - PHONE_LINE (int): Speech was recorded over a phone line. - VEHICLE (int): Speech was recorded in a vehicle. - OTHER_OUTDOOR_DEVICE (int): Speech was recorded outdoors. - OTHER_INDOOR_DEVICE (int): Speech was recorded indoors. - """ - - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0 - SMARTPHONE = 1 - PC = 2 - PHONE_LINE = 3 - VEHICLE = 4 - OTHER_OUTDOOR_DEVICE = 5 - OTHER_INDOOR_DEVICE = 6 - - -class StreamingRecognizeResponse(object): - class SpeechEventType(enum.IntEnum): - """ - Indicates the type of speech event. - - Attributes: - SPEECH_EVENT_UNSPECIFIED (int): No speech event specified. - END_OF_SINGLE_UTTERANCE (int): This event indicates that the server has detected the end of the user's - speech utterance and expects no additional speech. Therefore, the server - will not process additional audio (although it may subsequently return - additional results). The client should stop sending additional audio - data, half-close the gRPC connection, and wait for any additional - results until the server closes the gRPC connection. This event is only - sent if ``single_utterance`` was set to ``true``, and is not used - otherwise. - """ - - SPEECH_EVENT_UNSPECIFIED = 0 - END_OF_SINGLE_UTTERANCE = 1 diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py b/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py deleted file mode 100644 index 5703df5b84a0..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/gapic/speech_client.py +++ /dev/null @@ -1,412 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.speech.v1p1beta1 Speech API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.speech_v1p1beta1.gapic import enums -from google.cloud.speech_v1p1beta1.gapic import speech_client_config -from google.cloud.speech_v1p1beta1.gapic.transports import speech_grpc_transport -from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2 -from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-speech").version - - -class SpeechClient(object): - """Service that implements Google Cloud Speech API.""" - - SERVICE_ADDRESS = "speech.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.speech.v1p1beta1.Speech" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - SpeechClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.SpeechGrpcTransport, - Callable[[~.Credentials, type], ~.SpeechGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = speech_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=speech_grpc_transport.SpeechGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = speech_grpc_transport.SpeechGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def recognize( - self, - config, - audio, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - - Example: - >>> from google.cloud import speech_v1p1beta1 - >>> from google.cloud.speech_v1p1beta1 import enums - >>> - >>> client = speech_v1p1beta1.SpeechClient() - >>> - >>> encoding = enums.RecognitionConfig.AudioEncoding.FLAC - >>> sample_rate_hertz = 44100 - >>> language_code = 'en-US' - >>> config = {'encoding': encoding, 'sample_rate_hertz': sample_rate_hertz, 'language_code': language_code} - >>> uri = 'gs://bucket_name/file_name.flac' - >>> audio = {'uri': uri} - >>> - >>> response = client.recognize(config, audio) - - Args: - config (Union[dict, ~google.cloud.speech_v1p1beta1.types.RecognitionConfig]): Required. Provides information to the recognizer that specifies how to - process the request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionConfig` - audio (Union[dict, ~google.cloud.speech_v1p1beta1.types.RecognitionAudio]): Required. The audio data to be recognized. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionAudio` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.speech_v1p1beta1.types.RecognizeResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.recognize, - default_retry=self._method_configs["Recognize"].retry, - default_timeout=self._method_configs["Recognize"].timeout, - client_info=self._client_info, - ) - - request = cloud_speech_pb2.RecognizeRequest(config=config, audio=audio) - return self._inner_api_calls["recognize"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def long_running_recognize( - self, - config, - audio, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - ``Operation.error`` or an ``Operation.response`` which contains a - ``LongRunningRecognizeResponse`` message. For more information on - asynchronous speech recognition, see the - `how-to `__. - - Example: - >>> from google.cloud import speech_v1p1beta1 - >>> from google.cloud.speech_v1p1beta1 import enums - >>> - >>> client = speech_v1p1beta1.SpeechClient() - >>> - >>> encoding = enums.RecognitionConfig.AudioEncoding.FLAC - >>> sample_rate_hertz = 44100 - >>> language_code = 'en-US' - >>> config = {'encoding': encoding, 'sample_rate_hertz': sample_rate_hertz, 'language_code': language_code} - >>> uri = 'gs://bucket_name/file_name.flac' - >>> audio = {'uri': uri} - >>> - >>> response = client.long_running_recognize(config, audio) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - config (Union[dict, ~google.cloud.speech_v1p1beta1.types.RecognitionConfig]): Required. Provides information to the recognizer that specifies how to - process the request. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionConfig` - audio (Union[dict, ~google.cloud.speech_v1p1beta1.types.RecognitionAudio]): Required. The audio data to be recognized. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.speech_v1p1beta1.types.RecognitionAudio` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.speech_v1p1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "long_running_recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "long_running_recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.long_running_recognize, - default_retry=self._method_configs["LongRunningRecognize"].retry, - default_timeout=self._method_configs["LongRunningRecognize"].timeout, - client_info=self._client_info, - ) - - request = cloud_speech_pb2.LongRunningRecognizeRequest( - config=config, audio=audio - ) - operation = self._inner_api_calls["long_running_recognize"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - cloud_speech_pb2.LongRunningRecognizeResponse, - metadata_type=cloud_speech_pb2.LongRunningRecognizeMetadata, - ) - - def streaming_recognize( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - - EXPERIMENTAL: This method interface might change in the future. - - Example: - >>> from google.cloud import speech_v1p1beta1 - >>> - >>> client = speech_v1p1beta1.SpeechClient() - >>> - >>> request = {} - >>> - >>> requests = [request] - >>> for element in client.streaming_recognize(requests): - ... # process element - ... pass - - Args: - requests (iterator[dict|google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2.StreamingRecognizeRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.speech_v1p1beta1.types.StreamingRecognizeRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - Iterable[~google.cloud.speech_v1p1beta1.types.StreamingRecognizeResponse]. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "streaming_recognize" not in self._inner_api_calls: - self._inner_api_calls[ - "streaming_recognize" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.streaming_recognize, - default_retry=self._method_configs["StreamingRecognize"].retry, - default_timeout=self._method_configs["StreamingRecognize"].timeout, - client_info=self._client_info, - ) - - return self._inner_api_calls["streaming_recognize"]( - requests, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/speech_client_config.py b/speech/google/cloud/speech_v1p1beta1/gapic/speech_client_config.py deleted file mode 100644 index c405dd03f430..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/gapic/speech_client_config.py +++ /dev/null @@ -1,38 +0,0 @@ -config = { - "interfaces": { - "google.cloud.speech.v1p1beta1.Speech": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 1000000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 1000000, - "total_timeout_millis": 5000000, - } - }, - "methods": { - "Recognize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "LongRunningRecognize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "StreamingRecognize": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/transports/__init__.py b/speech/google/cloud/speech_v1p1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py b/speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py deleted file mode 100644 index a8e42b09157f..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2_grpc - - -class SpeechGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.speech.v1p1beta1 Speech API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, channel=None, credentials=None, address="speech.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"speech_stub": cloud_speech_pb2_grpc.SpeechStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="speech.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.recognize`. - - Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].Recognize - - @property - def long_running_recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.long_running_recognize`. - - Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - ``Operation.error`` or an ``Operation.response`` which contains a - ``LongRunningRecognizeResponse`` message. For more information on - asynchronous speech recognition, see the - `how-to `__. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].LongRunningRecognize - - @property - def streaming_recognize(self): - """Return the gRPC stub for :meth:`SpeechClient.streaming_recognize`. - - Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["speech_stub"].StreamingRecognize diff --git a/speech/google/cloud/speech_v1p1beta1/proto/__init__.py b/speech/google/cloud/speech_v1p1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech.proto b/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech.proto deleted file mode 100644 index 7718b0eb3cf2..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech.proto +++ /dev/null @@ -1,816 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.speech.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech"; -option java_multiple_files = true; -option java_outer_classname = "SpeechProto"; -option java_package = "com.google.cloud.speech.v1p1beta1"; -option objc_class_prefix = "GCS"; - -// Service that implements Google Cloud Speech API. -service Speech { - option (google.api.default_host) = "speech.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs synchronous speech recognition: receive results after all audio - // has been sent and processed. - rpc Recognize(RecognizeRequest) returns (RecognizeResponse) { - option (google.api.http) = { - post: "/v1p1beta1/speech:recognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - } - - // Performs asynchronous speech recognition: receive results via the - // google.longrunning.Operations interface. Returns either an - // `Operation.error` or an `Operation.response` which contains - // a `LongRunningRecognizeResponse` message. - // For more information on asynchronous speech recognition, see the - // [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - rpc LongRunningRecognize(LongRunningRecognizeRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p1beta1/speech:longrunningrecognize" - body: "*" - }; - option (google.api.method_signature) = "config,audio"; - option (google.longrunning.operation_info) = { - response_type: "LongRunningRecognizeResponse" - metadata_type: "LongRunningRecognizeMetadata" - }; - } - - // Performs bidirectional streaming speech recognition: receive results while - // sending audio. This method is only available via the gRPC API (not REST). - rpc StreamingRecognize(stream StreamingRecognizeRequest) returns (stream StreamingRecognizeResponse) { - } -} - -// The top-level message sent by the client for the `Recognize` method. -message RecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `LongRunningRecognize` -// method. -message LongRunningRecognizeRequest { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The audio data to be recognized. - RecognitionAudio audio = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The top-level message sent by the client for the `StreamingRecognize` method. -// Multiple `StreamingRecognizeRequest` messages are sent. The first message -// must contain a `streaming_config` message and must not contain -// `audio_content`. All subsequent messages must contain `audio_content` and -// must not contain a `streaming_config` message. -message StreamingRecognizeRequest { - // The streaming request, which is either a streaming config or audio content. - oneof streaming_request { - // Provides information to the recognizer that specifies how to process the - // request. The first `StreamingRecognizeRequest` message must contain a - // `streaming_config` message. - StreamingRecognitionConfig streaming_config = 1; - - // The audio data to be recognized. Sequential chunks of audio data are sent - // in sequential `StreamingRecognizeRequest` messages. The first - // `StreamingRecognizeRequest` message must not contain `audio_content` data - // and all subsequent `StreamingRecognizeRequest` messages must contain - // `audio_content` data. The audio bytes must be encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation (not base64). See - // [content limits](https://cloud.google.com/speech-to-text/quotas#content). - bytes audio_content = 2; - } -} - -// Provides information to the recognizer that specifies how to process the -// request. -message StreamingRecognitionConfig { - // Required. Provides information to the recognizer that specifies how to - // process the request. - RecognitionConfig config = 1 [(google.api.field_behavior) = REQUIRED]; - - // If `false` or omitted, the recognizer will perform continuous - // recognition (continuing to wait for and process audio even if the user - // pauses speaking) until the client closes the input stream (gRPC API) or - // until the maximum time limit has been reached. May return multiple - // `StreamingRecognitionResult`s with the `is_final` flag set to `true`. - // - // If `true`, the recognizer will detect a single spoken utterance. When it - // detects that the user has paused or stopped speaking, it will return an - // `END_OF_SINGLE_UTTERANCE` event and cease recognition. It will return no - // more than one `StreamingRecognitionResult` with the `is_final` flag set to - // `true`. - bool single_utterance = 2; - - // If `true`, interim results (tentative hypotheses) may be - // returned as they become available (these interim results are indicated with - // the `is_final=false` flag). - // If `false` or omitted, only `is_final=true` result(s) are returned. - bool interim_results = 3; -} - -// Provides information to the recognizer that specifies how to process the -// request. -message RecognitionConfig { - // The encoding of the audio data sent in the request. - // - // All encodings support only 1 channel (mono) audio, unless the - // `audio_channel_count` and `enable_separate_recognition_per_channel` fields - // are set. - // - // For best results, the audio source should be captured and transmitted using - // a lossless encoding (`FLAC` or `LINEAR16`). The accuracy of the speech - // recognition can be reduced if lossy codecs are used to capture or transmit - // audio, particularly if background noise is present. Lossy codecs include - // `MULAW`, `AMR`, `AMR_WB`, `OGG_OPUS`, `SPEEX_WITH_HEADER_BYTE`, and `MP3`. - // - // The `FLAC` and `WAV` audio file formats include a header that describes the - // included audio content. You can request recognition for `WAV` files that - // contain either `LINEAR16` or `MULAW` encoded audio. - // If you send `FLAC` or `WAV` audio file format in - // your request, you do not need to specify an `AudioEncoding`; the audio - // encoding format is determined from the file header. If you specify - // an `AudioEncoding` when you send send `FLAC` or `WAV` audio, the - // encoding configuration must match the encoding described in the audio - // header; otherwise the request returns an - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT] error code. - enum AudioEncoding { - // Not specified. - ENCODING_UNSPECIFIED = 0; - - // Uncompressed 16-bit signed little-endian samples (Linear PCM). - LINEAR16 = 1; - - // `FLAC` (Free Lossless Audio - // Codec) is the recommended encoding because it is - // lossless--therefore recognition is not compromised--and - // requires only about half the bandwidth of `LINEAR16`. `FLAC` stream - // encoding supports 16-bit and 24-bit samples, however, not all fields in - // `STREAMINFO` are supported. - FLAC = 2; - - // 8-bit samples that compand 14-bit audio samples using G.711 PCMU/mu-law. - MULAW = 3; - - // Adaptive Multi-Rate Narrowband codec. `sample_rate_hertz` must be 8000. - AMR = 4; - - // Adaptive Multi-Rate Wideband codec. `sample_rate_hertz` must be 16000. - AMR_WB = 5; - - // Opus encoded audio frames in Ogg container - // ([OggOpus](https://wiki.xiph.org/OggOpus)). - // `sample_rate_hertz` must be one of 8000, 12000, 16000, 24000, or 48000. - OGG_OPUS = 6; - - // Although the use of lossy encodings is not recommended, if a very low - // bitrate encoding is required, `OGG_OPUS` is highly preferred over - // Speex encoding. The [Speex](https://speex.org/) encoding supported by - // Cloud Speech API has a header byte in each block, as in MIME type - // `audio/x-speex-with-header-byte`. - // It is a variant of the RTP Speex encoding defined in - // [RFC 5574](https://tools.ietf.org/html/rfc5574). - // The stream is a sequence of blocks, one block per RTP packet. Each block - // starts with a byte containing the length of the block, in bytes, followed - // by one or more frames of Speex data, padded to an integral number of - // bytes (octets) as specified in RFC 5574. In other words, each RTP header - // is replaced with a single byte containing the block length. Only Speex - // wideband is supported. `sample_rate_hertz` must be 16000. - SPEEX_WITH_HEADER_BYTE = 7; - - // MP3 audio. Support all standard MP3 bitrates (which range from 32-320 - // kbps). When using this encoding, `sample_rate_hertz` can be optionally - // unset if not known. - MP3 = 8; - } - - // Encoding of audio data sent in all `RecognitionAudio` messages. - // This field is optional for `FLAC` and `WAV` audio files and required - // for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - AudioEncoding encoding = 1; - - // Sample rate in Hertz of the audio data sent in all - // `RecognitionAudio` messages. Valid values are: 8000-48000. - // 16000 is optimal. For best results, set the sampling rate of the audio - // source to 16000 Hz. If that's not possible, use the native sample rate of - // the audio source (instead of re-sampling). - // This field is optional for FLAC and WAV audio files, but is - // required for all other audio formats. For details, see [AudioEncoding][google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding]. - int32 sample_rate_hertz = 2; - - // The number of channels in the input audio data. - // ONLY set this for MULTI-CHANNEL recognition. - // Valid values for LINEAR16 and FLAC are `1`-`8`. - // Valid values for OGG_OPUS are '1'-'254'. - // Valid value for MULAW, AMR, AMR_WB and SPEEX_WITH_HEADER_BYTE is only `1`. - // If `0` or omitted, defaults to one channel (mono). - // Note: We only recognize the first channel by default. - // To perform independent recognition on each channel set - // `enable_separate_recognition_per_channel` to 'true'. - int32 audio_channel_count = 7; - - // This needs to be set to `true` explicitly and `audio_channel_count` > 1 - // to get each channel recognized separately. The recognition result will - // contain a `channel_tag` field to state which channel that result belongs - // to. If this is not true, we will only recognize the first channel. The - // request is billed cumulatively for all channels recognized: - // `audio_channel_count` multiplied by the length of the audio. - bool enable_separate_recognition_per_channel = 12; - - // Required. The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. - string language_code = 3 [(google.api.field_behavior) = REQUIRED]; - - // A list of up to 3 additional - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tags, - // listing possible alternative languages of the supplied audio. - // See [Language - // Support](https://cloud.google.com/speech-to-text/docs/languages) for a list - // of the currently supported language codes. If alternative languages are - // listed, recognition result will contain recognition in the most likely - // language detected including the main language_code. The recognition result - // will include the language tag of the language detected in the audio. Note: - // This feature is only supported for Voice Command and Voice Search use cases - // and performance may vary for other use cases (e.g., phone call - // transcription). - repeated string alternative_language_codes = 18; - - // Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. - // The server may return fewer than `max_alternatives`. - // Valid values are `0`-`30`. A value of `0` or `1` will return a maximum of - // one. If omitted, will return a maximum of one. - int32 max_alternatives = 4; - - // If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool profanity_filter = 5; - - // Array of [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. - // A means to provide context to assist the speech recognition. For more - // information, see - // [speech - // adaptation](https://cloud.google.com/speech-to-text/docs/context-strength). - repeated SpeechContext speech_contexts = 6; - - // If `true`, the top result includes a list of words and - // the start and end time offsets (timestamps) for those words. If - // `false`, no word-level time offset information is returned. The default is - // `false`. - bool enable_word_time_offsets = 8; - - // If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 15; - - // If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. - // The default 'false' value does not add punctuation to result hypotheses. - // Note: This is currently offered as an experimental service, complimentary - // to all users. In the future this may be exclusively available as a - // premium feature. - bool enable_automatic_punctuation = 11; - - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - // Note: Use diarization_config instead. - bool enable_speaker_diarization = 16 [deprecated = true]; - - // If set, specifies the estimated number of speakers in the conversation. - // Defaults to '2'. Ignored unless enable_speaker_diarization is set to true. - // Note: Use diarization_config instead. - int32 diarization_speaker_count = 17 [deprecated = true]; - - // Config to enable speaker diarization and set additional - // parameters to make diarization better suited for your application. - // Note: When this is enabled, we send all the words from the beginning of the - // audio for the top alternative in every consecutive STREAMING responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - // For non-streaming requests, the diarization results will be provided only - // in the top alternative of the FINAL SpeechRecognitionResult. - SpeakerDiarizationConfig diarization_config = 19; - - // Metadata regarding this request. - RecognitionMetadata metadata = 9; - - // Which model to select for the given request. Select the model - // best suited to your domain to get best results. If a model is not - // explicitly specified, then we auto-select a model based on the parameters - // in the RecognitionConfig. - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - // - //
ModelDescription
command_and_searchBest for short queries such as voice commands or voice search.
phone_callBest for audio that originated from a phone call (typically - // recorded at an 8khz sampling rate).
videoBest for audio that originated from from video or includes multiple - // speakers. Ideally the audio is recorded at a 16khz or greater - // sampling rate. This is a premium model that costs more than the - // standard rate.
defaultBest for audio that is not one of the specific audio models. - // For example, long-form audio. Ideally the audio is high-fidelity, - // recorded at a 16khz or greater sampling rate.
- string model = 13; - - // Set to true to use an enhanced model for speech recognition. - // If `use_enhanced` is set to true and the `model` field is not set, then - // an appropriate enhanced model is chosen if an enhanced model exists for - // the audio. - // - // If `use_enhanced` is true and an enhanced version of the specified model - // does not exist, then the speech is recognized using the standard version - // of the specified model. - bool use_enhanced = 14; -} - -// Config to enable speaker diarization. -message SpeakerDiarizationConfig { - // If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - bool enable_speaker_diarization = 1; - - // Minimum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 2. - int32 min_speaker_count = 2; - - // Maximum number of speakers in the conversation. This range gives you more - // flexibility by allowing the system to automatically determine the correct - // number of speakers. If not set, the default value is 6. - int32 max_speaker_count = 3; -} - -// Description of audio data to be recognized. -message RecognitionMetadata { - // Use case categories that the audio recognition request can be described - // by. - enum InteractionType { - // Use case is either unknown or is something other than one of the other - // values below. - INTERACTION_TYPE_UNSPECIFIED = 0; - - // Multiple people in a conversation or discussion. For example in a - // meeting with two or more people actively participating. Typically - // all the primary people speaking would be in the same room (if not, - // see PHONE_CALL) - DISCUSSION = 1; - - // One or more persons lecturing or presenting to others, mostly - // uninterrupted. - PRESENTATION = 2; - - // A phone-call or video-conference in which two or more people, who are - // not in the same room, are actively participating. - PHONE_CALL = 3; - - // A recorded message intended for another person to listen to. - VOICEMAIL = 4; - - // Professionally produced audio (eg. TV Show, Podcast). - PROFESSIONALLY_PRODUCED = 5; - - // Transcribe spoken questions and queries into text. - VOICE_SEARCH = 6; - - // Transcribe voice commands, such as for controlling a device. - VOICE_COMMAND = 7; - - // Transcribe speech to text to create a written document, such as a - // text-message, email or report. - DICTATION = 8; - } - - // Enumerates the types of capture settings describing an audio file. - enum MicrophoneDistance { - // Audio type is not known. - MICROPHONE_DISTANCE_UNSPECIFIED = 0; - - // The audio was captured from a closely placed microphone. Eg. phone, - // dictaphone, or handheld microphone. Generally if there speaker is within - // 1 meter of the microphone. - NEARFIELD = 1; - - // The speaker if within 3 meters of the microphone. - MIDFIELD = 2; - - // The speaker is more than 3 meters away from the microphone. - FARFIELD = 3; - } - - // The original media the speech was recorded on. - enum OriginalMediaType { - // Unknown original media type. - ORIGINAL_MEDIA_TYPE_UNSPECIFIED = 0; - - // The speech data is an audio recording. - AUDIO = 1; - - // The speech data originally recorded on a video. - VIDEO = 2; - } - - // The type of device the speech was recorded with. - enum RecordingDeviceType { - // The recording device is unknown. - RECORDING_DEVICE_TYPE_UNSPECIFIED = 0; - - // Speech was recorded on a smartphone. - SMARTPHONE = 1; - - // Speech was recorded using a personal computer or tablet. - PC = 2; - - // Speech was recorded over a phone line. - PHONE_LINE = 3; - - // Speech was recorded in a vehicle. - VEHICLE = 4; - - // Speech was recorded outdoors. - OTHER_OUTDOOR_DEVICE = 5; - - // Speech was recorded indoors. - OTHER_INDOOR_DEVICE = 6; - } - - // The use case most closely describing the audio content to be recognized. - InteractionType interaction_type = 1; - - // The industry vertical to which this speech recognition request most - // closely applies. This is most indicative of the topics contained - // in the audio. Use the 6-digit NAICS code to identify the industry - // vertical - see https://www.naics.com/search/. - uint32 industry_naics_code_of_audio = 3; - - // The audio type that most closely describes the audio being recognized. - MicrophoneDistance microphone_distance = 4; - - // The original media the speech was recorded on. - OriginalMediaType original_media_type = 5; - - // The type of device the speech was recorded with. - RecordingDeviceType recording_device_type = 6; - - // The device used to make the recording. Examples 'Nexus 5X' or - // 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - // 'Cardioid Microphone'. - string recording_device_name = 7; - - // Mime type of the original audio file. For example `audio/m4a`, - // `audio/x-alaw-basic`, `audio/mp3`, `audio/3gpp`. - // A list of possible audio mime types is maintained at - // http://www.iana.org/assignments/media-types/media-types.xhtml#audio - string original_mime_type = 8; - - // Obfuscated (privacy-protected) ID of the user, to identify number of - // unique users using the service. - int64 obfuscated_id = 9 [deprecated = true]; - - // Description of the content. Eg. "Recordings of federal supreme court - // hearings from 2012". - string audio_topic = 10; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech-to-text/quotas#content). - // - // List items can also be set to classes for groups of words that represent - // common concepts that occur in natural language. For example, rather than - // providing phrase hints for every month of the year, using the $MONTH class - // improves the likelihood of correctly transcribing audio that includes - // months. - repeated string phrases = 1; - - // Hint Boost. Positive value will increase the probability that a specific - // phrase will be recognized over other similar sounding phrases. The higher - // the boost, the higher the chance of false positive recognition as well. - // Negative boost values would correspond to anti-biasing. Anti-biasing is not - // enabled, so negative boost will simply be ignored. Though `boost` can - // accept a wide range of positive values, most use cases are best served with - // values between 0 and 20. We recommend using a binary search approach to - // finding the optimal value for your use case. - float boost = 4; -} - -// Contains audio data in the encoding specified in the `RecognitionConfig`. -// Either `content` or `uri` must be supplied. Supplying both or neither -// returns [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]. See -// [content limits](https://cloud.google.com/speech-to-text/quotas#content). -message RecognitionAudio { - // The audio source, which is either inline content or a Google Cloud - // Storage uri. - oneof audio_source { - // The audio data bytes encoded as specified in - // `RecognitionConfig`. Note: as with all bytes fields, proto buffers use a - // pure binary representation, whereas JSON representations use base64. - bytes content = 1; - - // URI that points to a file that contains audio data bytes as specified in - // `RecognitionConfig`. The file must not be compressed (for example, gzip). - // Currently, only Google Cloud Storage URIs are - // supported, which must be specified in the following format: - // `gs://bucket_name/object_name` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](https://cloud.google.com/storage/docs/reference-uris). - string uri = 2; - } -} - -// The only message returned to the client by the `Recognize` method. It -// contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. -message RecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// The only message returned to the client by the `LongRunningRecognize` method. -// It contains the result as zero or more sequential `SpeechRecognitionResult` -// messages. It is included in the `result.response` field of the `Operation` -// returned by the `GetOperation` call of the `google::longrunning::Operations` -// service. -message LongRunningRecognizeResponse { - // Sequential list of transcription results corresponding to - // sequential portions of audio. - repeated SpeechRecognitionResult results = 2; -} - -// Describes the progress of a long-running `LongRunningRecognize` call. It is -// included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message LongRunningRecognizeMetadata { - // Approximate percentage of audio processed thus far. Guaranteed to be 100 - // when the audio is fully processed and the results are available. - int32 progress_percent = 1; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 2; - - // Time of the most recent processing update. - google.protobuf.Timestamp last_update_time = 3; -} - -// `StreamingRecognizeResponse` is the only message returned to the client by -// `StreamingRecognize`. A series of zero or more `StreamingRecognizeResponse` -// messages are streamed back to the client. If there is no recognizable -// audio, and `single_utterance` is set to false, then no messages are streamed -// back to the client. -// -// Here's an example of a series of ten `StreamingRecognizeResponse`s that might -// be returned while processing audio: -// -// 1. results { alternatives { transcript: "tube" } stability: 0.01 } -// -// 2. results { alternatives { transcript: "to be a" } stability: 0.01 } -// -// 3. results { alternatives { transcript: "to be" } stability: 0.9 } -// results { alternatives { transcript: " or not to be" } stability: 0.01 } -// -// 4. results { alternatives { transcript: "to be or not to be" -// confidence: 0.92 } -// alternatives { transcript: "to bee or not to bee" } -// is_final: true } -// -// 5. results { alternatives { transcript: " that's" } stability: 0.01 } -// -// 6. results { alternatives { transcript: " that is" } stability: 0.9 } -// results { alternatives { transcript: " the question" } stability: 0.01 } -// -// 7. results { alternatives { transcript: " that is the question" -// confidence: 0.98 } -// alternatives { transcript: " that was the question" } -// is_final: true } -// -// Notes: -// -// - Only two of the above responses #4 and #7 contain final results; they are -// indicated by `is_final: true`. Concatenating these together generates the -// full transcript: "to be or not to be that is the question". -// -// - The others contain interim `results`. #3 and #6 contain two interim -// `results`: the first portion has a high stability and is less likely to -// change; the second portion has a low stability and is very likely to -// change. A UI designer might choose to show only high stability `results`. -// -// - The specific `stability` and `confidence` values shown above are only for -// illustrative purposes. Actual values may vary. -// -// - In each response, only one of these fields will be set: -// `error`, -// `speech_event_type`, or -// one or more (repeated) `results`. -message StreamingRecognizeResponse { - // Indicates the type of speech event. - enum SpeechEventType { - // No speech event specified. - SPEECH_EVENT_UNSPECIFIED = 0; - - // This event indicates that the server has detected the end of the user's - // speech utterance and expects no additional speech. Therefore, the server - // will not process additional audio (although it may subsequently return - // additional results). The client should stop sending additional audio - // data, half-close the gRPC connection, and wait for any additional results - // until the server closes the gRPC connection. This event is only sent if - // `single_utterance` was set to `true`, and is not used otherwise. - END_OF_SINGLE_UTTERANCE = 1; - } - - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // This repeated list contains zero or more results that - // correspond to consecutive portions of the audio currently being processed. - // It contains zero or one `is_final=true` result (the newly settled portion), - // followed by zero or more `is_final=false` results (the interim results). - repeated StreamingRecognitionResult results = 2; - - // Indicates the type of speech event. - SpeechEventType speech_event_type = 4; -} - -// A streaming speech recognition result corresponding to a portion of the audio -// that is currently being processed. -message StreamingRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // If `false`, this `StreamingRecognitionResult` represents an - // interim result that may change. If `true`, this is the final time the - // speech service will return this particular `StreamingRecognitionResult`, - // the recognizer will not return any further hypotheses for this portion of - // the transcript and corresponding audio. - bool is_final = 2; - - // An estimate of the likelihood that the recognizer will not - // change its guess about this interim result. Values range from 0.0 - // (completely unstable) to 1.0 (completely stable). - // This field is only provided for interim results (`is_final=false`). - // The default of 0.0 is a sentinel value indicating `stability` was not set. - float stability = 3; - - // Time offset of the end of this result relative to the - // beginning of the audio. - google.protobuf.Duration result_end_time = 4; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 5; - - // The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 6; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechRecognitionResult { - // May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // For multi-channel audio, this is the channel number corresponding to the - // recognized result for the audio from that channel. - // For audio_channel_count = N, its output values can range from '1' to 'N'. - int32 channel_tag = 2; - - // The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag - // of the language in this result. This language code was detected to have - // the most likelihood of being spoken in the audio. - string language_code = 5; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. -message WordInfo { - // Time offset relative to the beginning of the audio, - // and corresponding to the start of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, - // and corresponding to the end of the spoken word. - // This field is only set if `enable_word_time_offsets=true` and only - // in the top hypothesis. - // This is an experimental feature and the accuracy of the time offset can - // vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative of a non-streaming - // result or, of a streaming result where `is_final=true`. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4; - - // A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from '1' to diarization_speaker_count. - // speaker_tag is set if enable_speaker_diarization = 'true' and only in the - // top alternative. - int32 speaker_tag = 5; -} diff --git a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2.py b/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2.py deleted file mode 100644 index 1fd8de4ffbe8..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2.py +++ /dev/null @@ -1,2823 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/speech_v1p1beta1/proto/cloud_speech.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/speech_v1p1beta1/proto/cloud_speech.proto", - package="google.cloud.speech.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.speech.v1p1beta1B\013SpeechProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech\370\001\001\242\002\003GCS" - ), - serialized_pb=_b( - '\n6google/cloud/speech_v1p1beta1/proto/cloud_speech.proto\x12\x1dgoogle.cloud.speech.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\x9e\x01\n\x10RecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02"\xa9\x01\n\x1bLongRunningRecognizeRequest\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x43\n\x05\x61udio\x18\x02 \x01(\x0b\x32/.google.cloud.speech.v1p1beta1.RecognitionAudioB\x03\xe0\x41\x02"\xa0\x01\n\x19StreamingRecognizeRequest\x12U\n\x10streaming_config\x18\x01 \x01(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionConfigH\x00\x12\x17\n\raudio_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request"\x96\x01\n\x1aStreamingRecognitionConfig\x12\x45\n\x06\x63onfig\x18\x01 \x01(\x0b\x32\x30.google.cloud.speech.v1p1beta1.RecognitionConfigB\x03\xe0\x41\x02\x12\x18\n\x10single_utterance\x18\x02 \x01(\x08\x12\x17\n\x0finterim_results\x18\x03 \x01(\x08"\x97\x07\n\x11RecognitionConfig\x12P\n\x08\x65ncoding\x18\x01 \x01(\x0e\x32>.google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding\x12\x19\n\x11sample_rate_hertz\x18\x02 \x01(\x05\x12\x1b\n\x13\x61udio_channel_count\x18\x07 \x01(\x05\x12/\n\'enable_separate_recognition_per_channel\x18\x0c \x01(\x08\x12\x1a\n\rlanguage_code\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12"\n\x1a\x61lternative_language_codes\x18\x12 \x03(\t\x12\x18\n\x10max_alternatives\x18\x04 \x01(\x05\x12\x18\n\x10profanity_filter\x18\x05 \x01(\x08\x12\x45\n\x0fspeech_contexts\x18\x06 \x03(\x0b\x32,.google.cloud.speech.v1p1beta1.SpeechContext\x12 \n\x18\x65nable_word_time_offsets\x18\x08 \x01(\x08\x12\x1e\n\x16\x65nable_word_confidence\x18\x0f \x01(\x08\x12$\n\x1c\x65nable_automatic_punctuation\x18\x0b \x01(\x08\x12&\n\x1a\x65nable_speaker_diarization\x18\x10 \x01(\x08\x42\x02\x18\x01\x12%\n\x19\x64iarization_speaker_count\x18\x11 \x01(\x05\x42\x02\x18\x01\x12S\n\x12\x64iarization_config\x18\x13 \x01(\x0b\x32\x37.google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig\x12\x44\n\x08metadata\x18\t \x01(\x0b\x32\x32.google.cloud.speech.v1p1beta1.RecognitionMetadata\x12\r\n\x05model\x18\r \x01(\t\x12\x14\n\x0cuse_enhanced\x18\x0e \x01(\x08"\x94\x01\n\rAudioEncoding\x12\x18\n\x14\x45NCODING_UNSPECIFIED\x10\x00\x12\x0c\n\x08LINEAR16\x10\x01\x12\x08\n\x04\x46LAC\x10\x02\x12\t\n\x05MULAW\x10\x03\x12\x07\n\x03\x41MR\x10\x04\x12\n\n\x06\x41MR_WB\x10\x05\x12\x0c\n\x08OGG_OPUS\x10\x06\x12\x1a\n\x16SPEEX_WITH_HEADER_BYTE\x10\x07\x12\x07\n\x03MP3\x10\x08"t\n\x18SpeakerDiarizationConfig\x12"\n\x1a\x65nable_speaker_diarization\x18\x01 \x01(\x08\x12\x19\n\x11min_speaker_count\x18\x02 \x01(\x05\x12\x19\n\x11max_speaker_count\x18\x03 \x01(\x05"\xd7\x08\n\x13RecognitionMetadata\x12\\\n\x10interaction_type\x18\x01 \x01(\x0e\x32\x42.google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType\x12$\n\x1cindustry_naics_code_of_audio\x18\x03 \x01(\r\x12\x62\n\x13microphone_distance\x18\x04 \x01(\x0e\x32\x45.google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance\x12\x61\n\x13original_media_type\x18\x05 \x01(\x0e\x32\x44.google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType\x12\x65\n\x15recording_device_type\x18\x06 \x01(\x0e\x32\x46.google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType\x12\x1d\n\x15recording_device_name\x18\x07 \x01(\t\x12\x1a\n\x12original_mime_type\x18\x08 \x01(\t\x12\x19\n\robfuscated_id\x18\t \x01(\x03\x42\x02\x18\x01\x12\x13\n\x0b\x61udio_topic\x18\n \x01(\t"\xc5\x01\n\x0fInteractionType\x12 \n\x1cINTERACTION_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nDISCUSSION\x10\x01\x12\x10\n\x0cPRESENTATION\x10\x02\x12\x0e\n\nPHONE_CALL\x10\x03\x12\r\n\tVOICEMAIL\x10\x04\x12\x1b\n\x17PROFESSIONALLY_PRODUCED\x10\x05\x12\x10\n\x0cVOICE_SEARCH\x10\x06\x12\x11\n\rVOICE_COMMAND\x10\x07\x12\r\n\tDICTATION\x10\x08"d\n\x12MicrophoneDistance\x12#\n\x1fMICROPHONE_DISTANCE_UNSPECIFIED\x10\x00\x12\r\n\tNEARFIELD\x10\x01\x12\x0c\n\x08MIDFIELD\x10\x02\x12\x0c\n\x08\x46\x41RFIELD\x10\x03"N\n\x11OriginalMediaType\x12#\n\x1fORIGINAL_MEDIA_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05\x41UDIO\x10\x01\x12\t\n\x05VIDEO\x10\x02"\xa4\x01\n\x13RecordingDeviceType\x12%\n!RECORDING_DEVICE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nSMARTPHONE\x10\x01\x12\x06\n\x02PC\x10\x02\x12\x0e\n\nPHONE_LINE\x10\x03\x12\x0b\n\x07VEHICLE\x10\x04\x12\x18\n\x14OTHER_OUTDOOR_DEVICE\x10\x05\x12\x17\n\x13OTHER_INDOOR_DEVICE\x10\x06"/\n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t\x12\r\n\x05\x62oost\x18\x04 \x01(\x02"D\n\x10RecognitionAudio\x12\x11\n\x07\x63ontent\x18\x01 \x01(\x0cH\x00\x12\r\n\x03uri\x18\x02 \x01(\tH\x00\x42\x0e\n\x0c\x61udio_source"\\\n\x11RecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult"g\n\x1cLongRunningRecognizeResponse\x12G\n\x07results\x18\x02 \x03(\x0b\x32\x36.google.cloud.speech.v1p1beta1.SpeechRecognitionResult"\x9e\x01\n\x1cLongRunningRecognizeMetadata\x12\x18\n\x10progress_percent\x18\x01 \x01(\x05\x12.\n\nstart_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10last_update_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xbf\x02\n\x1aStreamingRecognizeResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12J\n\x07results\x18\x02 \x03(\x0b\x32\x39.google.cloud.speech.v1p1beta1.StreamingRecognitionResult\x12\x64\n\x11speech_event_type\x18\x04 \x01(\x0e\x32I.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType"L\n\x0fSpeechEventType\x12\x1c\n\x18SPEECH_EVENT_UNSPECIFIED\x10\x00\x12\x1b\n\x17\x45ND_OF_SINGLE_UTTERANCE\x10\x01"\xf4\x01\n\x1aStreamingRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x10\n\x08is_final\x18\x02 \x01(\x08\x12\x11\n\tstability\x18\x03 \x01(\x02\x12\x32\n\x0fresult_end_time\x18\x04 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x13\n\x0b\x63hannel_tag\x18\x05 \x01(\x05\x12\x15\n\rlanguage_code\x18\x06 \x01(\t"\x98\x01\n\x17SpeechRecognitionResult\x12Q\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32;.google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative\x12\x13\n\x0b\x63hannel_tag\x18\x02 \x01(\x05\x12\x15\n\rlanguage_code\x18\x05 \x01(\t"~\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x36\n\x05words\x18\x03 \x03(\x0b\x32\'.google.cloud.speech.v1p1beta1.WordInfo"\x9d\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x13\n\x0bspeaker_tag\x18\x05 \x01(\x05\x32\x82\x05\n\x06Speech\x12\xa5\x01\n\tRecognize\x12/.google.cloud.speech.v1p1beta1.RecognizeRequest\x1a\x30.google.cloud.speech.v1p1beta1.RecognizeResponse"5\x82\xd3\xe4\x93\x02 "\x1b/v1p1beta1/speech:recognize:\x01*\xda\x41\x0c\x63onfig,audio\x12\xf2\x01\n\x14LongRunningRecognize\x12:.google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest\x1a\x1d.google.longrunning.Operation"\x7f\x82\xd3\xe4\x93\x02+"&/v1p1beta1/speech:longrunningrecognize:\x01*\xda\x41\x0c\x63onfig,audio\xca\x41<\n\x1cLongRunningRecognizeResponse\x12\x1cLongRunningRecognizeMetadata\x12\x8f\x01\n\x12StreamingRecognize\x12\x38.google.cloud.speech.v1p1beta1.StreamingRecognizeRequest\x1a\x39.google.cloud.speech.v1p1beta1.StreamingRecognizeResponse"\x00(\x01\x30\x01\x1aI\xca\x41\x15speech.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x01\n!com.google.cloud.speech.v1p1beta1B\x0bSpeechProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/speech/v1p1beta1;speech\xf8\x01\x01\xa2\x02\x03GCSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_RECOGNITIONCONFIG_AUDIOENCODING = _descriptor.EnumDescriptor( - name="AudioEncoding", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.AudioEncoding", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ENCODING_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LINEAR16", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FLAC", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MULAW", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="AMR", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="AMR_WB", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OGG_OPUS", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPEEX_WITH_HEADER_BYTE", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MP3", index=8, number=8, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1752, - serialized_end=1900, -) -_sym_db.RegisterEnumDescriptor(_RECOGNITIONCONFIG_AUDIOENCODING) - -_RECOGNITIONMETADATA_INTERACTIONTYPE = _descriptor.EnumDescriptor( - name="InteractionType", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.InteractionType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="INTERACTION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DISCUSSION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PRESENTATION", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PHONE_CALL", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VOICEMAIL", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PROFESSIONALLY_PRODUCED", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VOICE_SEARCH", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VOICE_COMMAND", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DICTATION", index=8, number=8, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2586, - serialized_end=2783, -) -_sym_db.RegisterEnumDescriptor(_RECOGNITIONMETADATA_INTERACTIONTYPE) - -_RECOGNITIONMETADATA_MICROPHONEDISTANCE = _descriptor.EnumDescriptor( - name="MicrophoneDistance", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.MicrophoneDistance", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="MICROPHONE_DISTANCE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NEARFIELD", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MIDFIELD", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FARFIELD", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2785, - serialized_end=2885, -) -_sym_db.RegisterEnumDescriptor(_RECOGNITIONMETADATA_MICROPHONEDISTANCE) - -_RECOGNITIONMETADATA_ORIGINALMEDIATYPE = _descriptor.EnumDescriptor( - name="OriginalMediaType", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.OriginalMediaType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ORIGINAL_MEDIA_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="AUDIO", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIDEO", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2887, - serialized_end=2965, -) -_sym_db.RegisterEnumDescriptor(_RECOGNITIONMETADATA_ORIGINALMEDIATYPE) - -_RECOGNITIONMETADATA_RECORDINGDEVICETYPE = _descriptor.EnumDescriptor( - name="RecordingDeviceType", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.RecordingDeviceType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="RECORDING_DEVICE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SMARTPHONE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PC", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PHONE_LINE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VEHICLE", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER_OUTDOOR_DEVICE", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OTHER_INDOOR_DEVICE", - index=6, - number=6, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2968, - serialized_end=3132, -) -_sym_db.RegisterEnumDescriptor(_RECOGNITIONMETADATA_RECORDINGDEVICETYPE) - -_STREAMINGRECOGNIZERESPONSE_SPEECHEVENTTYPE = _descriptor.EnumDescriptor( - name="SpeechEventType", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.SpeechEventType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SPEECH_EVENT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="END_OF_SINGLE_UTTERANCE", - index=1, - number=1, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3857, - serialized_end=3933, -) -_sym_db.RegisterEnumDescriptor(_STREAMINGRECOGNIZERESPONSE_SPEECHEVENTTYPE) - - -_RECOGNIZEREQUEST = _descriptor.Descriptor( - name="RecognizeRequest", - full_name="google.cloud.speech.v1p1beta1.RecognizeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="config", - full_name="google.cloud.speech.v1p1beta1.RecognizeRequest.config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio", - full_name="google.cloud.speech.v1p1beta1.RecognizeRequest.audio", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=332, - serialized_end=490, -) - - -_LONGRUNNINGRECOGNIZEREQUEST = _descriptor.Descriptor( - name="LongRunningRecognizeRequest", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="config", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest.audio", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=493, - serialized_end=662, -) - - -_STREAMINGRECOGNIZEREQUEST = _descriptor.Descriptor( - name="StreamingRecognizeRequest", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="streaming_config", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.streaming_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_content", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.audio_content", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="streaming_request", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeRequest.streaming_request", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=665, - serialized_end=825, -) - - -_STREAMINGRECOGNITIONCONFIG = _descriptor.Descriptor( - name="StreamingRecognitionConfig", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="config", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="single_utterance", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.single_utterance", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="interim_results", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionConfig.interim_results", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=828, - serialized_end=978, -) - - -_RECOGNITIONCONFIG = _descriptor.Descriptor( - name="RecognitionConfig", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="encoding", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.encoding", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sample_rate_hertz", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.sample_rate_hertz", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_channel_count", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.audio_channel_count", - index=2, - number=7, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_separate_recognition_per_channel", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.enable_separate_recognition_per_channel", - index=3, - number=12, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.language_code", - index=4, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="alternative_language_codes", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.alternative_language_codes", - index=5, - number=18, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_alternatives", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.max_alternatives", - index=6, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profanity_filter", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.profanity_filter", - index=7, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_contexts", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.speech_contexts", - index=8, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_word_time_offsets", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.enable_word_time_offsets", - index=9, - number=8, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_word_confidence", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.enable_word_confidence", - index=10, - number=15, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_automatic_punctuation", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.enable_automatic_punctuation", - index=11, - number=11, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_speaker_diarization", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.enable_speaker_diarization", - index=12, - number=16, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="diarization_speaker_count", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_speaker_count", - index=13, - number=17, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="diarization_config", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.diarization_config", - index=14, - number=19, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.metadata", - index=15, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.model", - index=16, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="use_enhanced", - full_name="google.cloud.speech.v1p1beta1.RecognitionConfig.use_enhanced", - index=17, - number=14, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_RECOGNITIONCONFIG_AUDIOENCODING], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1900, -) - - -_SPEAKERDIARIZATIONCONFIG = _descriptor.Descriptor( - name="SpeakerDiarizationConfig", - full_name="google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enable_speaker_diarization", - full_name="google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.enable_speaker_diarization", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="min_speaker_count", - full_name="google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.min_speaker_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_speaker_count", - full_name="google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig.max_speaker_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1902, - serialized_end=2018, -) - - -_RECOGNITIONMETADATA = _descriptor.Descriptor( - name="RecognitionMetadata", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="interaction_type", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.interaction_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="industry_naics_code_of_audio", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.industry_naics_code_of_audio", - index=1, - number=3, - type=13, - cpp_type=3, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="microphone_distance", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.microphone_distance", - index=2, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="original_media_type", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.original_media_type", - index=3, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recording_device_type", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.recording_device_type", - index=4, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recording_device_name", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.recording_device_name", - index=5, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="original_mime_type", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.original_mime_type", - index=6, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="obfuscated_id", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.obfuscated_id", - index=7, - number=9, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_topic", - full_name="google.cloud.speech.v1p1beta1.RecognitionMetadata.audio_topic", - index=8, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[ - _RECOGNITIONMETADATA_INTERACTIONTYPE, - _RECOGNITIONMETADATA_MICROPHONEDISTANCE, - _RECOGNITIONMETADATA_ORIGINALMEDIATYPE, - _RECOGNITIONMETADATA_RECORDINGDEVICETYPE, - ], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2021, - serialized_end=3132, -) - - -_SPEECHCONTEXT = _descriptor.Descriptor( - name="SpeechContext", - full_name="google.cloud.speech.v1p1beta1.SpeechContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="phrases", - full_name="google.cloud.speech.v1p1beta1.SpeechContext.phrases", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="boost", - full_name="google.cloud.speech.v1p1beta1.SpeechContext.boost", - index=1, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3134, - serialized_end=3181, -) - - -_RECOGNITIONAUDIO = _descriptor.Descriptor( - name="RecognitionAudio", - full_name="google.cloud.speech.v1p1beta1.RecognitionAudio", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.speech.v1p1beta1.RecognitionAudio.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.speech.v1p1beta1.RecognitionAudio.uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="audio_source", - full_name="google.cloud.speech.v1p1beta1.RecognitionAudio.audio_source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3183, - serialized_end=3251, -) - - -_RECOGNIZERESPONSE = _descriptor.Descriptor( - name="RecognizeResponse", - full_name="google.cloud.speech.v1p1beta1.RecognizeResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.speech.v1p1beta1.RecognizeResponse.results", - index=0, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3253, - serialized_end=3345, -) - - -_LONGRUNNINGRECOGNIZERESPONSE = _descriptor.Descriptor( - name="LongRunningRecognizeResponse", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse.results", - index=0, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3347, - serialized_end=3450, -) - - -_LONGRUNNINGRECOGNIZEMETADATA = _descriptor.Descriptor( - name="LongRunningRecognizeMetadata", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.progress_percent", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.start_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="last_update_time", - full_name="google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata.last_update_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3453, - serialized_end=3611, -) - - -_STREAMINGRECOGNIZERESPONSE = _descriptor.Descriptor( - name="StreamingRecognizeResponse", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.error", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.results", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_event_type", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognizeResponse.speech_event_type", - index=2, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_STREAMINGRECOGNIZERESPONSE_SPEECHEVENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3614, - serialized_end=3933, -) - - -_STREAMINGRECOGNITIONRESULT = _descriptor.Descriptor( - name="StreamingRecognitionResult", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="alternatives", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.alternatives", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_final", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.is_final", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stability", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.stability", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="result_end_time", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.result_end_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="channel_tag", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.channel_tag", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.speech.v1p1beta1.StreamingRecognitionResult.language_code", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3936, - serialized_end=4180, -) - - -_SPEECHRECOGNITIONRESULT = _descriptor.Descriptor( - name="SpeechRecognitionResult", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="alternatives", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionResult.alternatives", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="channel_tag", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionResult.channel_tag", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionResult.language_code", - index=2, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4183, - serialized_end=4335, -) - - -_SPEECHRECOGNITIONALTERNATIVE = _descriptor.Descriptor( - name="SpeechRecognitionAlternative", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="transcript", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.transcript", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4337, - serialized_end=4463, -) - - -_WORDINFO = _descriptor.Descriptor( - name="WordInfo", - full_name="google.cloud.speech.v1p1beta1.WordInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.speech.v1p1beta1.WordInfo.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.speech.v1p1beta1.WordInfo.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="word", - full_name="google.cloud.speech.v1p1beta1.WordInfo.word", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.speech.v1p1beta1.WordInfo.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speaker_tag", - full_name="google.cloud.speech.v1p1beta1.WordInfo.speaker_tag", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4466, - serialized_end=4623, -) - -_RECOGNIZEREQUEST.fields_by_name["config"].message_type = _RECOGNITIONCONFIG -_RECOGNIZEREQUEST.fields_by_name["audio"].message_type = _RECOGNITIONAUDIO -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["config"].message_type = _RECOGNITIONCONFIG -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["audio"].message_type = _RECOGNITIONAUDIO -_STREAMINGRECOGNIZEREQUEST.fields_by_name[ - "streaming_config" -].message_type = _STREAMINGRECOGNITIONCONFIG -_STREAMINGRECOGNIZEREQUEST.oneofs_by_name["streaming_request"].fields.append( - _STREAMINGRECOGNIZEREQUEST.fields_by_name["streaming_config"] -) -_STREAMINGRECOGNIZEREQUEST.fields_by_name[ - "streaming_config" -].containing_oneof = _STREAMINGRECOGNIZEREQUEST.oneofs_by_name["streaming_request"] -_STREAMINGRECOGNIZEREQUEST.oneofs_by_name["streaming_request"].fields.append( - _STREAMINGRECOGNIZEREQUEST.fields_by_name["audio_content"] -) -_STREAMINGRECOGNIZEREQUEST.fields_by_name[ - "audio_content" -].containing_oneof = _STREAMINGRECOGNIZEREQUEST.oneofs_by_name["streaming_request"] -_STREAMINGRECOGNITIONCONFIG.fields_by_name["config"].message_type = _RECOGNITIONCONFIG -_RECOGNITIONCONFIG.fields_by_name[ - "encoding" -].enum_type = _RECOGNITIONCONFIG_AUDIOENCODING -_RECOGNITIONCONFIG.fields_by_name["speech_contexts"].message_type = _SPEECHCONTEXT -_RECOGNITIONCONFIG.fields_by_name[ - "diarization_config" -].message_type = _SPEAKERDIARIZATIONCONFIG -_RECOGNITIONCONFIG.fields_by_name["metadata"].message_type = _RECOGNITIONMETADATA -_RECOGNITIONCONFIG_AUDIOENCODING.containing_type = _RECOGNITIONCONFIG -_RECOGNITIONMETADATA.fields_by_name[ - "interaction_type" -].enum_type = _RECOGNITIONMETADATA_INTERACTIONTYPE -_RECOGNITIONMETADATA.fields_by_name[ - "microphone_distance" -].enum_type = _RECOGNITIONMETADATA_MICROPHONEDISTANCE -_RECOGNITIONMETADATA.fields_by_name[ - "original_media_type" -].enum_type = _RECOGNITIONMETADATA_ORIGINALMEDIATYPE -_RECOGNITIONMETADATA.fields_by_name[ - "recording_device_type" -].enum_type = _RECOGNITIONMETADATA_RECORDINGDEVICETYPE -_RECOGNITIONMETADATA_INTERACTIONTYPE.containing_type = _RECOGNITIONMETADATA -_RECOGNITIONMETADATA_MICROPHONEDISTANCE.containing_type = _RECOGNITIONMETADATA -_RECOGNITIONMETADATA_ORIGINALMEDIATYPE.containing_type = _RECOGNITIONMETADATA -_RECOGNITIONMETADATA_RECORDINGDEVICETYPE.containing_type = _RECOGNITIONMETADATA -_RECOGNITIONAUDIO.oneofs_by_name["audio_source"].fields.append( - _RECOGNITIONAUDIO.fields_by_name["content"] -) -_RECOGNITIONAUDIO.fields_by_name[ - "content" -].containing_oneof = _RECOGNITIONAUDIO.oneofs_by_name["audio_source"] -_RECOGNITIONAUDIO.oneofs_by_name["audio_source"].fields.append( - _RECOGNITIONAUDIO.fields_by_name["uri"] -) -_RECOGNITIONAUDIO.fields_by_name[ - "uri" -].containing_oneof = _RECOGNITIONAUDIO.oneofs_by_name["audio_source"] -_RECOGNIZERESPONSE.fields_by_name["results"].message_type = _SPEECHRECOGNITIONRESULT -_LONGRUNNINGRECOGNIZERESPONSE.fields_by_name[ - "results" -].message_type = _SPEECHRECOGNITIONRESULT -_LONGRUNNINGRECOGNIZEMETADATA.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LONGRUNNINGRECOGNIZEMETADATA.fields_by_name[ - "last_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_STREAMINGRECOGNIZERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_STREAMINGRECOGNIZERESPONSE.fields_by_name[ - "results" -].message_type = _STREAMINGRECOGNITIONRESULT -_STREAMINGRECOGNIZERESPONSE.fields_by_name[ - "speech_event_type" -].enum_type = _STREAMINGRECOGNIZERESPONSE_SPEECHEVENTTYPE -_STREAMINGRECOGNIZERESPONSE_SPEECHEVENTTYPE.containing_type = ( - _STREAMINGRECOGNIZERESPONSE -) -_STREAMINGRECOGNITIONRESULT.fields_by_name[ - "alternatives" -].message_type = _SPEECHRECOGNITIONALTERNATIVE -_STREAMINGRECOGNITIONRESULT.fields_by_name[ - "result_end_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_SPEECHRECOGNITIONRESULT.fields_by_name[ - "alternatives" -].message_type = _SPEECHRECOGNITIONALTERNATIVE -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"].message_type = _WORDINFO -_WORDINFO.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_WORDINFO.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -DESCRIPTOR.message_types_by_name["RecognizeRequest"] = _RECOGNIZEREQUEST -DESCRIPTOR.message_types_by_name[ - "LongRunningRecognizeRequest" -] = _LONGRUNNINGRECOGNIZEREQUEST -DESCRIPTOR.message_types_by_name[ - "StreamingRecognizeRequest" -] = _STREAMINGRECOGNIZEREQUEST -DESCRIPTOR.message_types_by_name[ - "StreamingRecognitionConfig" -] = _STREAMINGRECOGNITIONCONFIG -DESCRIPTOR.message_types_by_name["RecognitionConfig"] = _RECOGNITIONCONFIG -DESCRIPTOR.message_types_by_name["SpeakerDiarizationConfig"] = _SPEAKERDIARIZATIONCONFIG -DESCRIPTOR.message_types_by_name["RecognitionMetadata"] = _RECOGNITIONMETADATA -DESCRIPTOR.message_types_by_name["SpeechContext"] = _SPEECHCONTEXT -DESCRIPTOR.message_types_by_name["RecognitionAudio"] = _RECOGNITIONAUDIO -DESCRIPTOR.message_types_by_name["RecognizeResponse"] = _RECOGNIZERESPONSE -DESCRIPTOR.message_types_by_name[ - "LongRunningRecognizeResponse" -] = _LONGRUNNINGRECOGNIZERESPONSE -DESCRIPTOR.message_types_by_name[ - "LongRunningRecognizeMetadata" -] = _LONGRUNNINGRECOGNIZEMETADATA -DESCRIPTOR.message_types_by_name[ - "StreamingRecognizeResponse" -] = _STREAMINGRECOGNIZERESPONSE -DESCRIPTOR.message_types_by_name[ - "StreamingRecognitionResult" -] = _STREAMINGRECOGNITIONRESULT -DESCRIPTOR.message_types_by_name["SpeechRecognitionResult"] = _SPEECHRECOGNITIONRESULT -DESCRIPTOR.message_types_by_name[ - "SpeechRecognitionAlternative" -] = _SPEECHRECOGNITIONALTERNATIVE -DESCRIPTOR.message_types_by_name["WordInfo"] = _WORDINFO -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -RecognizeRequest = _reflection.GeneratedProtocolMessageType( - "RecognizeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNIZEREQUEST, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""The top-level message sent by the client for the - ``Recognize`` method. - - - Attributes: - config: - Required. Provides information to the recognizer that - specifies how to process the request. - audio: - Required. The audio data to be recognized. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeRequest) - ), -) -_sym_db.RegisterMessage(RecognizeRequest) - -LongRunningRecognizeRequest = _reflection.GeneratedProtocolMessageType( - "LongRunningRecognizeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LONGRUNNINGRECOGNIZEREQUEST, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""The top-level message sent by the client for the - ``LongRunningRecognize`` method. - - - Attributes: - config: - Required. Provides information to the recognizer that - specifies how to process the request. - audio: - Required. The audio data to be recognized. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeRequest) - ), -) -_sym_db.RegisterMessage(LongRunningRecognizeRequest) - -StreamingRecognizeRequest = _reflection.GeneratedProtocolMessageType( - "StreamingRecognizeRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNIZEREQUEST, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""The top-level message sent by the client for the - ``StreamingRecognize`` method. Multiple ``StreamingRecognizeRequest`` - messages are sent. The first message must contain a ``streaming_config`` - message and must not contain ``audio_content``. All subsequent messages - must contain ``audio_content`` and must not contain a - ``streaming_config`` message. - - - Attributes: - streaming_request: - The streaming request, which is either a streaming config or - audio content. - streaming_config: - Provides information to the recognizer that specifies how to - process the request. The first ``StreamingRecognizeRequest`` - message must contain a ``streaming_config`` message. - audio_content: - The audio data to be recognized. Sequential chunks of audio - data are sent in sequential ``StreamingRecognizeRequest`` - messages. The first ``StreamingRecognizeRequest`` message must - not contain ``audio_content`` data and all subsequent - ``StreamingRecognizeRequest`` messages must contain - ``audio_content`` data. The audio bytes must be encoded as - specified in ``RecognitionConfig``. Note: as with all bytes - fields, proto buffers use a pure binary representation (not - base64). See `content limits `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeRequest) - ), -) -_sym_db.RegisterMessage(StreamingRecognizeRequest) - -StreamingRecognitionConfig = _reflection.GeneratedProtocolMessageType( - "StreamingRecognitionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNITIONCONFIG, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Provides information to the recognizer that specifies how - to process the request. - - - Attributes: - config: - Required. Provides information to the recognizer that - specifies how to process the request. - single_utterance: - If ``false`` or omitted, the recognizer will perform - continuous recognition (continuing to wait for and process - audio even if the user pauses speaking) until the client - closes the input stream (gRPC API) or until the maximum time - limit has been reached. May return multiple - ``StreamingRecognitionResult``\ s with the ``is_final`` flag - set to ``true``. If ``true``, the recognizer will detect a - single spoken utterance. When it detects that the user has - paused or stopped speaking, it will return an - ``END_OF_SINGLE_UTTERANCE`` event and cease recognition. It - will return no more than one ``StreamingRecognitionResult`` - with the ``is_final`` flag set to ``true``. - interim_results: - If ``true``, interim results (tentative hypotheses) may be - returned as they become available (these interim results are - indicated with the ``is_final=false`` flag). If ``false`` or - omitted, only ``is_final=true`` result(s) are returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionConfig) - ), -) -_sym_db.RegisterMessage(StreamingRecognitionConfig) - -RecognitionConfig = _reflection.GeneratedProtocolMessageType( - "RecognitionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONCONFIG, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Provides information to the recognizer that specifies how - to process the request. - - - Attributes: - encoding: - Encoding of audio data sent in all ``RecognitionAudio`` - messages. This field is optional for ``FLAC`` and ``WAV`` - audio files and required for all other audio formats. For - details, see [AudioEncoding][google.cloud.speech.v1p1beta1.Rec - ognitionConfig.AudioEncoding]. - sample_rate_hertz: - Sample rate in Hertz of the audio data sent in all - ``RecognitionAudio`` messages. Valid values are: 8000-48000. - 16000 is optimal. For best results, set the sampling rate of - the audio source to 16000 Hz. If that's not possible, use the - native sample rate of the audio source (instead of re- - sampling). This field is optional for FLAC and WAV audio - files, but is required for all other audio formats. For - details, see [AudioEncoding][google.cloud.speech.v1p1beta1.Rec - ognitionConfig.AudioEncoding]. - audio_channel_count: - The number of channels in the input audio data. ONLY set this - for MULTI-CHANNEL recognition. Valid values for LINEAR16 and - FLAC are ``1``-``8``. Valid values for OGG\_OPUS are - '1'-'254'. Valid value for MULAW, AMR, AMR\_WB and - SPEEX\_WITH\_HEADER\_BYTE is only ``1``. If ``0`` or omitted, - defaults to one channel (mono). Note: We only recognize the - first channel by default. To perform independent recognition - on each channel set - ``enable_separate_recognition_per_channel`` to 'true'. - enable_separate_recognition_per_channel: - This needs to be set to ``true`` explicitly and - ``audio_channel_count`` > 1 to get each channel recognized - separately. The recognition result will contain a - ``channel_tag`` field to state which channel that result - belongs to. If this is not true, we will only recognize the - first channel. The request is billed cumulatively for all - channels recognized: ``audio_channel_count`` multiplied by the - length of the audio. - language_code: - Required. The language of the supplied audio as a `BCP-47 - `__ language - tag. Example: "en-US". See `Language Support - `__ - for a list of the currently supported language codes. - alternative_language_codes: - A list of up to 3 additional `BCP-47 `__ language tags, listing - possible alternative languages of the supplied audio. See - `Language Support `__ for a list of the currently supported - language codes. If alternative languages are listed, - recognition result will contain recognition in the most likely - language detected including the main language\_code. The - recognition result will include the language tag of the - language detected in the audio. Note: This feature is only - supported for Voice Command and Voice Search use cases and - performance may vary for other use cases (e.g., phone call - transcription). - max_alternatives: - Maximum number of recognition hypotheses to be returned. - Specifically, the maximum number of - ``SpeechRecognitionAlternative`` messages within each - ``SpeechRecognitionResult``. The server may return fewer than - ``max_alternatives``. Valid values are ``0``-``30``. A value - of ``0`` or ``1`` will return a maximum of one. If omitted, - will return a maximum of one. - profanity_filter: - If set to ``true``, the server will attempt to filter out - profanities, replacing all but the initial character in each - filtered word with asterisks, e.g. "f\*\*\*". If set to - ``false`` or omitted, profanities won't be filtered out. - speech_contexts: - Array of - [SpeechContext][google.cloud.speech.v1p1beta1.SpeechContext]. - A means to provide context to assist the speech recognition. - For more information, see `speech adaptation - `__. - enable_word_time_offsets: - If ``true``, the top result includes a list of words and the - start and end time offsets (timestamps) for those words. If - ``false``, no word-level time offset information is returned. - The default is ``false``. - enable_word_confidence: - If ``true``, the top result includes a list of words and the - confidence for those words. If ``false``, no word-level - confidence information is returned. The default is ``false``. - enable_automatic_punctuation: - If 'true', adds punctuation to recognition result hypotheses. - This feature is only available in select languages. Setting - this for requests in other languages has no effect at all. The - default 'false' value does not add punctuation to result - hypotheses. Note: This is currently offered as an experimental - service, complimentary to all users. In the future this may be - exclusively available as a premium feature. - enable_speaker_diarization: - If 'true', enables speaker detection for each recognized word - in the top alternative of the recognition result using a - speaker\_tag provided in the WordInfo. Note: Use - diarization\_config instead. - diarization_speaker_count: - If set, specifies the estimated number of speakers in the - conversation. Defaults to '2'. Ignored unless - enable\_speaker\_diarization is set to true. Note: Use - diarization\_config instead. - diarization_config: - Config to enable speaker diarization and set additional - parameters to make diarization better suited for your - application. Note: When this is enabled, we send all the words - from the beginning of the audio for the top alternative in - every consecutive STREAMING responses. This is done in order - to improve our speaker tags as our models learn to identify - the speakers in the conversation over time. For non-streaming - requests, the diarization results will be provided only in the - top alternative of the FINAL SpeechRecognitionResult. - metadata: - Metadata regarding this request. - model: - Which model to select for the given request. Select the model - best suited to your domain to get best results. If a model is - not explicitly specified, then we auto-select a model based on - the parameters in the RecognitionConfig. .. raw:: html - .. raw:: html :: - .. raw:: html .. raw:: - html :: - .. - raw:: html .. raw:: html :: - .. raw:: html .. raw:: - html :: - .. - raw:: html .. raw:: html :: - .. raw:: - html .. raw:: html
ModelDescription
command_and_search Best for - short queries such as voice commands or voice search.
phone_call Best for audio that - originated from a phone call (typically recorded at an - 8khz sampling rate).
videoBest for audio that originated from from video or includes - multiple speakers. Ideally the audio is recorded at a - 16khz or greater sampling rate. This is a premium - model that costs more than the standard rate.
default Best for audio that is - not one of the specific audio models. For example, - long-form audio. Ideally the audio is high-fidelity, - recorded at a 16khz or greater sampling rate.
- use_enhanced: - Set to true to use an enhanced model for speech recognition. - If ``use_enhanced`` is set to true and the ``model`` field is - not set, then an appropriate enhanced model is chosen if an - enhanced model exists for the audio. If ``use_enhanced`` is - true and an enhanced version of the specified model does not - exist, then the speech is recognized using the standard - version of the specified model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionConfig) - ), -) -_sym_db.RegisterMessage(RecognitionConfig) - -SpeakerDiarizationConfig = _reflection.GeneratedProtocolMessageType( - "SpeakerDiarizationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SPEAKERDIARIZATIONCONFIG, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Config to enable speaker diarization. - - - Attributes: - enable_speaker_diarization: - If 'true', enables speaker detection for each recognized word - in the top alternative of the recognition result using a - speaker\_tag provided in the WordInfo. - min_speaker_count: - Minimum number of speakers in the conversation. This range - gives you more flexibility by allowing the system to - automatically determine the correct number of speakers. If not - set, the default value is 2. - max_speaker_count: - Maximum number of speakers in the conversation. This range - gives you more flexibility by allowing the system to - automatically determine the correct number of speakers. If not - set, the default value is 6. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeakerDiarizationConfig) - ), -) -_sym_db.RegisterMessage(SpeakerDiarizationConfig) - -RecognitionMetadata = _reflection.GeneratedProtocolMessageType( - "RecognitionMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONMETADATA, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Description of audio data to be recognized. - - - Attributes: - interaction_type: - The use case most closely describing the audio content to be - recognized. - industry_naics_code_of_audio: - The industry vertical to which this speech recognition request - most closely applies. This is most indicative of the topics - contained in the audio. Use the 6-digit NAICS code to identify - the industry vertical - see https://www.naics.com/search/. - microphone_distance: - The audio type that most closely describes the audio being - recognized. - original_media_type: - The original media the speech was recorded on. - recording_device_type: - The type of device the speech was recorded with. - recording_device_name: - The device used to make the recording. Examples 'Nexus 5X' or - 'Polycom SoundStation IP 6000' or 'POTS' or 'VoIP' or - 'Cardioid Microphone'. - original_mime_type: - Mime type of the original audio file. For example - ``audio/m4a``, ``audio/x-alaw-basic``, ``audio/mp3``, - ``audio/3gpp``. A list of possible audio mime types is - maintained at http://www.iana.org/assignments/media- - types/media-types.xhtml#audio - obfuscated_id: - Obfuscated (privacy-protected) ID of the user, to identify - number of unique users using the service. - audio_topic: - Description of the content. Eg. "Recordings of federal supreme - court hearings from 2012". - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionMetadata) - ), -) -_sym_db.RegisterMessage(RecognitionMetadata) - -SpeechContext = _reflection.GeneratedProtocolMessageType( - "SpeechContext", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHCONTEXT, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Provides "hints" to the speech recognizer to favor - specific words and phrases in the results. - - - Attributes: - phrases: - A list of strings containing words and phrases "hints" so that - the speech recognition is more likely to recognize them. This - can be used to improve the accuracy for specific words and - phrases, for example, if specific commands are typically - spoken by the user. This can also be used to add additional - words to the vocabulary of the recognizer. See `usage limits - `__. - List items can also be set to classes for groups of words that - represent common concepts that occur in natural language. For - example, rather than providing phrase hints for every month of - the year, using the $MONTH class improves the likelihood of - correctly transcribing audio that includes months. - boost: - Hint Boost. Positive value will increase the probability that - a specific phrase will be recognized over other similar - sounding phrases. The higher the boost, the higher the chance - of false positive recognition as well. Negative boost values - would correspond to anti-biasing. Anti-biasing is not enabled, - so negative boost will simply be ignored. Though ``boost`` can - accept a wide range of positive values, most use cases are - best served with values between 0 and 20. We recommend using a - binary search approach to finding the optimal value for your - use case. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechContext) - ), -) -_sym_db.RegisterMessage(SpeechContext) - -RecognitionAudio = _reflection.GeneratedProtocolMessageType( - "RecognitionAudio", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNITIONAUDIO, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Contains audio data in the encoding specified in the - ``RecognitionConfig``. Either ``content`` or ``uri`` must be supplied. - Supplying both or neither returns - [google.rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT]. - See `content - limits `__. - - - Attributes: - audio_source: - The audio source, which is either inline content or a Google - Cloud Storage uri. - content: - The audio data bytes encoded as specified in - ``RecognitionConfig``. Note: as with all bytes fields, proto - buffers use a pure binary representation, whereas JSON - representations use base64. - uri: - URI that points to a file that contains audio data bytes as - specified in ``RecognitionConfig``. The file must not be - compressed (for example, gzip). Currently, only Google Cloud - Storage URIs are supported, which must be specified in the - following format: ``gs://bucket_name/object_name`` (other URI - formats return [google.rpc.Code.INVALID\_ARGUMENT][google.rpc. - Code.INVALID\_ARGUMENT]). For more information, see `Request - URIs `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognitionAudio) - ), -) -_sym_db.RegisterMessage(RecognitionAudio) - -RecognizeResponse = _reflection.GeneratedProtocolMessageType( - "RecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_RECOGNIZERESPONSE, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""The only message returned to the client by the - ``Recognize`` method. It contains the result as zero or more sequential - ``SpeechRecognitionResult`` messages. - - - Attributes: - results: - Sequential list of transcription results corresponding to - sequential portions of audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.RecognizeResponse) - ), -) -_sym_db.RegisterMessage(RecognizeResponse) - -LongRunningRecognizeResponse = _reflection.GeneratedProtocolMessageType( - "LongRunningRecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LONGRUNNINGRECOGNIZERESPONSE, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""The only message returned to the client by the - ``LongRunningRecognize`` method. It contains the result as zero or more - sequential ``SpeechRecognitionResult`` messages. It is included in the - ``result.response`` field of the ``Operation`` returned by the - ``GetOperation`` call of the ``google::longrunning::Operations`` - service. - - - Attributes: - results: - Sequential list of transcription results corresponding to - sequential portions of audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeResponse) - ), -) -_sym_db.RegisterMessage(LongRunningRecognizeResponse) - -LongRunningRecognizeMetadata = _reflection.GeneratedProtocolMessageType( - "LongRunningRecognizeMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_LONGRUNNINGRECOGNIZEMETADATA, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Describes the progress of a long-running - ``LongRunningRecognize`` call. It is included in the ``metadata`` field - of the ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - progress_percent: - Approximate percentage of audio processed thus far. Guaranteed - to be 100 when the audio is fully processed and the results - are available. - start_time: - Time when the request was received. - last_update_time: - Time of the most recent processing update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.LongRunningRecognizeMetadata) - ), -) -_sym_db.RegisterMessage(LongRunningRecognizeMetadata) - -StreamingRecognizeResponse = _reflection.GeneratedProtocolMessageType( - "StreamingRecognizeResponse", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNIZERESPONSE, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""\ ``StreamingRecognizeResponse`` is the only message - returned to the client by ``StreamingRecognize``. A series of zero or - more ``StreamingRecognizeResponse`` messages are streamed back to the - client. If there is no recognizable audio, and ``single_utterance`` is - set to false, then no messages are streamed back to the client. - - Here's an example of a series of ten ``StreamingRecognizeResponse``\ s - that might be returned while processing audio: - - 1. results { alternatives { transcript: "tube" } stability: 0.01 } - - 2. results { alternatives { transcript: "to be a" } stability: 0.01 } - - 3. results { alternatives { transcript: "to be" } stability: 0.9 } - results { alternatives { transcript: " or not to be" } stability: - 0.01 } - - 4. results { alternatives { transcript: "to be or not to be" confidence: - 0.92 } alternatives { transcript: "to bee or not to bee" } is\_final: - true } - - 5. results { alternatives { transcript: " that's" } stability: 0.01 } - - 6. results { alternatives { transcript: " that is" } stability: 0.9 } - results { alternatives { transcript: " the question" } stability: - 0.01 } - - 7. results { alternatives { transcript: " that is the question" - confidence: 0.98 } alternatives { transcript: " that was the - question" } is\_final: true } - - Notes: - - - Only two of the above responses #4 and #7 contain final results; they - are indicated by ``is_final: true``. Concatenating these together - generates the full transcript: "to be or not to be that is the - question". - - - The others contain interim ``results``. #3 and #6 contain two interim - ``results``: the first portion has a high stability and is less - likely to change; the second portion has a low stability and is very - likely to change. A UI designer might choose to show only high - stability ``results``. - - - The specific ``stability`` and ``confidence`` values shown above are - only for illustrative purposes. Actual values may vary. - - - In each response, only one of these fields will be set: ``error``, - ``speech_event_type``, or one or more (repeated) ``results``. - - - Attributes: - error: - If set, returns a [google.rpc.Status][google.rpc.Status] - message that specifies the error for the operation. - results: - This repeated list contains zero or more results that - correspond to consecutive portions of the audio currently - being processed. It contains zero or one ``is_final=true`` - result (the newly settled portion), followed by zero or more - ``is_final=false`` results (the interim results). - speech_event_type: - Indicates the type of speech event. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognizeResponse) - ), -) -_sym_db.RegisterMessage(StreamingRecognizeResponse) - -StreamingRecognitionResult = _reflection.GeneratedProtocolMessageType( - "StreamingRecognitionResult", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGRECOGNITIONRESULT, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""A streaming speech recognition result corresponding to a - portion of the audio that is currently being processed. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - is_final: - If ``false``, this ``StreamingRecognitionResult`` represents - an interim result that may change. If ``true``, this is the - final time the speech service will return this particular - ``StreamingRecognitionResult``, the recognizer will not return - any further hypotheses for this portion of the transcript and - corresponding audio. - stability: - An estimate of the likelihood that the recognizer will not - change its guess about this interim result. Values range from - 0.0 (completely unstable) to 1.0 (completely stable). This - field is only provided for interim results - (``is_final=false``). The default of 0.0 is a sentinel value - indicating ``stability`` was not set. - result_end_time: - Time offset of the end of this result relative to the - beginning of the audio. - channel_tag: - For multi-channel audio, this is the channel number - corresponding to the recognized result for the audio from that - channel. For audio\_channel\_count = N, its output values can - range from '1' to 'N'. - language_code: - The `BCP-47 `__ - language tag of the language in this result. This language - code was detected to have the most likelihood of being spoken - in the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.StreamingRecognitionResult) - ), -) -_sym_db.RegisterMessage(StreamingRecognitionResult) - -SpeechRecognitionResult = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionResult", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONRESULT, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""A speech recognition result corresponding to a portion of the audio. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - channel_tag: - For multi-channel audio, this is the channel number - corresponding to the recognized result for the audio from that - channel. For audio\_channel\_count = N, its output values can - range from '1' to 'N'. - language_code: - The `BCP-47 `__ - language tag of the language in this result. This language - code was detected to have the most likelihood of being spoken - in the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionResult) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionResult) - -SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionAlternative", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONALTERNATIVE, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Alternative hypotheses (a.k.a. n-best list). - - - Attributes: - transcript: - Transcript text representing the words that the user spoke. - confidence: - The confidence estimate between 0.0 and 1.0. A higher number - indicates an estimated greater likelihood that the recognized - words are correct. This field is set only for the top - alternative of a non-streaming result or, of a streaming - result where ``is_final=true``. This field is not guaranteed - to be accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - words: - A list of word-specific information for each recognized word. - Note: When ``enable_speaker_diarization`` is true, you will - see all the words from the beginning of the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.SpeechRecognitionAlternative) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionAlternative) - -WordInfo = _reflection.GeneratedProtocolMessageType( - "WordInfo", - (_message.Message,), - dict( - DESCRIPTOR=_WORDINFO, - __module__="google.cloud.speech_v1p1beta1.proto.cloud_speech_pb2", - __doc__="""Word-specific information for recognized words. - - - Attributes: - start_time: - Time offset relative to the beginning of the audio, and - corresponding to the start of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - end_time: - Time offset relative to the beginning of the audio, and - corresponding to the end of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - word: - The word corresponding to this set of information. - confidence: - The confidence estimate between 0.0 and 1.0. A higher number - indicates an estimated greater likelihood that the recognized - words are correct. This field is set only for the top - alternative of a non-streaming result or, of a streaming - result where ``is_final=true``. This field is not guaranteed - to be accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - speaker_tag: - A distinct integer value is assigned for every speaker within - the audio. This field specifies which one of those speakers - was detected to have spoken this word. Value ranges from '1' - to diarization\_speaker\_count. speaker\_tag is set if - enable\_speaker\_diarization = 'true' and only in the top - alternative. - """, - # @@protoc_insertion_point(class_scope:google.cloud.speech.v1p1beta1.WordInfo) - ), -) -_sym_db.RegisterMessage(WordInfo) - - -DESCRIPTOR._options = None -_RECOGNIZEREQUEST.fields_by_name["config"]._options = None -_RECOGNIZEREQUEST.fields_by_name["audio"]._options = None -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["config"]._options = None -_LONGRUNNINGRECOGNIZEREQUEST.fields_by_name["audio"]._options = None -_STREAMINGRECOGNITIONCONFIG.fields_by_name["config"]._options = None -_RECOGNITIONCONFIG.fields_by_name["language_code"]._options = None -_RECOGNITIONCONFIG.fields_by_name["enable_speaker_diarization"]._options = None -_RECOGNITIONCONFIG.fields_by_name["diarization_speaker_count"]._options = None -_RECOGNITIONMETADATA.fields_by_name["obfuscated_id"]._options = None - -_SPEECH = _descriptor.ServiceDescriptor( - name="Speech", - full_name="google.cloud.speech.v1p1beta1.Speech", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025speech.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=4626, - serialized_end=5268, - methods=[ - _descriptor.MethodDescriptor( - name="Recognize", - full_name="google.cloud.speech.v1p1beta1.Speech.Recognize", - index=0, - containing_service=None, - input_type=_RECOGNIZEREQUEST, - output_type=_RECOGNIZERESPONSE, - serialized_options=_b( - '\202\323\344\223\002 "\033/v1p1beta1/speech:recognize:\001*\332A\014config,audio' - ), - ), - _descriptor.MethodDescriptor( - name="LongRunningRecognize", - full_name="google.cloud.speech.v1p1beta1.Speech.LongRunningRecognize", - index=1, - containing_service=None, - input_type=_LONGRUNNINGRECOGNIZEREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002+"&/v1p1beta1/speech:longrunningrecognize:\001*\332A\014config,audio\312A<\n\034LongRunningRecognizeResponse\022\034LongRunningRecognizeMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="StreamingRecognize", - full_name="google.cloud.speech.v1p1beta1.Speech.StreamingRecognize", - index=2, - containing_service=None, - input_type=_STREAMINGRECOGNIZEREQUEST, - output_type=_STREAMINGRECOGNIZERESPONSE, - serialized_options=None, - ), - ], -) -_sym_db.RegisterServiceDescriptor(_SPEECH) - -DESCRIPTOR.services_by_name["Speech"] = _SPEECH - -# @@protoc_insertion_point(module_scope) diff --git a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2_grpc.py b/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2_grpc.py deleted file mode 100644 index ba4950fd256e..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2_grpc.py +++ /dev/null @@ -1,93 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.speech_v1p1beta1.proto import ( - cloud_speech_pb2 as google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class SpeechStub(object): - """Service that implements Google Cloud Speech API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.Recognize = channel.unary_unary( - "/google.cloud.speech.v1p1beta1.Speech/Recognize", - request_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.FromString, - ) - self.LongRunningRecognize = channel.unary_unary( - "/google.cloud.speech.v1p1beta1.Speech/LongRunningRecognize", - request_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.StreamingRecognize = channel.stream_stream( - "/google.cloud.speech.v1p1beta1.Speech/StreamingRecognize", - request_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.FromString, - ) - - -class SpeechServicer(object): - """Service that implements Google Cloud Speech API. - """ - - def Recognize(self, request, context): - """Performs synchronous speech recognition: receive results after all audio - has been sent and processed. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def LongRunningRecognize(self, request, context): - """Performs asynchronous speech recognition: receive results via the - google.longrunning.Operations interface. Returns either an - `Operation.error` or an `Operation.response` which contains - a `LongRunningRecognizeResponse` message. - For more information on asynchronous speech recognition, see the - [how-to](https://cloud.google.com/speech-to-text/docs/async-recognize). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def StreamingRecognize(self, request_iterator, context): - """Performs bidirectional streaming speech recognition: receive results while - sending audio. This method is only available via the gRPC API (not REST). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_SpeechServicer_to_server(servicer, server): - rpc_method_handlers = { - "Recognize": grpc.unary_unary_rpc_method_handler( - servicer.Recognize, - request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeRequest.FromString, - response_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.RecognizeResponse.SerializeToString, - ), - "LongRunningRecognize": grpc.unary_unary_rpc_method_handler( - servicer.LongRunningRecognize, - request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.LongRunningRecognizeRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "StreamingRecognize": grpc.stream_stream_rpc_method_handler( - servicer.StreamingRecognize, - request_deserializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeRequest.FromString, - response_serializer=google_dot_cloud_dot_speech__v1p1beta1_dot_proto_dot_cloud__speech__pb2.StreamingRecognizeResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.speech.v1p1beta1.Speech", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/speech/google/cloud/speech_v1p1beta1/types.py b/speech/google/cloud/speech_v1p1beta1/types.py deleted file mode 100644 index 35c7a2c09519..000000000000 --- a/speech/google/cloud/speech_v1p1beta1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [cloud_speech_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.speech_v1p1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/speech/noxfile.py b/speech/noxfile.py deleted file mode 100644 index 9bc787f5ac16..000000000000 --- a/speech/noxfile.py +++ /dev/null @@ -1,180 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python=["3.7"]) -def samples(session): - """Run the sample test suite.""" - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - samples_path = "samples" - if not os.path.exists(samples_path): - session.skip("Samples not found.") - - session.install("pyyaml") - session.install("sample-tester") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - session.run("sample-tester", samples_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/speech/pylint.config.py b/speech/pylint.config.py deleted file mode 100644 index 5d64b9d2f256..000000000000 --- a/speech/pylint.config.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -# Library configuration - -# library_additions = {} -# library_replacements = {} - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/speech/samples/resources/brooklyn_bridge.flac b/speech/samples/resources/brooklyn_bridge.flac deleted file mode 100644 index 0e101a55df77..000000000000 Binary files a/speech/samples/resources/brooklyn_bridge.flac and /dev/null differ diff --git a/speech/samples/resources/brooklyn_bridge.mp3 b/speech/samples/resources/brooklyn_bridge.mp3 deleted file mode 100644 index 97f9955c6f80..000000000000 Binary files a/speech/samples/resources/brooklyn_bridge.mp3 and /dev/null differ diff --git a/speech/samples/resources/brooklyn_bridge.raw b/speech/samples/resources/brooklyn_bridge.raw deleted file mode 100644 index 5ebf79d3c9c5..000000000000 Binary files a/speech/samples/resources/brooklyn_bridge.raw and /dev/null differ diff --git a/speech/samples/resources/brooklyn_bridge.wav b/speech/samples/resources/brooklyn_bridge.wav deleted file mode 100644 index 044086e91411..000000000000 Binary files a/speech/samples/resources/brooklyn_bridge.wav and /dev/null differ diff --git a/speech/samples/resources/commercial_mono.wav b/speech/samples/resources/commercial_mono.wav deleted file mode 100644 index e6b9ed434f9f..000000000000 Binary files a/speech/samples/resources/commercial_mono.wav and /dev/null differ diff --git a/speech/samples/resources/hello.raw b/speech/samples/resources/hello.raw deleted file mode 100644 index b5b46450082a..000000000000 Binary files a/speech/samples/resources/hello.raw and /dev/null differ diff --git a/speech/samples/resources/hello.wav b/speech/samples/resources/hello.wav deleted file mode 100644 index 69b506936a33..000000000000 Binary files a/speech/samples/resources/hello.wav and /dev/null differ diff --git a/speech/samples/resources/multi.flac b/speech/samples/resources/multi.flac deleted file mode 100644 index c550e0f42a14..000000000000 Binary files a/speech/samples/resources/multi.flac and /dev/null differ diff --git a/speech/samples/resources/multi.wav b/speech/samples/resources/multi.wav deleted file mode 100644 index 7f71d74b951a..000000000000 Binary files a/speech/samples/resources/multi.wav and /dev/null differ diff --git a/speech/samples/v1/speech_transcribe_async.py b/speech/samples/v1/speech_transcribe_async.py deleted file mode 100644 index 6e803983e2ec..000000000000 --- a/speech/samples/v1/speech_transcribe_async.py +++ /dev/null @@ -1,90 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("LongRunningPromise", "speech_transcribe_async") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Transcribe Audio File using Long Running Operation (Local File) (LRO) -# description: Transcribe a long audio file using asynchronous speech recognition -# usage: python3 samples/v1/speech_transcribe_async.py [--local_file_path "resources/brooklyn_bridge.raw"] - -# [START speech_transcribe_async] -from google.cloud import speech_v1 -from google.cloud.speech_v1 import enums -import io - - -def sample_long_running_recognize(local_file_path): - """ - Transcribe a long audio file using asynchronous speech recognition - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1.SpeechClient() - - # local_file_path = 'resources/brooklyn_bridge.raw' - - # The language of the supplied audio - language_code = "en-US" - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 16000 - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16 - config = { - "language_code": language_code, - "sample_rate_hertz": sample_rate_hertz, - "encoding": encoding, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - operation = client.long_running_recognize(config, audio) - - print(u"Waiting for operation to complete...") - response = operation.result() - - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_async] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/brooklyn_bridge.raw" - ) - args = parser.parse_args() - - sample_long_running_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_async_gcs.py b/speech/samples/v1/speech_transcribe_async_gcs.py deleted file mode 100644 index 79dd2cf732ca..000000000000 --- a/speech/samples/v1/speech_transcribe_async_gcs.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("LongRunningPromise", "speech_transcribe_async_gcs") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Transcript Audio File using Long Running Operation (Cloud Storage) (LRO) -# description: Transcribe long audio file from Cloud Storage using asynchronous speech -# recognition -# usage: python3 samples/v1/speech_transcribe_async_gcs.py [--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.raw"] - -# [START speech_transcribe_async_gcs] -from google.cloud import speech_v1 -from google.cloud.speech_v1 import enums - - -def sample_long_running_recognize(storage_uri): - """ - Transcribe long audio file from Cloud Storage using asynchronous speech - recognition - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - """ - - client = speech_v1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw' - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 16000 - - # The language of the supplied audio - language_code = "en-US" - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16 - config = { - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - "encoding": encoding, - } - audio = {"uri": storage_uri} - - operation = client.long_running_recognize(config, audio) - - print(u"Waiting for operation to complete...") - response = operation.result() - - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_async_gcs] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", - type=str, - default="gs://cloud-samples-data/speech/brooklyn_bridge.raw", - ) - args = parser.parse_args() - - sample_long_running_recognize(args.storage_uri) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_async_word_time_offsets_gcs.py b/speech/samples/v1/speech_transcribe_async_word_time_offsets_gcs.py deleted file mode 100644 index 2adcb7cb4ca8..000000000000 --- a/speech/samples/v1/speech_transcribe_async_word_time_offsets_gcs.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("LongRunningPromise", "speech_transcribe_async_word_time_offsets_gcs") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Getting word timestamps (Cloud Storage) (LRO) -# description: Print start and end time of each word spoken in audio file from Cloud Storage -# usage: python3 samples/v1/speech_transcribe_async_word_time_offsets_gcs.py [--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.flac"] - -# [START speech_transcribe_async_word_time_offsets_gcs] -from google.cloud import speech_v1 - - -def sample_long_running_recognize(storage_uri): - """ - Print start and end time of each word spoken in audio file from Cloud Storage - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - """ - - client = speech_v1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.flac' - - # When enabled, the first result returned by the API will include a list - # of words and the start and end time offsets (timestamps) for those words. - enable_word_time_offsets = True - - # The language of the supplied audio - language_code = "en-US" - config = { - "enable_word_time_offsets": enable_word_time_offsets, - "language_code": language_code, - } - audio = {"uri": storage_uri} - - operation = client.long_running_recognize(config, audio) - - print(u"Waiting for operation to complete...") - response = operation.result() - - # The first result includes start and end time word offsets - result = response.results[0] - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - # Print the start and end time of each word - for word in alternative.words: - print(u"Word: {}".format(word.word)) - print( - u"Start time: {} seconds {} nanos".format( - word.start_time.seconds, word.start_time.nanos - ) - ) - print( - u"End time: {} seconds {} nanos".format( - word.end_time.seconds, word.end_time.nanos - ) - ) - - -# [END speech_transcribe_async_word_time_offsets_gcs] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", - type=str, - default="gs://cloud-samples-data/speech/brooklyn_bridge.flac", - ) - args = parser.parse_args() - - sample_long_running_recognize(args.storage_uri) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_enhanced_model.py b/speech/samples/v1/speech_transcribe_enhanced_model.py deleted file mode 100644 index 382e413cdfca..000000000000 --- a/speech/samples/v1/speech_transcribe_enhanced_model.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_enhanced_model") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Using Enhanced Models (Local File) -# description: Transcribe a short audio file using an enhanced model -# usage: python3 samples/v1/speech_transcribe_enhanced_model.py [--local_file_path "resources/hello.wav"] - -# [START speech_transcribe_enhanced_model] -from google.cloud import speech_v1 -import io - - -def sample_recognize(local_file_path): - """ - Transcribe a short audio file using an enhanced model - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1.SpeechClient() - - # local_file_path = 'resources/hello.wav' - - # The enhanced model to use, e.g. phone_call - # Currently phone_call is the only model available as an enhanced model. - model = "phone_call" - - # Use an enhanced model for speech recognition (when set to true). - # Project must be eligible for requesting enhanced models. - # Enhanced speech models require that you opt-in to data logging. - use_enhanced = True - - # The language of the supplied audio - language_code = "en-US" - config = { - "model": model, - "use_enhanced": use_enhanced, - "language_code": language_code, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_enhanced_model] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--local_file_path", type=str, default="resources/hello.wav") - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_model_selection.py b/speech/samples/v1/speech_transcribe_model_selection.py deleted file mode 100644 index aed61cfc212c..000000000000 --- a/speech/samples/v1/speech_transcribe_model_selection.py +++ /dev/null @@ -1,77 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_model_selection") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Selecting a Transcription Model (Local File) -# description: Transcribe a short audio file using a specified transcription model -# usage: python3 samples/v1/speech_transcribe_model_selection.py [--local_file_path "resources/hello.wav"] [--model "phone_call"] - -# [START speech_transcribe_model_selection] -from google.cloud import speech_v1 -import io - - -def sample_recognize(local_file_path, model): - """ - Transcribe a short audio file using a specified transcription model - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - model The transcription model to use, e.g. video, phone_call, default - For a list of available transcription models, see: - https://cloud.google.com/speech-to-text/docs/transcription-model#transcription_models - """ - - client = speech_v1.SpeechClient() - - # local_file_path = 'resources/hello.wav' - # model = 'phone_call' - - # The language of the supplied audio - language_code = "en-US" - config = {"model": model, "language_code": language_code} - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_model_selection] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--local_file_path", type=str, default="resources/hello.wav") - parser.add_argument("--model", type=str, default="phone_call") - args = parser.parse_args() - - sample_recognize(args.local_file_path, args.model) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_model_selection_gcs.py b/speech/samples/v1/speech_transcribe_model_selection_gcs.py deleted file mode 100644 index 813132dca081..000000000000 --- a/speech/samples/v1/speech_transcribe_model_selection_gcs.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_model_selection_gcs") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Selecting a Transcription Model (Cloud Storage) -# description: Transcribe a short audio file from Cloud Storage using a specified -# transcription model -# usage: python3 samples/v1/speech_transcribe_model_selection_gcs.py [--storage_uri "gs://cloud-samples-data/speech/hello.wav"] [--model "phone_call"] - -# [START speech_transcribe_model_selection_gcs] -from google.cloud import speech_v1 - - -def sample_recognize(storage_uri, model): - """ - Transcribe a short audio file from Cloud Storage using a specified - transcription model - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - model The transcription model to use, e.g. video, phone_call, default - For a list of available transcription models, see: - https://cloud.google.com/speech-to-text/docs/transcription-model#transcription_models - """ - - client = speech_v1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/hello.wav' - # model = 'phone_call' - - # The language of the supplied audio - language_code = "en-US" - config = {"model": model, "language_code": language_code} - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_model_selection_gcs] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", type=str, default="gs://cloud-samples-data/speech/hello.wav" - ) - parser.add_argument("--model", type=str, default="phone_call") - args = parser.parse_args() - - sample_recognize(args.storage_uri, args.model) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_multichannel.py b/speech/samples/v1/speech_transcribe_multichannel.py deleted file mode 100644 index 688648885adc..000000000000 --- a/speech/samples/v1/speech_transcribe_multichannel.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multichannel") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Multi-Channel Audio Transcription (Local File) -# description: Transcribe a short audio file with multiple channels -# usage: python3 samples/v1/speech_transcribe_multichannel.py [--local_file_path "resources/multi.wav"] - -# [START speech_transcribe_multichannel] -from google.cloud import speech_v1 -import io - - -def sample_recognize(local_file_path): - """ - Transcribe a short audio file with multiple channels - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1.SpeechClient() - - # local_file_path = 'resources/multi.wav' - - # The number of channels in the input audio file (optional) - audio_channel_count = 2 - - # When set to true, each audio channel will be recognized separately. - # The recognition result will contain a channel_tag field to state which - # channel that result belongs to - enable_separate_recognition_per_channel = True - - # The language of the supplied audio - language_code = "en-US" - config = { - "audio_channel_count": audio_channel_count, - "enable_separate_recognition_per_channel": enable_separate_recognition_per_channel, - "language_code": language_code, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # channel_tag to recognize which audio channel this result is for - print(u"Channel tag: {}".format(result.channel_tag)) - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_multichannel] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument("--local_file_path", type=str, default="resources/multi.wav") - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_multichannel_gcs.py b/speech/samples/v1/speech_transcribe_multichannel_gcs.py deleted file mode 100644 index 9285a5e1e2b4..000000000000 --- a/speech/samples/v1/speech_transcribe_multichannel_gcs.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multichannel_gcs") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Multi-Channel Audio Transcription (Cloud Storage) -# description: Transcribe a short audio file from Cloud Storage with multiple channels -# usage: python3 samples/v1/speech_transcribe_multichannel_gcs.py [--storage_uri "gs://cloud-samples-data/speech/multi.wav"] - -# [START speech_transcribe_multichannel_gcs] -from google.cloud import speech_v1 - - -def sample_recognize(storage_uri): - """ - Transcribe a short audio file from Cloud Storage with multiple channels - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - """ - - client = speech_v1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/multi.wav' - - # The number of channels in the input audio file (optional) - audio_channel_count = 2 - - # When set to true, each audio channel will be recognized separately. - # The recognition result will contain a channel_tag field to state which - # channel that result belongs to - enable_separate_recognition_per_channel = True - - # The language of the supplied audio - language_code = "en-US" - config = { - "audio_channel_count": audio_channel_count, - "enable_separate_recognition_per_channel": enable_separate_recognition_per_channel, - "language_code": language_code, - } - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # channel_tag to recognize which audio channel this result is for - print(u"Channel tag: {}".format(result.channel_tag)) - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_multichannel_gcs] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", type=str, default="gs://cloud-samples-data/speech/multi.wav" - ) - args = parser.parse_args() - - sample_recognize(args.storage_uri) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_sync.py b/speech/samples/v1/speech_transcribe_sync.py deleted file mode 100644 index 8ba8f4a96344..000000000000 --- a/speech/samples/v1/speech_transcribe_sync.py +++ /dev/null @@ -1,86 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_sync") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Transcribe Audio File (Local File) -# description: Transcribe a short audio file using synchronous speech recognition -# usage: python3 samples/v1/speech_transcribe_sync.py [--local_file_path "resources/brooklyn_bridge.raw"] - -# [START speech_transcribe_sync] -from google.cloud import speech_v1 -from google.cloud.speech_v1 import enums -import io - - -def sample_recognize(local_file_path): - """ - Transcribe a short audio file using synchronous speech recognition - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1.SpeechClient() - - # local_file_path = 'resources/brooklyn_bridge.raw' - - # The language of the supplied audio - language_code = "en-US" - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 16000 - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16 - config = { - "language_code": language_code, - "sample_rate_hertz": sample_rate_hertz, - "encoding": encoding, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_sync] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/brooklyn_bridge.raw" - ) - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/speech_transcribe_sync_gcs.py b/speech/samples/v1/speech_transcribe_sync_gcs.py deleted file mode 100644 index 5afe26ffcc67..000000000000 --- a/speech/samples/v1/speech_transcribe_sync_gcs.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_sync_gcs") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Transcript Audio File (Cloud Storage) -# description: Transcribe short audio file from Cloud Storage using synchronous speech -# recognition -# usage: python3 samples/v1/speech_transcribe_sync_gcs.py [--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.raw"] - -# [START speech_transcribe_sync_gcs] -from google.cloud import speech_v1 -from google.cloud.speech_v1 import enums - - -def sample_recognize(storage_uri): - """ - Transcribe short audio file from Cloud Storage using synchronous speech - recognition - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - """ - - client = speech_v1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.raw' - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 16000 - - # The language of the supplied audio - language_code = "en-US" - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.LINEAR16 - config = { - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - "encoding": encoding, - } - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_sync_gcs] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", - type=str, - default="gs://cloud-samples-data/speech/brooklyn_bridge.raw", - ) - args = parser.parse_args() - - sample_recognize(args.storage_uri) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1/test/samples.manifest.yaml b/speech/samples/v1/test/samples.manifest.yaml deleted file mode 100644 index f989660c127f..000000000000 --- a/speech/samples/v1/test/samples.manifest.yaml +++ /dev/null @@ -1,38 +0,0 @@ -type: manifest/samples -schema_version: 3 -base: &common - env: 'python' - bin: 'python3' - chdir: '{@manifest_dir}/../..' - basepath: '.' -samples: -- <<: *common - path: '{basepath}/v1/speech_transcribe_async.py' - sample: 'speech_transcribe_async' -- <<: *common - path: '{basepath}/v1/speech_transcribe_async_gcs.py' - sample: 'speech_transcribe_async_gcs' -- <<: *common - path: '{basepath}/v1/speech_transcribe_async_word_time_offsets_gcs.py' - sample: 'speech_transcribe_async_word_time_offsets_gcs' -- <<: *common - path: '{basepath}/v1/speech_transcribe_enhanced_model.py' - sample: 'speech_transcribe_enhanced_model' -- <<: *common - path: '{basepath}/v1/speech_transcribe_model_selection.py' - sample: 'speech_transcribe_model_selection' -- <<: *common - path: '{basepath}/v1/speech_transcribe_model_selection_gcs.py' - sample: 'speech_transcribe_model_selection_gcs' -- <<: *common - path: '{basepath}/v1/speech_transcribe_multichannel.py' - sample: 'speech_transcribe_multichannel' -- <<: *common - path: '{basepath}/v1/speech_transcribe_multichannel_gcs.py' - sample: 'speech_transcribe_multichannel_gcs' -- <<: *common - path: '{basepath}/v1/speech_transcribe_sync.py' - sample: 'speech_transcribe_sync' -- <<: *common - path: '{basepath}/v1/speech_transcribe_sync_gcs.py' - sample: 'speech_transcribe_sync_gcs' diff --git a/speech/samples/v1/test/speech_transcribe_async.test.yaml b/speech/samples/v1/test/speech_transcribe_async.test.yaml deleted file mode 100644 index f26cfbabc537..000000000000 --- a/speech/samples/v1/test/speech_transcribe_async.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcribe Audio File using Long Running Operation (Local File) (LRO) - cases: - - # This sample should default to using brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_async (no arguments) - spec: - - call: - sample: speech_transcribe_async - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_async (--local_file_path) - spec: - - call: - sample: speech_transcribe_async - params: - local_file_path: - literal: "resources/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1/test/speech_transcribe_async_gcs.test.yaml b/speech/samples/v1/test/speech_transcribe_async_gcs.test.yaml deleted file mode 100644 index d3d83133e783..000000000000 --- a/speech/samples/v1/test/speech_transcribe_async_gcs.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcript Audio File using Long Running Operation (Cloud Storage) (LRO) - cases: - - # This sample should default to using gs://cloud-samples-data/brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_async_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_async_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_async_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_async_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml b/speech/samples/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml deleted file mode 100644 index 11784726db74..000000000000 --- a/speech/samples/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml +++ /dev/null @@ -1,37 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Getting word timestamps (Cloud Storage) (LRO) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/brooklyn_bridge.flac - - name: speech_transcribe_async_word_time_offsets_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_async_word_time_offsets_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - literal: "Word: how" - - literal: "Word: old" - - literal: "Word: is" - - literal: "Start time: 0 seconds" - - literal: "End time: 1 seconds" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_async_word_time_offsets_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_async_word_time_offsets_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: how" - - literal: "Word: are" - - literal: "Word: you" - - literal: "Start time: 0 seconds" - - literal: "End time: 1 seconds" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1/test/speech_transcribe_enhanced_model.test.yaml b/speech/samples/v1/test/speech_transcribe_enhanced_model.test.yaml deleted file mode 100644 index 6eab33b52796..000000000000 --- a/speech/samples/v1/test/speech_transcribe_enhanced_model.test.yaml +++ /dev/null @@ -1,29 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Using Enhanced Models (Local File) - cases: - - # This sample should default to using hello.wav - # and the phone_call model (only currently available enhanced model) - # - # Note: if the project used to run these tests isn't eligible for - # enhanced models, you will receive an error. - - name: speech_transcribe_enhanced_model (no arguments) - spec: - - call: - sample: speech_transcribe_enhanced_model - - assert_contains: - - literal: "hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_enhanced_model (--local_file_path) - spec: - - call: - sample: speech_transcribe_enhanced_model - params: - local_file_path: - literal: "resources/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" diff --git a/speech/samples/v1/test/speech_transcribe_model_selection.test.yaml b/speech/samples/v1/test/speech_transcribe_model_selection.test.yaml deleted file mode 100644 index b5ec2d90290d..000000000000 --- a/speech/samples/v1/test/speech_transcribe_model_selection.test.yaml +++ /dev/null @@ -1,52 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Selecting a Transcription Model (Local File) - cases: - - # This sample should default to using hello.wav - # and the phone_call model - - name: speech_transcribe_model_selection (no arguments) - spec: - - call: - sample: speech_transcribe_model_selection - - assert_contains: - - literal: "Hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_model_selection (--local_file_path) - spec: - - call: - sample: speech_transcribe_model_selection - params: - local_file_path: - literal: "resources/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" - - # Confirm that --model can be specified and the sample does not blow up - # - # Note: we are not using example audio files which result in deterministically - # different results when using different models. so we simply test - # that regular transcription continues to work. - - name: speech_transcribe_model_selection (--model) - spec: - - call: - sample: speech_transcribe_model_selection - params: - model: - literal: video - - assert_contains: - - literal: "hello" - - # Confirm that --model is being passed through by providing an invalid model - - name: speech_transcribe_model_selection (invalid --model) - spec: - - call_may_fail: - sample: speech_transcribe_model_selection - params: - model: - literal: I_DONT_EXIST - - assert_contains: - - literal: "Incorrect model specified" diff --git a/speech/samples/v1/test/speech_transcribe_model_selection_gcs.test.yaml b/speech/samples/v1/test/speech_transcribe_model_selection_gcs.test.yaml deleted file mode 100644 index 60c45c975d7b..000000000000 --- a/speech/samples/v1/test/speech_transcribe_model_selection_gcs.test.yaml +++ /dev/null @@ -1,52 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Selecting a Transcription Model (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/hello.wav - # and the phone_call model - - name: speech_transcribe_model_selection_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - - assert_contains: - - literal: "Hello" - - # Confirm that another file can be transcribed (use another .wav file) - - name: speech_transcribe_model_selection_gcs (--local_file_path) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/commercial_mono.wav" - - assert_contains: - - literal: "Chrome" - - # Confirm that --model can be specified and the sample does not blow up - # - # Note: we are not using example audio files which result in deterministically - # different results when using different models. so we simply test - # that regular transcription continues to work. - - name: speech_transcribe_model_selection_gcs (--model) - spec: - - call: - sample: speech_transcribe_model_selection_gcs - params: - model: - literal: video - - assert_contains: - - literal: "hello" - - # Confirm that --model is being passed through by providing an invalid model - - name: speech_transcribe_model_selection_gcs (invalid --model) - spec: - - call_may_fail: - sample: speech_transcribe_model_selection_gcs - params: - model: - literal: I_DONT_EXIST - - assert_contains: - - literal: "Incorrect model specified" diff --git a/speech/samples/v1/test/speech_transcribe_multichannel.test.yaml b/speech/samples/v1/test/speech_transcribe_multichannel.test.yaml deleted file mode 100644 index 9d5379dc99c7..000000000000 --- a/speech/samples/v1/test/speech_transcribe_multichannel.test.yaml +++ /dev/null @@ -1,31 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Multi-Channel Audio Transcription (Local File) - cases: - - # This sample should default to using multi.wav (2 channels) - - name: speech_transcribe_multichannel (no arguments) - spec: - - call: - sample: speech_transcribe_multichannel - - assert_contains: - - literal: "Channel tag: 1" - - literal: "Channel tag: 2" - - literal: "how are you doing" - - # Confirm that another file can be transcribed (use another 2 channel .wav file) - - name: speech_transcribe_multichannel (--local_file_path) - spec: - - call: - sample: speech_transcribe_multichannel - params: - local_file_path: - literal: "resources/brooklyn_bridge.wav" - - assert_contains: - # Only one channel of data is present in brooklyn_bridge.wav - - literal: "Channel tag:" - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "how are you doing" diff --git a/speech/samples/v1/test/speech_transcribe_multichannel_gcs.test.yaml b/speech/samples/v1/test/speech_transcribe_multichannel_gcs.test.yaml deleted file mode 100644 index 64c9340ce0e6..000000000000 --- a/speech/samples/v1/test/speech_transcribe_multichannel_gcs.test.yaml +++ /dev/null @@ -1,32 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Multi-Channel Audio Transcription (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/multi.wav - # with 2 audio channels of data - - name: speech_transcribe_multichannel_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_multichannel_gcs - - assert_contains: - - literal: "Channel tag: 1" - - literal: "Channel tag: 2" - - literal: "how are you doing" - - # Confirm that another file can be transcribed (use another 2 channel .wav file) - - name: speech_transcribe_multichannel_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_multichannel_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/brooklyn_bridge.wav" - - assert_contains: - # Only one channel of data is present in brooklyn_bridge.wav - - literal: "Channel tag:" - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "how are you doing" diff --git a/speech/samples/v1/test/speech_transcribe_sync.test.yaml b/speech/samples/v1/test/speech_transcribe_sync.test.yaml deleted file mode 100644 index 47cc8c1a48e1..000000000000 --- a/speech/samples/v1/test/speech_transcribe_sync.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcribe Audio File (Local File) - cases: - - # This sample should default to using brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_sync (no arguments) - spec: - - call: - sample: speech_transcribe_sync - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_sync (--local_file_path) - spec: - - call: - sample: speech_transcribe_sync - params: - local_file_path: - literal: "resources/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1/test/speech_transcribe_sync_gcs.test.yaml b/speech/samples/v1/test/speech_transcribe_sync_gcs.test.yaml deleted file mode 100644 index 3defdf28930a..000000000000 --- a/speech/samples/v1/test/speech_transcribe_sync_gcs.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Transcript Audio File (Cloud Storage) - cases: - - # This sample should default to using gs://cloud-samples-data/speech/brooklyn_bridge.raw - # with explicitly configured sample_rate_hertz and encoding - - name: speech_transcribe_sync_gcs (no arguments) - spec: - - call: - sample: speech_transcribe_sync_gcs - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - # Confirm that another file can be transcribed (use another .raw PCM file) - - name: speech_transcribe_sync_gcs (--storage_uri) - spec: - - call: - sample: speech_transcribe_sync_gcs - params: - storage_uri: - literal: "gs://cloud-samples-data/speech/hello.raw" - - assert_contains: - - literal: "hello" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1p1beta1/speech_adaptation_beta.py b/speech/samples/v1p1beta1/speech_adaptation_beta.py deleted file mode 100644 index 364bddf279e2..000000000000 --- a/speech/samples/v1p1beta1/speech_adaptation_beta.py +++ /dev/null @@ -1,100 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_adaptation_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Speech Adaptation (Cloud Storage) -# description: Transcribe a short audio file with speech adaptation. -# usage: python3 samples/v1p1beta1/speech_adaptation_beta.py [--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"] [--phrase "Brooklyn Bridge"] - -# [START speech_adaptation_beta] -from google.cloud import speech_v1p1beta1 -from google.cloud.speech_v1p1beta1 import enums - - -def sample_recognize(storage_uri, phrase): - """ - Transcribe a short audio file with speech adaptation. - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - phrase Phrase "hints" help recognize the specified phrases from your audio. - """ - - client = speech_v1p1beta1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.mp3' - # phrase = 'Brooklyn Bridge' - phrases = [phrase] - - # Hint Boost. This value increases the probability that a specific - # phrase will be recognized over other similar sounding phrases. - # The higher the boost, the higher the chance of false positive - # recognition as well. Can accept wide range of positive values. - # Most use cases are best served with values between 0 and 20. - # Using a binary search happroach may help you find the optimal value. - boost = 20.0 - speech_contexts_element = {"phrases": phrases, "boost": boost} - speech_contexts = [speech_contexts_element] - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 44100 - - # The language of the supplied audio - language_code = "en-US" - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.MP3 - config = { - "speech_contexts": speech_contexts, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - "encoding": encoding, - } - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_adaptation_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", - type=str, - default="gs://cloud-samples-data/speech/brooklyn_bridge.mp3", - ) - parser.add_argument("--phrase", type=str, default="Brooklyn Bridge") - args = parser.parse_args() - - sample_recognize(args.storage_uri, args.phrase) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_contexts_classes_beta.py b/speech/samples/v1p1beta1/speech_contexts_classes_beta.py deleted file mode 100644 index 04632d80efa1..000000000000 --- a/speech/samples/v1p1beta1/speech_contexts_classes_beta.py +++ /dev/null @@ -1,93 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_contexts_classes_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Using Context Classes (Cloud Storage) -# description: Transcribe a short audio file with static context classes. -# usage: python3 samples/v1p1beta1/speech_contexts_classes_beta.py [--storage_uri "gs://cloud-samples-data/speech/time.mp3"] [--phrase "$TIME"] - -# [START speech_contexts_classes_beta] -from google.cloud import speech_v1p1beta1 -from google.cloud.speech_v1p1beta1 import enums - - -def sample_recognize(storage_uri, phrase): - """ - Transcribe a short audio file with static context classes. - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - phrase Phrase "hints" help recognize the specified phrases from your audio. - In this sample we are using a static class phrase ($TIME). - Classes represent groups of words that represent common concepts - that occur in natural language. - """ - - client = speech_v1p1beta1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/time.mp3' - # phrase = '$TIME' - phrases = [phrase] - speech_contexts_element = {"phrases": phrases} - speech_contexts = [speech_contexts_element] - - # The language of the supplied audio - language_code = "en-US" - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 24000 - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.MP3 - config = { - "speech_contexts": speech_contexts, - "language_code": language_code, - "sample_rate_hertz": sample_rate_hertz, - "encoding": encoding, - } - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_contexts_classes_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", type=str, default="gs://cloud-samples-data/speech/time.mp3" - ) - parser.add_argument("--phrase", type=str, default="$TIME") - args = parser.parse_args() - - sample_recognize(args.storage_uri, args.phrase) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_quickstart_beta.py b/speech/samples/v1p1beta1/speech_quickstart_beta.py deleted file mode 100644 index 76b13a5ecb4f..000000000000 --- a/speech/samples/v1p1beta1/speech_quickstart_beta.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_quickstart_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Quickstart Beta -# description: Performs synchronous speech recognition on an audio file -# usage: python3 samples/v1p1beta1/speech_quickstart_beta.py [--storage_uri "gs://cloud-samples-data/speech/brooklyn_bridge.mp3"] - -# [START speech_quickstart_beta] -from google.cloud import speech_v1p1beta1 -from google.cloud.speech_v1p1beta1 import enums - - -def sample_recognize(storage_uri): - """ - Performs synchronous speech recognition on an audio file - - Args: - storage_uri URI for audio file in Cloud Storage, e.g. gs://[BUCKET]/[FILE] - """ - - client = speech_v1p1beta1.SpeechClient() - - # storage_uri = 'gs://cloud-samples-data/speech/brooklyn_bridge.mp3' - - # The language of the supplied audio - language_code = "en-US" - - # Sample rate in Hertz of the audio data sent - sample_rate_hertz = 44100 - - # Encoding of audio data sent. This sample sets this explicitly. - # This field is optional for FLAC and WAV audio formats. - encoding = enums.RecognitionConfig.AudioEncoding.MP3 - config = { - "language_code": language_code, - "sample_rate_hertz": sample_rate_hertz, - "encoding": encoding, - } - audio = {"uri": storage_uri} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_quickstart_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--storage_uri", - type=str, - default="gs://cloud-samples-data/speech/brooklyn_bridge.mp3", - ) - args = parser.parse_args() - - sample_recognize(args.storage_uri) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_transcribe_auto_punctuation_beta.py b/speech/samples/v1p1beta1/speech_transcribe_auto_punctuation_beta.py deleted file mode 100644 index b012d42a42fe..000000000000 --- a/speech/samples/v1p1beta1/speech_transcribe_auto_punctuation_beta.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_auto_punctuation_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Getting punctuation in results (Local File) (Beta) -# description: Transcribe a short audio file with punctuation -# usage: python3 samples/v1p1beta1/speech_transcribe_auto_punctuation_beta.py [--local_file_path "resources/commercial_mono.wav"] - -# [START speech_transcribe_auto_punctuation_beta] -from google.cloud import speech_v1p1beta1 -import io - - -def sample_recognize(local_file_path): - """ - Transcribe a short audio file with punctuation - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1p1beta1.SpeechClient() - - # local_file_path = 'resources/commercial_mono.wav' - - # When enabled, trascription results may include punctuation - # (available for select languages). - enable_automatic_punctuation = True - - # The language of the supplied audio. Even though additional languages are - # provided by alternative_language_codes, a primary language is still required. - language_code = "en-US" - config = { - "enable_automatic_punctuation": enable_automatic_punctuation, - "language_code": language_code, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_auto_punctuation_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/commercial_mono.wav" - ) - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_transcribe_diarization_beta.py b/speech/samples/v1p1beta1/speech_transcribe_diarization_beta.py deleted file mode 100644 index bdc8e3e1ac15..000000000000 --- a/speech/samples/v1p1beta1/speech_transcribe_diarization_beta.py +++ /dev/null @@ -1,97 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("LongRunningPromise", "speech_transcribe_diarization_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Separating different speakers (Local File) (LRO) (Beta) -# description: Print confidence level for individual words in a transcription of a short audio -# file -# Separating different speakers in an audio file recording -# usage: python3 samples/v1p1beta1/speech_transcribe_diarization_beta.py [--local_file_path "resources/commercial_mono.wav"] - -# [START speech_transcribe_diarization_beta] -from google.cloud import speech_v1p1beta1 -import io - - -def sample_long_running_recognize(local_file_path): - """ - Print confidence level for individual words in a transcription of a short audio - file - Separating different speakers in an audio file recording - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1p1beta1.SpeechClient() - - # local_file_path = 'resources/commercial_mono.wav' - - # If enabled, each word in the first alternative of each result will be - # tagged with a speaker tag to identify the speaker. - enable_speaker_diarization = True - - # Optional. Specifies the estimated number of speakers in the conversation. - diarization_speaker_count = 2 - - # The language of the supplied audio - language_code = "en-US" - config = { - "enable_speaker_diarization": enable_speaker_diarization, - "diarization_speaker_count": diarization_speaker_count, - "language_code": language_code, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - operation = client.long_running_recognize(config, audio) - - print(u"Waiting for operation to complete...") - response = operation.result() - - for result in response.results: - # First alternative has words tagged with speakers - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - # Print the speaker_tag of each word - for word in alternative.words: - print(u"Word: {}".format(word.word)) - print(u"Speaker tag: {}".format(word.speaker_tag)) - - -# [END speech_transcribe_diarization_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/commercial_mono.wav" - ) - args = parser.parse_args() - - sample_long_running_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_transcribe_multilanguage_beta.py b/speech/samples/v1p1beta1/speech_transcribe_multilanguage_beta.py deleted file mode 100644 index dde461fdc71c..000000000000 --- a/speech/samples/v1p1beta1/speech_transcribe_multilanguage_beta.py +++ /dev/null @@ -1,91 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_multilanguage_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Detecting language spoken automatically (Local File) (Beta) -# description: Transcribe a short audio file with language detected from a list of possible -# languages -# usage: python3 samples/v1p1beta1/speech_transcribe_multilanguage_beta.py [--local_file_path "resources/brooklyn_bridge.flac"] - -# [START speech_transcribe_multilanguage_beta] -from google.cloud import speech_v1p1beta1 -import io - - -def sample_recognize(local_file_path): - """ - Transcribe a short audio file with language detected from a list of possible - languages - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1p1beta1.SpeechClient() - - # local_file_path = 'resources/brooklyn_bridge.flac' - - # The language of the supplied audio. Even though additional languages are - # provided by alternative_language_codes, a primary language is still required. - language_code = "fr" - - # Specify up to 3 additional languages as possible alternative languages - # of the supplied audio. - alternative_language_codes_element = "es" - alternative_language_codes_element_2 = "en" - alternative_language_codes = [ - alternative_language_codes_element, - alternative_language_codes_element_2, - ] - config = { - "language_code": language_code, - "alternative_language_codes": alternative_language_codes, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # The language_code which was detected as the most likely being spoken in the audio - print(u"Detected language: {}".format(result.language_code)) - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_multilanguage_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/brooklyn_bridge.flac" - ) - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_transcribe_recognition_metadata_beta.py b/speech/samples/v1p1beta1/speech_transcribe_recognition_metadata_beta.py deleted file mode 100644 index c11feb881d37..000000000000 --- a/speech/samples/v1p1beta1/speech_transcribe_recognition_metadata_beta.py +++ /dev/null @@ -1,92 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_recognition_metadata_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Adding recognition metadata (Local File) (Beta) -# description: Adds additional details short audio file included in this recognition request -# usage: python3 samples/v1p1beta1/speech_transcribe_recognition_metadata_beta.py [--local_file_path "resources/commercial_mono.wav"] - -# [START speech_transcribe_recognition_metadata_beta] -from google.cloud import speech_v1p1beta1 -from google.cloud.speech_v1p1beta1 import enums -import io - - -def sample_recognize(local_file_path): - """ - Adds additional details short audio file included in this recognition request - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1p1beta1.SpeechClient() - - # local_file_path = 'resources/commercial_mono.wav' - - # The use case of the audio, e.g. PHONE_CALL, DISCUSSION, PRESENTATION, et al. - interaction_type = enums.RecognitionMetadata.InteractionType.VOICE_SEARCH - - # The kind of device used to capture the audio - recording_device_type = enums.RecognitionMetadata.RecordingDeviceType.SMARTPHONE - - # The device used to make the recording. - # Arbitrary string, e.g. 'Pixel XL', 'VoIP', 'Cardioid Microphone', or other - # value. - recording_device_name = "Pixel 3" - metadata = { - "interaction_type": interaction_type, - "recording_device_type": recording_device_type, - "recording_device_name": recording_device_name, - } - - # The language of the supplied audio. Even though additional languages are - # provided by alternative_language_codes, a primary language is still required. - language_code = "en-US" - config = {"metadata": metadata, "language_code": language_code} - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - for result in response.results: - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - - -# [END speech_transcribe_recognition_metadata_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/commercial_mono.wav" - ) - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py b/speech/samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py deleted file mode 100644 index 321f964adc1f..000000000000 --- a/speech/samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py +++ /dev/null @@ -1,88 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -# DO NOT EDIT! This is a generated sample ("Request", "speech_transcribe_word_level_confidence_beta") - -# To install the latest published package dependency, execute the following: -# pip install google-cloud-speech - -# sample-metadata -# title: Enabling word-level confidence (Local File) (Beta) -# description: Print confidence level for individual words in a transcription of a short audio -# file. -# usage: python3 samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py [--local_file_path "resources/brooklyn_bridge.flac"] - -# [START speech_transcribe_word_level_confidence_beta] -from google.cloud import speech_v1p1beta1 -import io - - -def sample_recognize(local_file_path): - """ - Print confidence level for individual words in a transcription of a short audio - file. - - Args: - local_file_path Path to local audio file, e.g. /path/audio.wav - """ - - client = speech_v1p1beta1.SpeechClient() - - # local_file_path = 'resources/brooklyn_bridge.flac' - - # When enabled, the first result returned by the API will include a list - # of words and the confidence level for each of those words. - enable_word_confidence = True - - # The language of the supplied audio - language_code = "en-US" - config = { - "enable_word_confidence": enable_word_confidence, - "language_code": language_code, - } - with io.open(local_file_path, "rb") as f: - content = f.read() - audio = {"content": content} - - response = client.recognize(config, audio) - # The first result includes confidence levels per word - result = response.results[0] - # First alternative is the most probable result - alternative = result.alternatives[0] - print(u"Transcript: {}".format(alternative.transcript)) - # Print the confidence level of each word - for word in alternative.words: - print(u"Word: {}".format(word.word)) - print(u"Confidence: {}".format(word.confidence)) - - -# [END speech_transcribe_word_level_confidence_beta] - - -def main(): - import argparse - - parser = argparse.ArgumentParser() - parser.add_argument( - "--local_file_path", type=str, default="resources/brooklyn_bridge.flac" - ) - args = parser.parse_args() - - sample_recognize(args.local_file_path) - - -if __name__ == "__main__": - main() diff --git a/speech/samples/v1p1beta1/test/samples.manifest.yaml b/speech/samples/v1p1beta1/test/samples.manifest.yaml deleted file mode 100644 index 787e335e7aa4..000000000000 --- a/speech/samples/v1p1beta1/test/samples.manifest.yaml +++ /dev/null @@ -1,32 +0,0 @@ -type: manifest/samples -schema_version: 3 -base: &common - env: 'python' - bin: 'python3' - chdir: '{@manifest_dir}/../..' - basepath: '.' -samples: -- <<: *common - path: '{basepath}/v1p1beta1/speech_adaptation_beta.py' - sample: 'speech_adaptation_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_contexts_classes_beta.py' - sample: 'speech_contexts_classes_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_quickstart_beta.py' - sample: 'speech_quickstart_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_transcribe_auto_punctuation_beta.py' - sample: 'speech_transcribe_auto_punctuation_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_transcribe_diarization_beta.py' - sample: 'speech_transcribe_diarization_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_transcribe_multilanguage_beta.py' - sample: 'speech_transcribe_multilanguage_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_transcribe_recognition_metadata_beta.py' - sample: 'speech_transcribe_recognition_metadata_beta' -- <<: *common - path: '{basepath}/v1p1beta1/speech_transcribe_word_level_confidence_beta.py' - sample: 'speech_transcribe_word_level_confidence_beta' diff --git a/speech/samples/v1p1beta1/test/speech_adaptation_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_adaptation_beta.test.yaml deleted file mode 100644 index 4efe8e83fc32..000000000000 --- a/speech/samples/v1p1beta1/test/speech_adaptation_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Speech Adaptation - cases: - - name: speech_adaptation_beta - spec: - - call: {sample: speech_adaptation_beta} - - assert_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1p1beta1/test/speech_contexts_classes_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_contexts_classes_beta.test.yaml deleted file mode 100644 index b6dccfc71ff6..000000000000 --- a/speech/samples/v1p1beta1/test/speech_contexts_classes_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Speech Contexts Static Classes - cases: - - name: speech_contexts_classes_beta - spec: - - call: {sample: speech_contexts_classes_beta} - - assert_contains: - - literal: "the time is 5:45 p.m." diff --git a/speech/samples/v1p1beta1/test/speech_quickstart_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_quickstart_beta.test.yaml deleted file mode 100644 index bd5bf6700a82..000000000000 --- a/speech/samples/v1p1beta1/test/speech_quickstart_beta.test.yaml +++ /dev/null @@ -1,11 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Speech-to-Text Sample Tests For Quickstart - cases: - - name: speech_quickstart_beta - spec: - - call: {sample: speech_quickstart_beta} - - assert_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml deleted file mode 100644 index 1ab5f79a0f47..000000000000 --- a/speech/samples/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml +++ /dev/null @@ -1,28 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Getting punctuation in results (Local File) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_auto_punctuation_beta (no arguments) - spec: - - call: - sample: speech_transcribe_auto_punctuation_beta - - assert_contains: - # Simply assert that actual punctuation is present from commercial_mono.wav - - literal: "?" - - literal: "," - - literal: "" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_auto_punctuation_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_auto_punctuation_beta - params: - local_file_path: - literal: "resources/brooklyn_bridge.flac" - - assert_contains: - - literal: "How old is the Brooklyn Bridge?" diff --git a/speech/samples/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml deleted file mode 100644 index 409e4b54b66f..000000000000 --- a/speech/samples/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml +++ /dev/null @@ -1,40 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Separating different speakers (Local File) (LRO) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_diarization_beta (no arguments) - spec: - - call: - sample: speech_transcribe_diarization_beta - - assert_contains: - - literal: "Word: Chrome" - # The identifier given to each speaker is non-deterministic. - # For two speakers, it can be 0 and 1, 0 and 2, or other variations. - # - # The example audio file has two speakers, but this test is - # not verifying that greater than one speaker is detected. - - literal: "Speaker tag:" - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_diarization_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_diarization_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: doing" - # The identifier given to each speaker is non-deterministic. - # For two speakers, it can be 0 and 1, 0 and 2, or other variations. - # - # The example audio file has two speakers, but this test is - # not verifying that greater than one speaker is detected. - - literal: "Speaker tag:" - - assert_not_contains: - - literal: "Chrome" diff --git a/speech/samples/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml deleted file mode 100644 index d9f2d71093cd..000000000000 --- a/speech/samples/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml +++ /dev/null @@ -1,33 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Detecting language spoken automatically (Local File) (Beta) - cases: - - # This sample should default to using brooklyn_bridge.flac - - name: speech_transcribe_multilanguage_beta (no arguments) - spec: - - call: - sample: speech_transcribe_multilanguage_beta - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - # Note: the primary language_code given was not English, but - # English was provided in the list of alternative_language_codes - - literal: "Detected language: en-us" - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_multilanguage_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_multilanguage_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - # Note: the primary language_code given was not English, but - # English was provided in the list of alternative_language_codes - - literal: "Detected language: en-us" - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/samples/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml deleted file mode 100644 index 57cf24a1d261..000000000000 --- a/speech/samples/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml +++ /dev/null @@ -1,27 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Adding recognition metadata (Local File) (Beta) - cases: - - # This sample should default to using commercial_mono.wav - - name: speech_transcribe_recognition_metadata_beta (no arguments) - spec: - - call: - sample: speech_transcribe_recognition_metadata_beta - - assert_contains: - - literal: "Chrome" - - # Confirm that another file can be transcribed (use another file) - - name: speech_transcribe_recognition_metadata_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_recognition_metadata_beta - params: - local_file_path: - literal: "resources/brooklyn_bridge.flac" - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - assert_not_contains: - - literal: "Chrome" diff --git a/speech/samples/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml b/speech/samples/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml deleted file mode 100644 index 0d7d60570a01..000000000000 --- a/speech/samples/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml +++ /dev/null @@ -1,35 +0,0 @@ -type: test/samples -schema_version: 1 -test: - suites: - - name: Enabling word-level confidence (Local File) (Beta) - cases: - - # This sample should default to using brooklyn_bridge.flac - - name: speech_transcribe_word_level_confidence_beta (no arguments) - spec: - - call: - sample: speech_transcribe_word_level_confidence_beta - - assert_contains: - - literal: "how old is the Brooklyn Bridge" - - literal: "Word: how" - - literal: "Word: old" - - literal: "Word: is" - - literal: "Confidence: 0." - - # Confirm that another file can be transcribed (use another .flac file) - - name: speech_transcribe_word_level_confidence_beta (--local_file_path) - spec: - - call: - sample: speech_transcribe_word_level_confidence_beta - params: - local_file_path: - literal: "resources/multi.flac" - - assert_contains: - - literal: "how are you doing" - - literal: "Word: how" - - literal: "Word: are" - - literal: "Word: you" - - literal: "Confidence: 0." - - assert_not_contains: - - literal: "how old is the Brooklyn Bridge" diff --git a/speech/setup.cfg b/speech/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/speech/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/speech/setup.py b/speech/setup.py deleted file mode 100644 index 47294157307b..000000000000 --- a/speech/setup.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-speech" -description = "Google Cloud Speech API client library" -version = "1.3.1" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 5 - Production/Stable" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/speech/synth.metadata b/speech/synth.metadata deleted file mode 100644 index 200cab54ff6c..000000000000 --- a/speech/synth.metadata +++ /dev/null @@ -1,361 +0,0 @@ -{ - "updateTime": "2020-01-30T13:38:36.062840Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "speech", - "apiVersion": "v1p1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/speech/artman_speech_v1p1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "speech", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/speech/artman_speech_v1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v1p1beta1/api.rst" - }, - { - "path": "docs/gapic/v1p1beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/speech.py" - }, - { - "path": "google/cloud/speech_v1/__init__.py" - }, - { - "path": "google/cloud/speech_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/speech_v1/gapic/enums.py" - }, - { - "path": "google/cloud/speech_v1/gapic/speech_client.py" - }, - { - "path": "google/cloud/speech_v1/gapic/speech_client_config.py" - }, - { - "path": "google/cloud/speech_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/speech_v1/gapic/transports/speech_grpc_transport.py" - }, - { - "path": "google/cloud/speech_v1/helpers.py" - }, - { - "path": "google/cloud/speech_v1/proto/__init__.py" - }, - { - "path": "google/cloud/speech_v1/proto/cloud_speech.proto" - }, - { - "path": "google/cloud/speech_v1/proto/cloud_speech_pb2.py" - }, - { - "path": "google/cloud/speech_v1/proto/cloud_speech_pb2_grpc.py" - }, - { - "path": "google/cloud/speech_v1/types.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/__init__.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/speech_client.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/speech_client_config.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/gapic/transports/speech_grpc_transport.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/proto/cloud_speech.proto" - }, - { - "path": "google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/proto/cloud_speech_pb2_grpc.py" - }, - { - "path": "google/cloud/speech_v1p1beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "pylint.config.py" - }, - { - "path": "samples/resources/brooklyn_bridge.flac" - }, - { - "path": "samples/resources/brooklyn_bridge.mp3" - }, - { - "path": "samples/resources/brooklyn_bridge.raw" - }, - { - "path": "samples/resources/brooklyn_bridge.wav" - }, - { - "path": "samples/resources/commercial_mono.wav" - }, - { - "path": "samples/resources/hello.raw" - }, - { - "path": "samples/resources/hello.wav" - }, - { - "path": "samples/resources/multi.flac" - }, - { - "path": "samples/resources/multi.wav" - }, - { - "path": "samples/v1/speech_transcribe_async.py" - }, - { - "path": "samples/v1/speech_transcribe_async_gcs.py" - }, - { - "path": "samples/v1/speech_transcribe_async_word_time_offsets_gcs.py" - }, - { - "path": "samples/v1/speech_transcribe_enhanced_model.py" - }, - { - "path": "samples/v1/speech_transcribe_model_selection.py" - }, - { - "path": "samples/v1/speech_transcribe_model_selection_gcs.py" - }, - { - "path": "samples/v1/speech_transcribe_multichannel.py" - }, - { - "path": "samples/v1/speech_transcribe_multichannel_gcs.py" - }, - { - "path": "samples/v1/speech_transcribe_sync.py" - }, - { - "path": "samples/v1/speech_transcribe_sync_gcs.py" - }, - { - "path": "samples/v1/test/samples.manifest.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_async.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_async_gcs.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_async_word_time_offsets_gcs.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_enhanced_model.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_model_selection.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_model_selection_gcs.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_multichannel.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_multichannel_gcs.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_sync.test.yaml" - }, - { - "path": "samples/v1/test/speech_transcribe_sync_gcs.test.yaml" - }, - { - "path": "samples/v1p1beta1/speech_adaptation_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_contexts_classes_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_quickstart_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_transcribe_auto_punctuation_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_transcribe_diarization_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_transcribe_multilanguage_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_transcribe_recognition_metadata_beta.py" - }, - { - "path": "samples/v1p1beta1/speech_transcribe_word_level_confidence_beta.py" - }, - { - "path": "samples/v1p1beta1/test/samples.manifest.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_adaptation_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_contexts_classes_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_quickstart_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_transcribe_auto_punctuation_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_transcribe_diarization_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_transcribe_multilanguage_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_transcribe_recognition_metadata_beta.test.yaml" - }, - { - "path": "samples/v1p1beta1/test/speech_transcribe_word_level_confidence_beta.test.yaml" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/system/gapic/v1/test_system_speech_v1.py" - }, - { - "path": "tests/system/gapic/v1p1beta1/test_system_speech_v1p1beta1.py" - }, - { - "path": "tests/unit/gapic/v1/test_speech_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1p1beta1/test_speech_client_v1p1beta1.py" - }, - { - "path": "tests/unit/test_helpers.py" - } - ] -} \ No newline at end of file diff --git a/speech/synth.py b/speech/synth.py deleted file mode 100644 index c812ed261ef2..000000000000 --- a/speech/synth.py +++ /dev/null @@ -1,66 +0,0 @@ -# Copyright 2019 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import re - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1p1beta1", "v1"] - - -# ---------------------------------------------------------------------------- -# Generate speech GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library( - "speech", - version, - include_protos=True, - include_samples=True - ) - - # Don't move over __init__.py, as we modify it to make the generated client - # use helpers.py. - s.move(library / f"google/cloud/speech_{version}/types.py") - s.move(library / f"google/cloud/speech_{version}/gapic") - s.move(library / f"google/cloud/speech_{version}/proto") - s.move(library / f"tests/unit/gapic/{version}") - s.move(library / f"docs/gapic/{version}") - s.move(library / f"samples") - - -# Use the highest version library to generate documentation import alias. -s.move(library / "google/cloud/speech.py") - - -# Fix tests to use the direct gapic client instead of the wrapped helper -# client. -s.replace( - "tests/unit/**/test*client*.py", - r"from google\.cloud import speech_(.+?)$", - r"from google.cloud.speech_\1.gapic import speech_client as speech_\1", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files, excludes=["noxfile.py"]) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/speech/tests/system/gapic/v1/test_system_speech_v1.py b/speech/tests/system/gapic/v1/test_system_speech_v1.py deleted file mode 100644 index 1c30e3fac6b9..000000000000 --- a/speech/tests/system/gapic/v1/test_system_speech_v1.py +++ /dev/null @@ -1,94 +0,0 @@ -# Copyright 2018 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. - -import os -import io -import requests - -from google.cloud import speech_v1 - - -class TestSystemSpeech(object): - def test_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1.SpeechClient() - - config = { - "encoding": speech_v1.enums.RecognitionConfig.AudioEncoding.FLAC, - "language_code": "en-US", - "sample_rate_hertz": 16000, - } - - uri = "gs://{}/speech/brooklyn.flac".format(BUCKET) - audio = {"uri": uri} - - response = client.recognize(config, audio) - - assert response.results[0].alternatives[0].transcript is not None - - def test_long_running_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1.SpeechClient() - - config = speech_v1.types.RecognitionConfig( - encoding=speech_v1.enums.RecognitionConfig.AudioEncoding.FLAC, - language_code="en-US", - sample_rate_hertz=16000, - ) - - uri = "gs://{}/speech/brooklyn.flac".format(BUCKET) - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - - assert response.result() is not None - - def test_streaming_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1.SpeechClient() - - config = speech_v1.types.RecognitionConfig( - encoding=speech_v1.enums.RecognitionConfig.AudioEncoding.FLAC, - language_code="en-US", - sample_rate_hertz=16000, - ) - streamingConfig = speech_v1.types.StreamingRecognitionConfig(config=config) - - uri = "https://storage.googleapis.com/{}/speech/brooklyn.flac".format(BUCKET) - streaming_requests = [ - speech_v1.types.StreamingRecognizeRequest( - audio_content=requests.get(uri).content - ) - ] - - responses = client.streaming_recognize(streamingConfig, streaming_requests) - - for response in responses: - for result in response.results: - assert result.alternatives[0].transcript is not None diff --git a/speech/tests/system/gapic/v1p1beta1/test_system_speech_v1p1beta1.py b/speech/tests/system/gapic/v1p1beta1/test_system_speech_v1p1beta1.py deleted file mode 100644 index 36514089d364..000000000000 --- a/speech/tests/system/gapic/v1p1beta1/test_system_speech_v1p1beta1.py +++ /dev/null @@ -1,96 +0,0 @@ -# Copyright 2018 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. - -import os -import io -import requests - -from google.cloud import speech_v1p1beta1 - - -class TestSystemSpeech(object): - def test_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1p1beta1.SpeechClient() - - config = { - "encoding": speech_v1p1beta1.enums.RecognitionConfig.AudioEncoding.FLAC, - "language_code": "en-US", - "sample_rate_hertz": 16000, - } - - uri = "gs://{}/speech/brooklyn.flac".format(BUCKET) - audio = {"uri": uri} - - response = client.recognize(config, audio) - - assert response.results[0].alternatives[0].transcript is not None - - def test_long_running_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1p1beta1.SpeechClient() - - config = speech_v1p1beta1.types.RecognitionConfig( - encoding=speech_v1p1beta1.enums.RecognitionConfig.AudioEncoding.FLAC, - language_code="en-US", - sample_rate_hertz=16000, - ) - - uri = "gs://{}/speech/brooklyn.flac".format(BUCKET) - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - - assert response.result() is not None - - def test_streaming_recognize(self): - - try: - BUCKET = os.environ["GOOGLE_CLOUD_TESTS_SPEECH_BUCKET"] - except KeyError: - BUCKET = "cloud-samples-tests" - - client = speech_v1p1beta1.SpeechClient() - - config = speech_v1p1beta1.types.RecognitionConfig( - encoding=speech_v1p1beta1.enums.RecognitionConfig.AudioEncoding.FLAC, - language_code="en-US", - sample_rate_hertz=16000, - ) - streamingConfig = speech_v1p1beta1.types.StreamingRecognitionConfig( - config=config - ) - - uri = "https://storage.googleapis.com/{}/speech/brooklyn.flac".format(BUCKET) - streaming_requests = [ - speech_v1p1beta1.types.StreamingRecognizeRequest( - audio_content=requests.get(uri).content - ) - ] - - responses = client.streaming_recognize(streamingConfig, streaming_requests) - - for response in responses: - for result in response.results: - assert result.alternatives[0].transcript is not None diff --git a/speech/tests/unit/gapic/v1/test_speech_client_v1.py b/speech/tests/unit/gapic/v1/test_speech_client_v1.py deleted file mode 100644 index 29e0e0295a50..000000000000 --- a/speech/tests/unit/gapic/v1/test_speech_client_v1.py +++ /dev/null @@ -1,244 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud.speech_v1.gapic import speech_client as speech_v1 -from google.cloud.speech_v1 import enums -from google.cloud.speech_v1.proto import cloud_speech_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - def stream_stream( - self, method, request_serializer=None, response_deserializer=None - ): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestSpeechClient(object): - def test_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.RecognizeResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.recognize(config, audio) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_speech_pb2.RecognizeRequest(config=config, audio=audio) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_recognize_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - with pytest.raises(CustomException): - client.recognize(config, audio) - - def test_long_running_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.LongRunningRecognizeResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_long_running_recognize", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_speech_pb2.LongRunningRecognizeRequest( - config=config, audio=audio - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_long_running_recognize_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_long_running_recognize_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - exception = response.exception() - assert exception.errors[0] == error - - def test_streaming_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.StreamingRecognizeResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup Request - request = {} - request = cloud_speech_pb2.StreamingRecognizeRequest(**request) - requests = [request] - - response = client.streaming_recognize(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] - - assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request - - def test_streaming_recognize_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1.SpeechClient() - - # Setup request - request = {} - - request = cloud_speech_pb2.StreamingRecognizeRequest(**request) - requests = [request] - - with pytest.raises(CustomException): - client.streaming_recognize(requests) diff --git a/speech/tests/unit/gapic/v1p1beta1/test_speech_client_v1p1beta1.py b/speech/tests/unit/gapic/v1p1beta1/test_speech_client_v1p1beta1.py deleted file mode 100644 index c4588b529eab..000000000000 --- a/speech/tests/unit/gapic/v1p1beta1/test_speech_client_v1p1beta1.py +++ /dev/null @@ -1,244 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud.speech_v1p1beta1.gapic import speech_client as speech_v1p1beta1 -from google.cloud.speech_v1p1beta1 import enums -from google.cloud.speech_v1p1beta1.proto import cloud_speech_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - def stream_stream( - self, method, request_serializer=None, response_deserializer=None - ): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestSpeechClient(object): - def test_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.RecognizeResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.recognize(config, audio) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = cloud_speech_pb2.RecognizeRequest(config=config, audio=audio) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_recognize_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - with pytest.raises(CustomException): - client.recognize(config, audio) - - def test_long_running_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.LongRunningRecognizeResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_long_running_recognize", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = cloud_speech_pb2.LongRunningRecognizeRequest( - config=config, audio=audio - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_long_running_recognize_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_long_running_recognize_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup Request - encoding = enums.RecognitionConfig.AudioEncoding.FLAC - sample_rate_hertz = 44100 - language_code = "en-US" - config = { - "encoding": encoding, - "sample_rate_hertz": sample_rate_hertz, - "language_code": language_code, - } - uri = "gs://bucket_name/file_name.flac" - audio = {"uri": uri} - - response = client.long_running_recognize(config, audio) - exception = response.exception() - assert exception.errors[0] == error - - def test_streaming_recognize(self): - # Setup Expected Response - expected_response = {} - expected_response = cloud_speech_pb2.StreamingRecognizeResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup Request - request = {} - request = cloud_speech_pb2.StreamingRecognizeRequest(**request) - requests = [request] - - response = client.streaming_recognize(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] - - assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request - - def test_streaming_recognize_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = speech_v1p1beta1.SpeechClient() - - # Setup request - request = {} - - request = cloud_speech_pb2.StreamingRecognizeRequest(**request) - requests = [request] - - with pytest.raises(CustomException): - client.streaming_recognize(requests) diff --git a/speech/tests/unit/test_helpers.py b/speech/tests/unit/test_helpers.py deleted file mode 100644 index 366b1821dd4c..000000000000 --- a/speech/tests/unit/test_helpers.py +++ /dev/null @@ -1,53 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import -from types import GeneratorType - -import mock - -import google.auth.credentials -from google.cloud.speech_v1 import SpeechClient -from google.cloud.speech_v1 import types - - -def make_speech_client(): - credentials = mock.Mock(spec=google.auth.credentials.Credentials) - return SpeechClient(credentials=credentials) - - -def test_streaming_recognize(): - client = make_speech_client() - - config = types.StreamingRecognitionConfig() - requests = [types.StreamingRecognizeRequest(audio_content=b"...")] - super_patch = mock.patch( - "google.cloud.speech_v1.speech_client.SpeechClient." "streaming_recognize", - autospec=True, - ) - - with super_patch as streaming_recognize: - client.streaming_recognize(config, requests) - - # Assert that we called streaming recognize with an iterable - # that evaluates to the correct format. - _, args, kwargs = streaming_recognize.mock_calls[0] - api_requests = args[1] - assert isinstance(api_requests, GeneratorType) - assert list(api_requests) == [ - types.StreamingRecognizeRequest(streaming_config=config), - requests[0], - ] - assert "retry" in kwargs - assert "timeout" in kwargs diff --git a/talent/.coveragerc b/talent/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/talent/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/talent/.flake8 b/talent/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/talent/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/talent/.repo-metadata.json b/talent/.repo-metadata.json deleted file mode 100644 index 3e9db085248a..000000000000 --- a/talent/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "talent", - "name_pretty": "Google Cloud Talent Solution", - "product_documentation": "https://cloud.google.com/solutions/talent-solution/", - "client_documentation": "https://googleapis.dev/python/talent/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559664", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-talent", - "api_id": "jobs.googleapis.com", - "requires_billing": true -} diff --git a/talent/CHANGELOG.md b/talent/CHANGELOG.md deleted file mode 100644 index 411e49618df9..000000000000 --- a/talent/CHANGELOG.md +++ /dev/null @@ -1,85 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-talent/#history - -## 0.4.0 - -10-04-2019 14:29 PDT - -### Implementation Changes -- Move `BatchOperationMetadata` / `JobOperationResult` messages to new protobuf files (via synth). ([#9129](https://github.com/googleapis/google-cloud-python/pull/9129)) -- Import batch proto (via synth). ([#9062](https://github.com/googleapis/google-cloud-python/pull/9062)) -- Remove send / receive message size limit (via synth). ([#8970](https://github.com/googleapis/google-cloud-python/pull/8970)) - -### New Features -- Deprecate `candidate_availability_filter` for `availability_filters`, add `AvailabilitySignalType`, add fields to `update_profile` (via synth). ([#9256](https://github.com/googleapis/google-cloud-python/pull/9256)) -- Add `applications` / `assignments` fields to `Profile` message (via synth). ([#9229](https://github.com/googleapis/google-cloud-python/pull/9229)) -- Add `filter_` arg to `ProfileServiceClient.list_profiles`; docstring updates (via synth). ([#9223](https://github.com/googleapis/google-cloud-python/pull/9223)) -- Deprecate job visibility (via synth). ([#9050](https://github.com/googleapis/google-cloud-python/pull/9050)) -- Document additional fields allowed in profile update mask (via synth). ([#9000](https://github.com/googleapis/google-cloud-python/pull/9000)) - -### Documentation -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) -- Update docstrings (via synth). ([#8986](https://github.com/googleapis/google-cloud-python/pull/8986)) - -### Internal / Testing Changes -- Fix intersphinx reference to requests. ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for api_core refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.3.0 - -07-24-2019 17:36 PDT - - -### Implementation Changes -- Return iterable of `SummarizedProfile` from `search_profiles` rather than`HistogramQueryResult` (via synth). ([#7962](https://github.com/googleapis/google-cloud-python/pull/7962)) - -### New Features -- Add strict keywords search, increase timeout (via synth). ([#8712](https://github.com/googleapis/google-cloud-python/pull/8712)) -- Add path-construction helpers to GAPIC clients (via synth). ([#8632](https://github.com/googleapis/google-cloud-python/pull/8632)) -- Add 'result_set_id' param to 'ProfileSearchClient.search_profiles'; add 'ProfileQuery.candidate_availability_filter'; pin 'black' version; dostring tweaks (via synth). ([#8597](https://github.com/googleapis/google-cloud-python/pull/8597)) -- Add 'client_options' support, update list method docstrings (via synth). ([#8523](https://github.com/googleapis/google-cloud-python/pull/8523)) -- Add 'batch_create_jobs' and 'batch_update_jobs' (via synth). ([#8189](https://github.com/googleapis/google-cloud-python/pull/8189)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Allow kwargs to be passed to create_channel (via synth). ([#8405](https://github.com/googleapis/google-cloud-python/pull/8405)) -- Declare encoding as utf-8 in pb2 files (via synth).([#8365](https://github.com/googleapis/google-cloud-python/pull/8365)) -- Add disclaimer to auto-generated template files (via synth). ([#8329](https://github.com/googleapis/google-cloud-python/pull/8329)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8253](https://github.com/googleapis/google-cloud-python/pull/8253)) -- Fix coverage in 'types.py' (via synth). ([#8165](https://github.com/googleapis/google-cloud-python/pull/8165)) -- Blacken noxfile.py, setup.py (via synth).([#8133](https://github.com/googleapis/google-cloud-python/pull/8133)) -- Add empty lines (via synth). ([#8073](https://github.com/googleapis/google-cloud-python/pull/8073)) - -## 0.2.0 - -05-09-2019 12:25 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Regenerate talent (via synth). ([#7861](https://github.com/googleapis/google-cloud-python/pull/7861)) - -### Documentation -- Fixed broken talent client library documentation link ([#7546](https://github.com/googleapis/google-cloud-python/pull/7546)) -- Fix link in docstring.([#7508](https://github.com/googleapis/google-cloud-python/pull/7508)) -- Documentation and formatting changes. ([#7489](https://github.com/googleapis/google-cloud-python/pull/7489)) - -## 0.1.0 - -03-05-2019 12:50 PST - -- Initial release of google-cloud-talent - diff --git a/talent/LICENSE b/talent/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/talent/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/talent/MANIFEST.in b/talent/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/talent/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/talent/README.rst b/talent/README.rst deleted file mode 100644 index 1fc163b9c295..000000000000 --- a/talent/README.rst +++ /dev/null @@ -1,78 +0,0 @@ -Python Client for Cloud Talent Solution API (`Alpha`_) -====================================================== - - - -`Cloud Talent Solution API`_: Cloud Talent Solution provides the capability to create, read, update, and -delete job postings, as well as search jobs based on keywords and filters. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. _Alpha: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst -.. _Cloud Talent Solution API: https://cloud.google.com/jobs -.. _Client Library Documentation: https://googleapis.dev/python/talent/latest -.. _Product Documentation: https://cloud.google.com/jobs - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Cloud Talent Solution API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Cloud Talent Solution API.: https://cloud.google.com/jobs -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-talent - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-talent - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Cloud Talent Solution API - API to see other available methods on the client. -- Read the `Cloud Talent Solution API Product documentation`_ to learn - more about the product and see How-to Guides. -- View this `repository’s main README`_ to see the full list of Cloud - APIs that we cover. - -.. _Cloud Talent Solution API Product documentation: https://cloud.google.com/jobs -.. _repository’s main README: https://github.com/GoogleCloudPlatform/google-cloud-python/blob/master/README.rst diff --git a/talent/docs/README.rst b/talent/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/talent/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/talent/docs/_static/custom.css b/talent/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/talent/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/talent/docs/_templates/layout.html b/talent/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/talent/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/talent/docs/changelog.md b/talent/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/talent/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/talent/docs/conf.py b/talent/docs/conf.py deleted file mode 100644 index 5c82549ece71..000000000000 --- a/talent/docs/conf.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-talent documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-talent" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-talent-doc" - -# -- Options for warnings ------------------------------------------------------ - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-talent.tex", - u"google-cloud-talent Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-talent", - u"google-cloud-talent Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-talent", - u"google-cloud-talent Documentation", - author, - "google-cloud-talent", - "GAPIC library for the {metadata.shortName} service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/stable/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/talent/docs/gapic/v4beta1/api.rst b/talent/docs/gapic/v4beta1/api.rst deleted file mode 100644 index 7c2b844e8ae9..000000000000 --- a/talent/docs/gapic/v4beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Talent Solution API -==================================== - -.. automodule:: google.cloud.talent_v4beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/talent/docs/gapic/v4beta1/types.rst b/talent/docs/gapic/v4beta1/types.rst deleted file mode 100644 index af0bf0f2ad21..000000000000 --- a/talent/docs/gapic/v4beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Talent Solution API Client -========================================== - -.. automodule:: google.cloud.talent_v4beta1.types - :members: \ No newline at end of file diff --git a/talent/docs/index.rst b/talent/docs/index.rst deleted file mode 100644 index 46d6f0fc4cfc..000000000000 --- a/talent/docs/index.rst +++ /dev/null @@ -1,20 +0,0 @@ -.. include:: README.rst - -Api Reference -------------- -.. toctree:: - :maxdepth: 2 - - gapic/v4beta1/api - gapic/v4beta1/types - changelog - -Changelog ---------- - -For a list of all previous `google-cloud-talent` releases. - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/talent/google/__init__.py b/talent/google/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/talent/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/talent/google/cloud/__init__.py b/talent/google/cloud/__init__.py deleted file mode 100644 index 9a1b64a6d586..000000000000 --- a/talent/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/talent/google/cloud/talent.py b/talent/google/cloud/talent.py deleted file mode 100644 index 431f7eb5ffbb..000000000000 --- a/talent/google/cloud/talent.py +++ /dev/null @@ -1,41 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.talent_v4beta1 import ApplicationServiceClient -from google.cloud.talent_v4beta1 import CompanyServiceClient -from google.cloud.talent_v4beta1 import CompletionClient -from google.cloud.talent_v4beta1 import EventServiceClient -from google.cloud.talent_v4beta1 import JobServiceClient -from google.cloud.talent_v4beta1 import ProfileServiceClient -from google.cloud.talent_v4beta1 import TenantServiceClient -from google.cloud.talent_v4beta1 import enums -from google.cloud.talent_v4beta1 import types - - -__all__ = ( - "enums", - "types", - "ApplicationServiceClient", - "CompanyServiceClient", - "CompletionClient", - "EventServiceClient", - "JobServiceClient", - "ProfileServiceClient", - "TenantServiceClient", -) diff --git a/talent/google/cloud/talent_v4beta1/__init__.py b/talent/google/cloud/talent_v4beta1/__init__.py deleted file mode 100644 index b29a60a224fa..000000000000 --- a/talent/google/cloud/talent_v4beta1/__init__.py +++ /dev/null @@ -1,87 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.talent_v4beta1 import types -from google.cloud.talent_v4beta1.gapic import application_service_client -from google.cloud.talent_v4beta1.gapic import company_service_client -from google.cloud.talent_v4beta1.gapic import completion_client -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic import event_service_client -from google.cloud.talent_v4beta1.gapic import job_service_client -from google.cloud.talent_v4beta1.gapic import profile_service_client -from google.cloud.talent_v4beta1.gapic import tenant_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class ApplicationServiceClient(application_service_client.ApplicationServiceClient): - __doc__ = application_service_client.ApplicationServiceClient.__doc__ - enums = enums - - -class CompanyServiceClient(company_service_client.CompanyServiceClient): - __doc__ = company_service_client.CompanyServiceClient.__doc__ - enums = enums - - -class CompletionClient(completion_client.CompletionClient): - __doc__ = completion_client.CompletionClient.__doc__ - enums = enums - - -class EventServiceClient(event_service_client.EventServiceClient): - __doc__ = event_service_client.EventServiceClient.__doc__ - enums = enums - - -class JobServiceClient(job_service_client.JobServiceClient): - __doc__ = job_service_client.JobServiceClient.__doc__ - enums = enums - - -class ProfileServiceClient(profile_service_client.ProfileServiceClient): - __doc__ = profile_service_client.ProfileServiceClient.__doc__ - enums = enums - - -class TenantServiceClient(tenant_service_client.TenantServiceClient): - __doc__ = tenant_service_client.TenantServiceClient.__doc__ - enums = enums - - -__all__ = ( - "enums", - "types", - "ApplicationServiceClient", - "CompanyServiceClient", - "CompletionClient", - "EventServiceClient", - "JobServiceClient", - "ProfileServiceClient", - "TenantServiceClient", -) diff --git a/talent/google/cloud/talent_v4beta1/gapic/__init__.py b/talent/google/cloud/talent_v4beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/talent/google/cloud/talent_v4beta1/gapic/application_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/application_service_client.py deleted file mode 100644 index af31abd495bc..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/application_service_client.py +++ /dev/null @@ -1,635 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 ApplicationService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import application_service_client_config -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic.transports import ( - application_service_grpc_transport, -) -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class ApplicationServiceClient(object): - """ - A service that handles application management, including CRUD and - enumeration. - """ - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.ApplicationService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ApplicationServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def application_path(cls, project, tenant, profile, application): - """Return a fully-qualified application string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}", - project=project, - tenant=tenant, - profile=profile, - application=application, - ) - - @classmethod - def profile_path(cls, project, tenant, profile): - """Return a fully-qualified profile string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/profiles/{profile}", - project=project, - tenant=tenant, - profile=profile, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ApplicationServiceGrpcTransport, - Callable[[~.Credentials, type], ~.ApplicationServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = application_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=application_service_grpc_transport.ApplicationServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = application_service_grpc_transport.ApplicationServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_application( - self, - parent, - application, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new application entity. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ApplicationServiceClient() - >>> - >>> parent = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]') - >>> - >>> # TODO: Initialize `application`: - >>> application = {} - >>> - >>> response = client.create_application(parent, application) - - Args: - parent (str): Required. Resource name of the profile under which the application is - created. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}". - For example, "projects/foo/tenants/bar/profiles/baz". - application (Union[dict, ~google.cloud.talent_v4beta1.types.Application]): Required. The application to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Application` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Application` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_application" not in self._inner_api_calls: - self._inner_api_calls[ - "create_application" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_application, - default_retry=self._method_configs["CreateApplication"].retry, - default_timeout=self._method_configs["CreateApplication"].timeout, - client_info=self._client_info, - ) - - request = application_service_pb2.CreateApplicationRequest( - parent=parent, application=application - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_application"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_application( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves specified application. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ApplicationServiceClient() - >>> - >>> name = client.application_path('[PROJECT]', '[TENANT]', '[PROFILE]', '[APPLICATION]') - >>> - >>> response = client.get_application(name) - - Args: - name (str): Required. The resource name of the application to be retrieved. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}/applications/{application\_id}". - For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Application` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_application" not in self._inner_api_calls: - self._inner_api_calls[ - "get_application" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_application, - default_retry=self._method_configs["GetApplication"].retry, - default_timeout=self._method_configs["GetApplication"].timeout, - client_info=self._client_info, - ) - - request = application_service_pb2.GetApplicationRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_application"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_application( - self, - application, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates specified application. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ApplicationServiceClient() - >>> - >>> # TODO: Initialize `application`: - >>> application = {} - >>> - >>> response = client.update_application(application) - - Args: - application (Union[dict, ~google.cloud.talent_v4beta1.types.Application]): Required. The application resource to replace the current resource in the system. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Application` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): Strongly recommended for the best service experience. - - If ``update_mask`` is provided, only the specified fields in - ``application`` are updated. Otherwise all the fields are updated. - - A field mask to specify the application fields to be updated. Only top - level fields of ``Application`` are supported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Application` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_application" not in self._inner_api_calls: - self._inner_api_calls[ - "update_application" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_application, - default_retry=self._method_configs["UpdateApplication"].retry, - default_timeout=self._method_configs["UpdateApplication"].timeout, - client_info=self._client_info, - ) - - request = application_service_pb2.UpdateApplicationRequest( - application=application, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("application.name", application.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_application"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_application( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes specified application. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ApplicationServiceClient() - >>> - >>> name = client.application_path('[PROJECT]', '[TENANT]', '[PROFILE]', '[APPLICATION]') - >>> - >>> client.delete_application(name) - - Args: - name (str): Required. The resource name of the application to be deleted. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}/applications/{application\_id}". - For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_application" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_application" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_application, - default_retry=self._method_configs["DeleteApplication"].retry, - default_timeout=self._method_configs["DeleteApplication"].timeout, - client_info=self._client_info, - ) - - request = application_service_pb2.DeleteApplicationRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_application"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_applications( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all applications associated with the profile. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ApplicationServiceClient() - >>> - >>> parent = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]') - >>> - >>> # Iterate over all results - >>> for element in client.list_applications(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_applications(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Resource name of the profile under which the application is - created. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}", - for example, "projects/foo/tenants/bar/profiles/baz". - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.Application` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_applications" not in self._inner_api_calls: - self._inner_api_calls[ - "list_applications" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_applications, - default_retry=self._method_configs["ListApplications"].retry, - default_timeout=self._method_configs["ListApplications"].timeout, - client_info=self._client_info, - ) - - request = application_service_pb2.ListApplicationsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_applications"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="applications", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/talent/google/cloud/talent_v4beta1/gapic/application_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/application_service_client_config.py deleted file mode 100644 index 5e9fe442ded7..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/application_service_client_config.py +++ /dev/null @@ -1,48 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.ApplicationService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateApplication": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetApplication": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateApplication": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteApplication": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListApplications": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py deleted file mode 100644 index e689ab4af774..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/company_service_client.py +++ /dev/null @@ -1,659 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 CompanyService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import company_service_client_config -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic.transports import company_service_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class CompanyServiceClient(object): - """A service that handles company management, including CRUD and enumeration.""" - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.CompanyService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - CompanyServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def company_path(cls, project, tenant, company): - """Return a fully-qualified company string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/companies/{company}", - project=project, - tenant=tenant, - company=company, - ) - - @classmethod - def company_without_tenant_path(cls, project, company): - """Return a fully-qualified company_without_tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/companies/{company}", project=project, company=company - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.CompanyServiceGrpcTransport, - Callable[[~.Credentials, type], ~.CompanyServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = company_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=company_service_grpc_transport.CompanyServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = company_service_grpc_transport.CompanyServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_company( - self, - parent, - company, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new company entity. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompanyServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `company`: - >>> company = {} - >>> - >>> response = client.create_company(parent, company) - - Args: - parent (str): Required. Resource name of the tenant under which the company is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created, for example, "projects/foo". - company (Union[dict, ~google.cloud.talent_v4beta1.types.Company]): Required. The company to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Company` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Company` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_company" not in self._inner_api_calls: - self._inner_api_calls[ - "create_company" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_company, - default_retry=self._method_configs["CreateCompany"].retry, - default_timeout=self._method_configs["CreateCompany"].timeout, - client_info=self._client_info, - ) - - request = company_service_pb2.CreateCompanyRequest( - parent=parent, company=company - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_company"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_company( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves specified company. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompanyServiceClient() - >>> - >>> name = client.company_path('[PROJECT]', '[TENANT]', '[COMPANY]') - >>> - >>> response = client.get_company(name) - - Args: - name (str): Required. The resource name of the company to be retrieved. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}", - for example, "projects/api-test-project/tenants/foo/companies/bar". - - If tenant id is unspecified, the default tenant is used, for example, - "projects/api-test-project/companies/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Company` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_company" not in self._inner_api_calls: - self._inner_api_calls[ - "get_company" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_company, - default_retry=self._method_configs["GetCompany"].retry, - default_timeout=self._method_configs["GetCompany"].timeout, - client_info=self._client_info, - ) - - request = company_service_pb2.GetCompanyRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_company"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_company( - self, - company, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates specified company. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompanyServiceClient() - >>> - >>> # TODO: Initialize `company`: - >>> company = {} - >>> - >>> response = client.update_company(company) - - Args: - company (Union[dict, ~google.cloud.talent_v4beta1.types.Company]): Required. The company resource to replace the current resource in the system. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Company` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): Strongly recommended for the best service experience. - - If ``update_mask`` is provided, only the specified fields in ``company`` - are updated. Otherwise all the fields are updated. - - A field mask to specify the company fields to be updated. Only top level - fields of ``Company`` are supported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Company` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_company" not in self._inner_api_calls: - self._inner_api_calls[ - "update_company" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_company, - default_retry=self._method_configs["UpdateCompany"].retry, - default_timeout=self._method_configs["UpdateCompany"].timeout, - client_info=self._client_info, - ) - - request = company_service_pb2.UpdateCompanyRequest( - company=company, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("company.name", company.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_company"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_company( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes specified company. - Prerequisite: The company has no jobs associated with it. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompanyServiceClient() - >>> - >>> name = client.company_path('[PROJECT]', '[TENANT]', '[COMPANY]') - >>> - >>> client.delete_company(name) - - Args: - name (str): Required. The resource name of the company to be deleted. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}", - for example, "projects/foo/tenants/bar/companies/baz". - - If tenant id is unspecified, the default tenant is used, for example, - "projects/foo/companies/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_company" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_company" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_company, - default_retry=self._method_configs["DeleteCompany"].retry, - default_timeout=self._method_configs["DeleteCompany"].timeout, - client_info=self._client_info, - ) - - request = company_service_pb2.DeleteCompanyRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_company"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_companies( - self, - parent, - page_size=None, - require_open_jobs=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all companies associated with the project. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompanyServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_companies(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_companies(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Resource name of the tenant under which the company is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenant/bar". - - If tenant id is unspecified, the default tenant will be used, for - example, "projects/foo". - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - require_open_jobs (bool): Set to true if the companies requested must have open jobs. - - Defaults to false. - - If true, at most ``page_size`` of companies are fetched, among which - only those with open jobs are returned. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.Company` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_companies" not in self._inner_api_calls: - self._inner_api_calls[ - "list_companies" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_companies, - default_retry=self._method_configs["ListCompanies"].retry, - default_timeout=self._method_configs["ListCompanies"].timeout, - client_info=self._client_info, - ) - - request = company_service_pb2.ListCompaniesRequest( - parent=parent, page_size=page_size, require_open_jobs=require_open_jobs - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_companies"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="companies", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/talent/google/cloud/talent_v4beta1/gapic/company_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/company_service_client_config.py deleted file mode 100644 index 85d50994e108..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/company_service_client_config.py +++ /dev/null @@ -1,48 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.CompanyService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateCompany": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetCompany": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateCompany": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteCompany": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListCompanies": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/completion_client.py b/talent/google/cloud/talent_v4beta1/gapic/completion_client.py deleted file mode 100644 index f12b82494b99..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/completion_client.py +++ /dev/null @@ -1,339 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 Completion API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import completion_client_config -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic.transports import completion_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class CompletionClient(object): - """A service handles auto completion.""" - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.Completion" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - CompletionClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def company_path(cls, project, tenant, company): - """Return a fully-qualified company string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/companies/{company}", - project=project, - tenant=tenant, - company=company, - ) - - @classmethod - def company_without_tenant_path(cls, project, company): - """Return a fully-qualified company_without_tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/companies/{company}", project=project, company=company - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.CompletionGrpcTransport, - Callable[[~.Credentials, type], ~.CompletionGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = completion_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=completion_grpc_transport.CompletionGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = completion_grpc_transport.CompletionGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def complete_query( - self, - parent, - query, - page_size, - language_codes=None, - company=None, - scope=None, - type_=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Completes the specified prefix with keyword suggestions. - Intended for use by a job search auto-complete search box. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.CompletionClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `query`: - >>> query = '' - >>> - >>> # TODO: Initialize `page_size`: - >>> page_size = 0 - >>> - >>> response = client.complete_query(parent, query, page_size) - - Args: - parent (str): Required. Resource name of tenant the completion is performed within. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenant/bar". - - If tenant id is unspecified, the default tenant is used, for example, - "projects/foo". - query (str): Required. The query used to generate suggestions. - - The maximum number of allowed characters is 255. - page_size (int): Required. Completion result count. - - The maximum allowed page size is 10. - language_codes (list[str]): The list of languages of the query. This is the BCP-47 language code, - such as "en-US" or "sr-Latn". For more information, see `Tags for - Identifying Languages `__. - - The maximum number of allowed characters is 255. - company (str): If provided, restricts completion to specified company. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id}", - for example, "projects/foo/tenants/bar/companies/baz". - - If tenant id is unspecified, the default tenant is used, for example, - "projects/foo". - scope (~google.cloud.talent_v4beta1.types.CompletionScope): The scope of the completion. The defaults is ``CompletionScope.PUBLIC``. - type_ (~google.cloud.talent_v4beta1.types.CompletionType): The completion topic. The default is ``CompletionType.COMBINED``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.CompleteQueryResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "complete_query" not in self._inner_api_calls: - self._inner_api_calls[ - "complete_query" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.complete_query, - default_retry=self._method_configs["CompleteQuery"].retry, - default_timeout=self._method_configs["CompleteQuery"].timeout, - client_info=self._client_info, - ) - - request = completion_service_pb2.CompleteQueryRequest( - parent=parent, - query=query, - page_size=page_size, - language_codes=language_codes, - company=company, - scope=scope, - type=type_, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["complete_query"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/talent/google/cloud/talent_v4beta1/gapic/completion_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/completion_client_config.py deleted file mode 100644 index fb888690e028..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/completion_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.Completion": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CompleteQuery": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/enums.py b/talent/google/cloud/talent_v4beta1/gapic/enums.py deleted file mode 100644 index 2b850837ae8b..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/enums.py +++ /dev/null @@ -1,1153 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class AvailabilitySignalType(enum.IntEnum): - """ - The type of candidate availability signal. - - Attributes: - AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED (int): Default value. - JOB_APPLICATION (int): Job application signal. - - In the context of ``Profile.availability_signals``, this signal is - related to the candidate's most recent application. ``last_update_time`` - is calculated from max(\ ``Application.create_time``) from all - ``Application`` records where ``Application.source`` is any of the - following: ``APPLY_DIRECT_WEB`` ``APPLY_DIRECT_MOBILE_WEB`` - ``APPLY_DIRECT_MOBILE_APP`` ``APPLY_DIRECT_IN_PERSON`` - ``APPLY_INDIRECT`` - - In the context of ``AvailabilityFilter``, the filter is applied on - ``Profile.availability_signals`` where ``type`` is JOB\_APPLICATION. - RESUME_UPDATE (int): Resume update signal. - - In the context of ``Profile.availability_signals``, this signal is - related to the candidate's most recent update to their resume. For a - ``SummarizedProfile.summary``, ``last_update_time`` is calculated from - max(\ ``Profile.resume_update_time``) from all - ``SummarizedProfile.profiles``. - - In the context of ``AvailabilityFilter``, the filter is applied on - ``Profile.availability_signals`` where ``type`` is RESUME\_UPDATE. - CANDIDATE_UPDATE (int): Candidate update signal. - - In the context of ``Profile.availability_signals``, this signal is - related to the candidate's most recent update to their profile. For a - ``SummarizedProfile.summary``, ``last_update_time`` is calculated from - max(\ ``Profile.candidate_update_time``) from all - ``SummarizedProfile.profiles``. - - In the context of ``AvailabilityFilter``, the filter is applied on - ``Profile.availability_signals`` where ``type`` is CANDIDATE\_UPDATE. - CLIENT_SUBMISSION (int): Client submission signal. - - In the context of ``Profile.availability_signals``, this signal is - related to the candidate's most recent submission. ``last_update_time`` - is calculated from max(\ ``Application.create_time``) from all - ``Application`` records where ``Application.stage`` is any of the - following: ``HIRING_MANAGER_REVIEW`` ``INTERVIEW`` ``OFFER_EXTENDED`` - ``OFFER_ACCEPTED`` ``STARTED`` - - In the context of ``AvailabilityFilter``, the filter is applied on - ``Profile.availability_signals`` where ``type`` is CLIENT\_SUBMISSION. - """ - - AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED = 0 - JOB_APPLICATION = 1 - RESUME_UPDATE = 2 - CANDIDATE_UPDATE = 3 - CLIENT_SUBMISSION = 4 - - -class CommuteMethod(enum.IntEnum): - """ - Method for commute. - - Attributes: - COMMUTE_METHOD_UNSPECIFIED (int): Commute method isn't specified. - DRIVING (int): Commute time is calculated based on driving time. - TRANSIT (int): Commute time is calculated based on public transit including bus, metro, - subway, and so on. - WALKING (int): Commute time is calculated based on walking time. - CYCLING (int): Commute time is calculated based on biking time. - """ - - COMMUTE_METHOD_UNSPECIFIED = 0 - DRIVING = 1 - TRANSIT = 2 - WALKING = 3 - CYCLING = 4 - - -class CompanySize(enum.IntEnum): - """ - An enum that represents the size of the company. - - Attributes: - COMPANY_SIZE_UNSPECIFIED (int): Default value if the size isn't specified. - MINI (int): The company has less than 50 employees. - SMALL (int): The company has between 50 and 99 employees. - SMEDIUM (int): The company has between 100 and 499 employees. - MEDIUM (int): The company has between 500 and 999 employees. - BIG (int): The company has between 1,000 and 4,999 employees. - BIGGER (int): The company has between 5,000 and 9,999 employees. - GIANT (int): The company has 10,000 or more employees. - """ - - COMPANY_SIZE_UNSPECIFIED = 0 - MINI = 1 - SMALL = 2 - SMEDIUM = 3 - MEDIUM = 4 - BIG = 5 - BIGGER = 6 - GIANT = 7 - - -class ContactInfoUsage(enum.IntEnum): - """ - Enum that represents the usage of the contact information. - - Attributes: - CONTACT_INFO_USAGE_UNSPECIFIED (int): Default value. - PERSONAL (int): Personal use. - WORK (int): Work use. - SCHOOL (int): School use. - """ - - CONTACT_INFO_USAGE_UNSPECIFIED = 0 - PERSONAL = 1 - WORK = 2 - SCHOOL = 3 - - -class DegreeType(enum.IntEnum): - """ - Educational degree level defined in International Standard Classification - of Education (ISCED). - - Attributes: - DEGREE_TYPE_UNSPECIFIED (int): Default value. Represents no degree, or early childhood education. - Maps to ISCED code 0. - Ex) Kindergarten - PRIMARY_EDUCATION (int): Primary education which is typically the first stage of compulsory - education. ISCED code 1. - Ex) Elementary school - LOWER_SECONDARY_EDUCATION (int): Lower secondary education; First stage of secondary education building on - primary education, typically with a more subject-oriented curriculum. - ISCED code 2. - Ex) Middle school - UPPER_SECONDARY_EDUCATION (int): Middle education; Second/final stage of secondary education preparing for - tertiary education and/or providing skills relevant to employment. - Usually with an increased range of subject options and streams. ISCED - code 3. - Ex) High school - ADULT_REMEDIAL_EDUCATION (int): Adult Remedial Education; Programmes providing learning experiences that - build on secondary education and prepare for labour market entry and/or - tertiary education. The content is broader than secondary but not as - complex as tertiary education. ISCED code 4. - ASSOCIATES_OR_EQUIVALENT (int): Associate's or equivalent; Short first tertiary programmes that are - typically practically-based, occupationally-specific and prepare for - labour market entry. These programmes may also provide a pathway to other - tertiary programmes. ISCED code 5. - BACHELORS_OR_EQUIVALENT (int): Bachelor's or equivalent; Programmes designed to provide intermediate - academic and/or professional knowledge, skills and competencies leading - to a first tertiary degree or equivalent qualification. ISCED code 6. - MASTERS_OR_EQUIVALENT (int): Master's or equivalent; Programmes designed to provide advanced academic - and/or professional knowledge, skills and competencies leading to a - second tertiary degree or equivalent qualification. ISCED code 7. - DOCTORAL_OR_EQUIVALENT (int): Doctoral or equivalent; Programmes designed primarily to lead to an - advanced research qualification, usually concluding with the submission - and defense of a substantive dissertation of publishable quality based on - original research. ISCED code 8. - """ - - DEGREE_TYPE_UNSPECIFIED = 0 - PRIMARY_EDUCATION = 1 - LOWER_SECONDARY_EDUCATION = 2 - UPPER_SECONDARY_EDUCATION = 3 - ADULT_REMEDIAL_EDUCATION = 4 - ASSOCIATES_OR_EQUIVALENT = 5 - BACHELORS_OR_EQUIVALENT = 6 - MASTERS_OR_EQUIVALENT = 7 - DOCTORAL_OR_EQUIVALENT = 8 - - -class EmploymentType(enum.IntEnum): - """ - An enum that represents the employment type of a job. - - Attributes: - EMPLOYMENT_TYPE_UNSPECIFIED (int): The default value if the employment type isn't specified. - FULL_TIME (int): The job requires working a number of hours that constitute full - time employment, typically 40 or more hours per week. - PART_TIME (int): The job entails working fewer hours than a full time job, - typically less than 40 hours a week. - CONTRACTOR (int): The job is offered as a contracted, as opposed to a salaried employee, - position. - CONTRACT_TO_HIRE (int): The job is offered as a contracted position with the understanding that - it's converted into a full-time position at the end of the contract. - Jobs of this type are also returned by a search for - ``EmploymentType.CONTRACTOR`` jobs. - TEMPORARY (int): The job is offered as a temporary employment opportunity, usually - a short-term engagement. - INTERN (int): The job is a fixed-term opportunity for students or entry-level job - seekers to obtain on-the-job training, typically offered as a summer - position. - VOLUNTEER (int): The is an opportunity for an individual to volunteer, where there's no - expectation of compensation for the provided services. - PER_DIEM (int): The job requires an employee to work on an as-needed basis with a - flexible schedule. - FLY_IN_FLY_OUT (int): The job involves employing people in remote areas and flying them - temporarily to the work site instead of relocating employees and their - families permanently. - OTHER_EMPLOYMENT_TYPE (int): The job does not fit any of the other listed types. - """ - - EMPLOYMENT_TYPE_UNSPECIFIED = 0 - FULL_TIME = 1 - PART_TIME = 2 - CONTRACTOR = 3 - CONTRACT_TO_HIRE = 4 - TEMPORARY = 5 - INTERN = 6 - VOLUNTEER = 7 - PER_DIEM = 8 - FLY_IN_FLY_OUT = 9 - OTHER_EMPLOYMENT_TYPE = 10 - - -class HtmlSanitization(enum.IntEnum): - """ - Option for HTML content sanitization on user input fields, for example, job - description. By setting this option, user can determine whether and how - sanitization is performed on these fields. - - Attributes: - HTML_SANITIZATION_UNSPECIFIED (int): Default value. - HTML_SANITIZATION_DISABLED (int): Disables sanitization on HTML input. - SIMPLE_FORMATTING_ONLY (int): Sanitizes HTML input, only accepts bold, italic, ordered list, and - unordered list markup tags. - """ - - HTML_SANITIZATION_UNSPECIFIED = 0 - HTML_SANITIZATION_DISABLED = 1 - SIMPLE_FORMATTING_ONLY = 2 - - -class JobBenefit(enum.IntEnum): - """ - An enum that represents employee benefits included with the job. - - Attributes: - JOB_BENEFIT_UNSPECIFIED (int): Default value if the type isn't specified. - CHILD_CARE (int): The job includes access to programs that support child care, such - as daycare. - DENTAL (int): The job includes dental services covered by a dental - insurance plan. - DOMESTIC_PARTNER (int): The job offers specific benefits to domestic partners. - FLEXIBLE_HOURS (int): The job allows for a flexible work schedule. - MEDICAL (int): The job includes health services covered by a medical insurance plan. - LIFE_INSURANCE (int): The job includes a life insurance plan provided by the employer or - available for purchase by the employee. - PARENTAL_LEAVE (int): The job allows for a leave of absence to a parent to care for a newborn - child. - RETIREMENT_PLAN (int): The job includes a workplace retirement plan provided by the - employer or available for purchase by the employee. - SICK_DAYS (int): The job allows for paid time off due to illness. - VACATION (int): The job includes paid time off for vacation. - VISION (int): The job includes vision services covered by a vision - insurance plan. - """ - - JOB_BENEFIT_UNSPECIFIED = 0 - CHILD_CARE = 1 - DENTAL = 2 - DOMESTIC_PARTNER = 3 - FLEXIBLE_HOURS = 4 - MEDICAL = 5 - LIFE_INSURANCE = 6 - PARENTAL_LEAVE = 7 - RETIREMENT_PLAN = 8 - SICK_DAYS = 9 - VACATION = 10 - VISION = 11 - - -class JobCategory(enum.IntEnum): - """ - An enum that represents the categorization or primary focus of specific - role. This value is different than the "industry" associated with a role, - which is related to the categorization of the company listing the job. - - Attributes: - JOB_CATEGORY_UNSPECIFIED (int): The default value if the category isn't specified. - ACCOUNTING_AND_FINANCE (int): An accounting and finance job, such as an Accountant. - ADMINISTRATIVE_AND_OFFICE (int): An administrative and office job, such as an Administrative Assistant. - ADVERTISING_AND_MARKETING (int): An advertising and marketing job, such as Marketing Manager. - ANIMAL_CARE (int): An animal care job, such as Veterinarian. - ART_FASHION_AND_DESIGN (int): An art, fashion, or design job, such as Designer. - BUSINESS_OPERATIONS (int): A business operations job, such as Business Operations Manager. - CLEANING_AND_FACILITIES (int): A cleaning and facilities job, such as Custodial Staff. - COMPUTER_AND_IT (int): A computer and IT job, such as Systems Administrator. - CONSTRUCTION (int): A construction job, such as General Laborer. - CUSTOMER_SERVICE (int): A customer service job, such s Cashier. - EDUCATION (int): An education job, such as School Teacher. - ENTERTAINMENT_AND_TRAVEL (int): An entertainment and travel job, such as Flight Attendant. - FARMING_AND_OUTDOORS (int): A farming or outdoor job, such as Park Ranger. - HEALTHCARE (int): A healthcare job, such as Registered Nurse. - HUMAN_RESOURCES (int): A human resources job, such as Human Resources Director. - INSTALLATION_MAINTENANCE_AND_REPAIR (int): An installation, maintenance, or repair job, such as Electrician. - LEGAL (int): A legal job, such as Law Clerk. - MANAGEMENT (int): A management job, often used in conjunction with another category, - such as Store Manager. - MANUFACTURING_AND_WAREHOUSE (int): A manufacturing or warehouse job, such as Assembly Technician. - MEDIA_COMMUNICATIONS_AND_WRITING (int): A media, communications, or writing job, such as Media Relations. - OIL_GAS_AND_MINING (int): An oil, gas or mining job, such as Offshore Driller. - PERSONAL_CARE_AND_SERVICES (int): A personal care and services job, such as Hair Stylist. - PROTECTIVE_SERVICES (int): A protective services job, such as Security Guard. - REAL_ESTATE (int): A real estate job, such as Buyer's Agent. - RESTAURANT_AND_HOSPITALITY (int): A restaurant and hospitality job, such as Restaurant Server. - SALES_AND_RETAIL (int): A sales and/or retail job, such Sales Associate. - SCIENCE_AND_ENGINEERING (int): A science and engineering job, such as Lab Technician. - SOCIAL_SERVICES_AND_NON_PROFIT (int): A social services or non-profit job, such as Case Worker. - SPORTS_FITNESS_AND_RECREATION (int): A sports, fitness, or recreation job, such as Personal Trainer. - TRANSPORTATION_AND_LOGISTICS (int): A transportation or logistics job, such as Truck Driver. - """ - - JOB_CATEGORY_UNSPECIFIED = 0 - ACCOUNTING_AND_FINANCE = 1 - ADMINISTRATIVE_AND_OFFICE = 2 - ADVERTISING_AND_MARKETING = 3 - ANIMAL_CARE = 4 - ART_FASHION_AND_DESIGN = 5 - BUSINESS_OPERATIONS = 6 - CLEANING_AND_FACILITIES = 7 - COMPUTER_AND_IT = 8 - CONSTRUCTION = 9 - CUSTOMER_SERVICE = 10 - EDUCATION = 11 - ENTERTAINMENT_AND_TRAVEL = 12 - FARMING_AND_OUTDOORS = 13 - HEALTHCARE = 14 - HUMAN_RESOURCES = 15 - INSTALLATION_MAINTENANCE_AND_REPAIR = 16 - LEGAL = 17 - MANAGEMENT = 18 - MANUFACTURING_AND_WAREHOUSE = 19 - MEDIA_COMMUNICATIONS_AND_WRITING = 20 - OIL_GAS_AND_MINING = 21 - PERSONAL_CARE_AND_SERVICES = 22 - PROTECTIVE_SERVICES = 23 - REAL_ESTATE = 24 - RESTAURANT_AND_HOSPITALITY = 25 - SALES_AND_RETAIL = 26 - SCIENCE_AND_ENGINEERING = 27 - SOCIAL_SERVICES_AND_NON_PROFIT = 28 - SPORTS_FITNESS_AND_RECREATION = 29 - TRANSPORTATION_AND_LOGISTICS = 30 - - -class JobLevel(enum.IntEnum): - """ - An enum that represents the required experience level required for the job. - - Attributes: - JOB_LEVEL_UNSPECIFIED (int): The default value if the level isn't specified. - ENTRY_LEVEL (int): Entry-level individual contributors, typically with less than 2 years of - experience in a similar role. Includes interns. - EXPERIENCED (int): Experienced individual contributors, typically with 2+ years of - experience in a similar role. - MANAGER (int): Entry- to mid-level managers responsible for managing a team of people. - DIRECTOR (int): Senior-level managers responsible for managing teams of managers. - EXECUTIVE (int): Executive-level managers and above, including C-level positions. - """ - - JOB_LEVEL_UNSPECIFIED = 0 - ENTRY_LEVEL = 1 - EXPERIENCED = 2 - MANAGER = 3 - DIRECTOR = 4 - EXECUTIVE = 5 - - -class JobView(enum.IntEnum): - """ - An enum that specifies the job attributes that are returned in the - ``MatchingJob.job`` or ``ListJobsResponse.jobs`` fields. - - Attributes: - JOB_VIEW_UNSPECIFIED (int): Default value. - JOB_VIEW_ID_ONLY (int): A ID only view of job, with following attributes: ``Job.name``, - ``Job.requisition_id``, ``Job.language_code``. - JOB_VIEW_MINIMAL (int): A minimal view of the job, with the following attributes: ``Job.name``, - ``Job.requisition_id``, ``Job.title``, ``Job.company``, - ``Job.DerivedInfo.locations``, ``Job.language_code``. - JOB_VIEW_SMALL (int): A small view of the job, with the following attributes in the search - results: ``Job.name``, ``Job.requisition_id``, ``Job.title``, - ``Job.company``, ``Job.DerivedInfo.locations``, ``Job.visibility``, - ``Job.language_code``, ``Job.description``. - JOB_VIEW_FULL (int): All available attributes are included in the search results. - """ - - JOB_VIEW_UNSPECIFIED = 0 - JOB_VIEW_ID_ONLY = 1 - JOB_VIEW_MINIMAL = 2 - JOB_VIEW_SMALL = 3 - JOB_VIEW_FULL = 4 - - -class Outcome(enum.IntEnum): - """ - The overall outcome /decision / result indicator. - - Attributes: - OUTCOME_UNSPECIFIED (int): Default value. - POSITIVE (int): A positive outcome / passing indicator (for example, candidate was - recommended for hiring or to be moved forward in the hiring process, - candidate passed a test). - NEUTRAL (int): A neutral outcome / no clear indicator (for example, no strong - reccommendation either to move forward / not move forward, neutral score). - NEGATIVE (int): A negative outcome / failing indicator (for example, candidate was - recommended to NOT move forward in the hiring process, failed a test). - OUTCOME_NOT_AVAILABLE (int): The assessment outcome is not available or otherwise unknown (for example, - candidate did not complete assessment). - """ - - OUTCOME_UNSPECIFIED = 0 - POSITIVE = 1 - NEUTRAL = 2 - NEGATIVE = 3 - OUTCOME_NOT_AVAILABLE = 4 - - -class PostingRegion(enum.IntEnum): - """ - An enum that represents the job posting region. In most cases, job postings - don't need to specify a region. If a region is given, jobs are - eligible for searches in the specified region. - - Attributes: - POSTING_REGION_UNSPECIFIED (int): If the region is unspecified, the job is only returned if it matches the - ``LocationFilter``. - ADMINISTRATIVE_AREA (int): In addition to exact location matching, job posting is returned when the - ``LocationFilter`` in the search query is in the same administrative - area as the returned job posting. For example, if a - ``ADMINISTRATIVE_AREA`` job is posted in "CA, USA", it's returned if - ``LocationFilter`` has "Mountain View". - - Administrative area refers to top-level administrative subdivision of - this country. For example, US state, IT region, UK constituent nation - and JP prefecture. - NATION (int): In addition to exact location matching, job is returned when - ``LocationFilter`` in search query is in the same country as this job. - For example, if a ``NATION_WIDE`` job is posted in "USA", it's returned - if ``LocationFilter`` has 'Mountain View'. - TELECOMMUTE (int): Job allows employees to work remotely (telecommute). - If locations are provided with this value, the job is - considered as having a location, but telecommuting is allowed. - """ - - POSTING_REGION_UNSPECIFIED = 0 - ADMINISTRATIVE_AREA = 1 - NATION = 2 - TELECOMMUTE = 3 - - -class SkillProficiencyLevel(enum.IntEnum): - """ - Enum that represents the skill proficiency level. - - Attributes: - SKILL_PROFICIENCY_LEVEL_UNSPECIFIED (int): Default value. - UNSKILLED (int): Lacks any proficiency in this skill. - FUNDAMENTAL_AWARENESS (int): Have a common knowledge or an understanding of basic techniques and - concepts. - NOVICE (int): Have the level of experience gained in a classroom and/or experimental - scenarios or as a trainee on-the-job. - INTERMEDIATE (int): Be able to successfully complete tasks in this skill as requested. Help - from an expert may be required from time to time, but can usually perform - skill independently. - ADVANCED (int): Can perform the actions associated with this skill without assistance. - EXPERT (int): Known as an expert in this area. - """ - - SKILL_PROFICIENCY_LEVEL_UNSPECIFIED = 0 - UNSKILLED = 6 - FUNDAMENTAL_AWARENESS = 1 - NOVICE = 2 - INTERMEDIATE = 3 - ADVANCED = 4 - EXPERT = 5 - - -class Visibility(enum.IntEnum): - """ - Deprecated. All resources are only visible to the owner. - - An enum that represents who has view access to the resource. - - Attributes: - VISIBILITY_UNSPECIFIED (int): Default value. - ACCOUNT_ONLY (int): The resource is only visible to the GCP account who owns it. - SHARED_WITH_GOOGLE (int): The resource is visible to the owner and may be visible to other - applications and processes at Google. - SHARED_WITH_PUBLIC (int): The resource is visible to the owner and may be visible to all other API - clients. - """ - - VISIBILITY_UNSPECIFIED = 0 - ACCOUNT_ONLY = 1 - SHARED_WITH_GOOGLE = 2 - SHARED_WITH_PUBLIC = 3 - - -class Application(object): - class ApplicationStage(enum.IntEnum): - """ - The stage of the application. - - Attributes: - APPLICATION_STAGE_UNSPECIFIED (int): Default value. - NEW (int): Candidate has applied or a recruiter put candidate into consideration but - candidate is not yet screened / no decision has been made to move or not - move the candidate to the next stage. - SCREEN (int): A recruiter decided to screen the candidate for this role. - HIRING_MANAGER_REVIEW (int): Candidate is being / was sent to the customer / hiring manager for - detailed review. - INTERVIEW (int): Candidate was approved by the client / hiring manager and is being / was - interviewed for the role. - OFFER_EXTENDED (int): Candidate will be / has been given an offer of employment. - OFFER_ACCEPTED (int): Candidate has accepted their offer of employment. - STARTED (int): Candidate has begun (or completed) their employment or assignment with - the employer. - """ - - APPLICATION_STAGE_UNSPECIFIED = 0 - NEW = 1 - SCREEN = 2 - HIRING_MANAGER_REVIEW = 3 - INTERVIEW = 4 - OFFER_EXTENDED = 5 - OFFER_ACCEPTED = 6 - STARTED = 7 - - class ApplicationState(enum.IntEnum): - """ - Enum that represents the application status. - - Attributes: - APPLICATION_STATE_UNSPECIFIED (int): Default value. - IN_PROGRESS (int): The current stage is in progress or pending, for example, interviews in - progress. - CANDIDATE_WITHDREW (int): The current stage was terminated by a candidate decision. - EMPLOYER_WITHDREW (int): The current stage was terminated by an employer or agency decision. - COMPLETED (int): The current stage is successfully completed, but the next stage (if - applicable) has not begun. - CLOSED (int): The current stage was closed without an exception, or terminated for - reasons unrealated to the candidate. - """ - - APPLICATION_STATE_UNSPECIFIED = 0 - IN_PROGRESS = 1 - CANDIDATE_WITHDREW = 2 - EMPLOYER_WITHDREW = 3 - COMPLETED = 4 - CLOSED = 5 - - -class BatchOperationMetadata(object): - class State(enum.IntEnum): - """ - Attributes: - STATE_UNSPECIFIED (int): Default value. - INITIALIZING (int): The batch operation is being prepared for processing. - PROCESSING (int): The batch operation is actively being processed. - SUCCEEDED (int): The batch operation is processed, and at least one item has been - successfully processed. - FAILED (int): The batch operation is done and no item has been successfully processed. - CANCELLING (int): The batch operation is in the process of cancelling after - ``google.longrunning.Operations.CancelOperation`` is called. - CANCELLED (int): The batch operation is done after - ``google.longrunning.Operations.CancelOperation`` is called. Any items - processed before cancelling are returned in the response. - """ - - STATE_UNSPECIFIED = 0 - INITIALIZING = 1 - PROCESSING = 2 - SUCCEEDED = 3 - FAILED = 4 - CANCELLING = 5 - CANCELLED = 6 - - -class CommuteFilter(object): - class RoadTraffic(enum.IntEnum): - """ - The traffic density to use when calculating commute time. - - Attributes: - ROAD_TRAFFIC_UNSPECIFIED (int): Road traffic situation isn't specified. - TRAFFIC_FREE (int): Optimal commute time without considering any traffic impact. - BUSY_HOUR (int): Commute time calculation takes in account the peak traffic impact. - """ - - ROAD_TRAFFIC_UNSPECIFIED = 0 - TRAFFIC_FREE = 1 - BUSY_HOUR = 2 - - -class CompensationFilter(object): - class FilterType(enum.IntEnum): - """ - Specify the type of filtering. - - Attributes: - FILTER_TYPE_UNSPECIFIED (int): Filter type unspecified. Position holder, INVALID, should never be used. - UNIT_ONLY (int): Filter by ``base compensation entry's`` unit. A job is a match if and - only if the job contains a base CompensationEntry and the base - CompensationEntry's unit matches provided ``units``. Populate one or - more ``units``. - - See ``CompensationInfo.CompensationEntry`` for definition of base - compensation entry. - UNIT_AND_AMOUNT (int): Filter by ``base compensation entry's`` unit and amount / range. A job - is a match if and only if the job contains a base CompensationEntry, and - the base entry's unit matches provided ``CompensationUnit`` and amount - or range overlaps with provided ``CompensationRange``. - - See ``CompensationInfo.CompensationEntry`` for definition of base - compensation entry. - - Set exactly one ``units`` and populate ``range``. - ANNUALIZED_BASE_AMOUNT (int): Filter by annualized base compensation amount and - ``base compensation entry's`` unit. Populate ``range`` and zero or more - ``units``. - ANNUALIZED_TOTAL_AMOUNT (int): Filter by annualized total compensation amount and - ``base compensation entry's`` unit . Populate ``range`` and zero or more - ``units``. - """ - - FILTER_TYPE_UNSPECIFIED = 0 - UNIT_ONLY = 1 - UNIT_AND_AMOUNT = 2 - ANNUALIZED_BASE_AMOUNT = 3 - ANNUALIZED_TOTAL_AMOUNT = 4 - - -class CompensationInfo(object): - class CompensationType(enum.IntEnum): - """ - The type of compensation. - - For compensation amounts specified in non-monetary amounts, describe the - compensation scheme in the ``CompensationEntry.description``. - - For example, tipping format is described in - ``CompensationEntry.description`` (for example, "expect 15-20% tips - based on customer bill.") and an estimate of the tips provided in - ``CompensationEntry.amount`` or ``CompensationEntry.range`` ($10 per - hour). - - For example, equity is described in ``CompensationEntry.description`` - (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and - value estimated in ``CompensationEntry.amount`` or - ``CompensationEntry.range``. If no value estimate is possible, units are - ``CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED`` and then further - clarified in ``CompensationEntry.description`` field. - - Attributes: - COMPENSATION_TYPE_UNSPECIFIED (int): Default value. - BASE (int): Base compensation: Refers to the fixed amount of money paid to an - employee by an employer in return for work performed. Base compensation - does not include benefits, bonuses or any other potential compensation - from an employer. - BONUS (int): Bonus. - SIGNING_BONUS (int): Signing bonus. - EQUITY (int): Equity. - PROFIT_SHARING (int): Profit sharing. - COMMISSIONS (int): Commission. - TIPS (int): Tips. - OTHER_COMPENSATION_TYPE (int): Other compensation type. - """ - - COMPENSATION_TYPE_UNSPECIFIED = 0 - BASE = 1 - BONUS = 2 - SIGNING_BONUS = 3 - EQUITY = 4 - PROFIT_SHARING = 5 - COMMISSIONS = 6 - TIPS = 7 - OTHER_COMPENSATION_TYPE = 8 - - class CompensationUnit(enum.IntEnum): - """ - Pay frequency. - - Attributes: - COMPENSATION_UNIT_UNSPECIFIED (int): Default value. - HOURLY (int): Hourly. - DAILY (int): Daily. - WEEKLY (int): Weekly - MONTHLY (int): Monthly. - YEARLY (int): Yearly. - ONE_TIME (int): One time. - OTHER_COMPENSATION_UNIT (int): Other compensation units. - """ - - COMPENSATION_UNIT_UNSPECIFIED = 0 - HOURLY = 1 - DAILY = 2 - WEEKLY = 3 - MONTHLY = 4 - YEARLY = 5 - ONE_TIME = 6 - OTHER_COMPENSATION_UNIT = 7 - - -class CompleteQueryRequest(object): - class CompletionScope(enum.IntEnum): - """ - Enum to specify the scope of completion. - - Attributes: - COMPLETION_SCOPE_UNSPECIFIED (int): Default value. - TENANT (int): Suggestions are based only on the data provided by the client. - PUBLIC (int): Suggestions are based on all jobs data in the system that's visible to - the client - """ - - COMPLETION_SCOPE_UNSPECIFIED = 0 - TENANT = 1 - PUBLIC = 2 - - class CompletionType(enum.IntEnum): - """ - Enum to specify auto-completion topics. - - Attributes: - COMPLETION_TYPE_UNSPECIFIED (int): Default value. - JOB_TITLE (int): Suggest job titles for jobs autocomplete. - - For ``CompletionType.JOB_TITLE`` type, only open jobs with the same - ``language_codes`` are returned. - COMPANY_NAME (int): Suggest company names for jobs autocomplete. - - For ``CompletionType.COMPANY_NAME`` type, only companies having open - jobs with the same ``language_codes`` are returned. - COMBINED (int): Suggest both job titles and company names for jobs autocomplete. - - For ``CompletionType.COMBINED`` type, only open jobs with the same - ``language_codes`` or companies having open jobs with the same - ``language_codes`` are returned. - """ - - COMPLETION_TYPE_UNSPECIFIED = 0 - JOB_TITLE = 1 - COMPANY_NAME = 2 - COMBINED = 3 - - -class DeviceInfo(object): - class DeviceType(enum.IntEnum): - """ - An enumeration describing an API access portal and exposure mechanism. - - Attributes: - DEVICE_TYPE_UNSPECIFIED (int): The device type isn't specified. - WEB (int): A desktop web browser, such as, Chrome, Firefox, Safari, or Internet - Explorer) - MOBILE_WEB (int): A mobile device web browser, such as a phone or tablet with a Chrome - browser. - ANDROID (int): An Android device native application. - IOS (int): An iOS device native application. - BOT (int): A bot, as opposed to a device operated by human beings, such as a web - crawler. - OTHER (int): Other devices types. - """ - - DEVICE_TYPE_UNSPECIFIED = 0 - WEB = 1 - MOBILE_WEB = 2 - ANDROID = 3 - IOS = 4 - BOT = 5 - OTHER = 6 - - -class EmployerFilter(object): - class EmployerFilterMode(enum.IntEnum): - """ - Enum indicating which set of ``Profile.employment_records`` to search - against. - - Attributes: - EMPLOYER_FILTER_MODE_UNSPECIFIED (int): Default value. - ALL_EMPLOYMENT_RECORDS (int): Apply to all employers in ``Profile.employment_records``. - CURRENT_EMPLOYMENT_RECORDS_ONLY (int): Apply only to current employer in ``Profile.employment_records``. - PAST_EMPLOYMENT_RECORDS_ONLY (int): Apply only to past (not current) employers in - ``Profile.employment_records``. - """ - - EMPLOYER_FILTER_MODE_UNSPECIFIED = 0 - ALL_EMPLOYMENT_RECORDS = 1 - CURRENT_EMPLOYMENT_RECORDS_ONLY = 2 - PAST_EMPLOYMENT_RECORDS_ONLY = 3 - - -class JobEvent(object): - class JobEventType(enum.IntEnum): - """ - An enumeration of an event attributed to the behavior of the end user, - such as a job seeker. - - Attributes: - JOB_EVENT_TYPE_UNSPECIFIED (int): The event is unspecified by other provided values. - IMPRESSION (int): The job seeker or other entity interacting with the service has - had a job rendered in their view, such as in a list of search results in - a compressed or clipped format. This event is typically associated with - the viewing of a jobs list on a single page by a job seeker. - VIEW (int): The job seeker, or other entity interacting with the service, has viewed - the details of a job, including the full description. This event doesn't - apply to the viewing a snippet of a job appearing as a part of the job - search results. Viewing a snippet is associated with an ``impression``). - VIEW_REDIRECT (int): The job seeker or other entity interacting with the service - performed an action to view a job and was redirected to a different - website for job. - APPLICATION_START (int): The job seeker or other entity interacting with the service - began the process or demonstrated the intention of applying for a job. - APPLICATION_FINISH (int): The job seeker or other entity interacting with the service - submitted an application for a job. - APPLICATION_QUICK_SUBMISSION (int): The job seeker or other entity interacting with the service submitted an - application for a job with a single click without entering information. - If a job seeker performs this action, send only this event to the - service. Do not also send ``JobEventType.APPLICATION_START`` or - ``JobEventType.APPLICATION_FINISH`` events. - APPLICATION_REDIRECT (int): The job seeker or other entity interacting with the service - performed an action to apply to a job and was redirected to a different - website to complete the application. - APPLICATION_START_FROM_SEARCH (int): The job seeker or other entity interacting with the service began the - process or demonstrated the intention of applying for a job from the - search results page without viewing the details of the job posting. - If sending this event, JobEventType.VIEW event shouldn't be sent. - APPLICATION_REDIRECT_FROM_SEARCH (int): The job seeker, or other entity interacting with the service, performs - an action with a single click from the search results page to apply to a - job (without viewing the details of the job posting), and is redirected - to a different website to complete the application. If a candidate - performs this action, send only this event to the service. Do not also - send ``JobEventType.APPLICATION_START``, - ``JobEventType.APPLICATION_FINISH`` or ``JobEventType.VIEW`` events. - APPLICATION_COMPANY_SUBMIT (int): This event should be used when a company submits an application - on behalf of a job seeker. This event is intended for use by staffing - agencies attempting to place candidates. - BOOKMARK (int): The job seeker or other entity interacting with the service demonstrated - an interest in a job by bookmarking or saving it. - NOTIFICATION (int): The job seeker or other entity interacting with the service was - sent a notification, such as an email alert or device notification, - containing one or more jobs listings generated by the service. - HIRED (int): The job seeker or other entity interacting with the service was - employed by the hiring entity (employer). Send this event - only if the job seeker was hired through an application that was - initiated by a search conducted through the Cloud Talent Solution - service. - SENT_CV (int): A recruiter or staffing agency submitted an application on behalf of the - candidate after interacting with the service to identify a suitable job - posting. - INTERVIEW_GRANTED (int): The entity interacting with the service (for example, the job seeker), - was granted an initial interview by the hiring entity (employer). This - event should only be sent if the job seeker was granted an interview as - part of an application that was initiated by a search conducted through / - recommendation provided by the Cloud Talent Solution service. - """ - - JOB_EVENT_TYPE_UNSPECIFIED = 0 - IMPRESSION = 1 - VIEW = 2 - VIEW_REDIRECT = 3 - APPLICATION_START = 4 - APPLICATION_FINISH = 5 - APPLICATION_QUICK_SUBMISSION = 6 - APPLICATION_REDIRECT = 7 - APPLICATION_START_FROM_SEARCH = 8 - APPLICATION_REDIRECT_FROM_SEARCH = 9 - APPLICATION_COMPANY_SUBMIT = 10 - BOOKMARK = 11 - NOTIFICATION = 12 - HIRED = 13 - SENT_CV = 14 - INTERVIEW_GRANTED = 15 - - -class Location(object): - class LocationType(enum.IntEnum): - """ - An enum which represents the type of a location. - - Attributes: - LOCATION_TYPE_UNSPECIFIED (int): Default value if the type isn't specified. - COUNTRY (int): A country level location. - ADMINISTRATIVE_AREA (int): A state or equivalent level location. - SUB_ADMINISTRATIVE_AREA (int): A county or equivalent level location. - LOCALITY (int): A city or equivalent level location. - POSTAL_CODE (int): A postal code level location. - SUB_LOCALITY (int): A sublocality is a subdivision of a locality, for example a city borough, - ward, or arrondissement. Sublocalities are usually recognized by a local - political authority. For example, Manhattan and Brooklyn are recognized - as boroughs by the City of New York, and are therefore modeled as - sublocalities. - SUB_LOCALITY_1 (int): A district or equivalent level location. - SUB_LOCALITY_2 (int): A smaller district or equivalent level display. - NEIGHBORHOOD (int): A neighborhood level location. - STREET_ADDRESS (int): A street address level location. - """ - - LOCATION_TYPE_UNSPECIFIED = 0 - COUNTRY = 1 - ADMINISTRATIVE_AREA = 2 - SUB_ADMINISTRATIVE_AREA = 3 - LOCALITY = 4 - POSTAL_CODE = 5 - SUB_LOCALITY = 6 - SUB_LOCALITY_1 = 7 - SUB_LOCALITY_2 = 8 - NEIGHBORHOOD = 9 - STREET_ADDRESS = 10 - - -class LocationFilter(object): - class TelecommutePreference(enum.IntEnum): - """ - Specify whether to include telecommute jobs. - - Attributes: - TELECOMMUTE_PREFERENCE_UNSPECIFIED (int): Default value if the telecommute preference isn't specified. - TELECOMMUTE_EXCLUDED (int): Exclude telecommute jobs. - TELECOMMUTE_ALLOWED (int): Allow telecommute jobs. - """ - - TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0 - TELECOMMUTE_EXCLUDED = 1 - TELECOMMUTE_ALLOWED = 2 - - -class Phone(object): - class PhoneType(enum.IntEnum): - """ - Enum that represents the type of the telephone. - - Attributes: - PHONE_TYPE_UNSPECIFIED (int): Default value. - LANDLINE (int): A landline. - MOBILE (int): A mobile. - FAX (int): A fax. - PAGER (int): A pager. - TTY_OR_TDD (int): A TTY (test telephone) or TDD (telecommunication device for the deaf). - VOICEMAIL (int): A voicemail. - VIRTUAL (int): A virtual telephone number is a number that can be routed to another - number and managed by the user via Web, SMS, IVR, and so on. It is - associated with a particular person, and may be routed to either a - MOBILE or LANDLINE number. The ``phone usage`` should be set to PERSONAL - for these phone types. Some more information can be found here: - https://en.wikipedia.org/wiki/Personal\_Numbers - VOIP (int): Voice over IP numbers. This includes TSoIP (Telephony Service over IP). - MOBILE_OR_LANDLINE (int): In some regions (e.g. the USA), it is impossible to distinguish between - fixed-line and mobile numbers by looking at the phone number itself. - """ - - PHONE_TYPE_UNSPECIFIED = 0 - LANDLINE = 1 - MOBILE = 2 - FAX = 3 - PAGER = 4 - TTY_OR_TDD = 5 - VOICEMAIL = 6 - VIRTUAL = 7 - VOIP = 8 - MOBILE_OR_LANDLINE = 9 - - -class ProfileEvent(object): - class ProfileEventType(enum.IntEnum): - """ - The enum represents types of client events for a candidate profile. - - Attributes: - PROFILE_EVENT_TYPE_UNSPECIFIED (int): Default value. - IMPRESSION (int): Send this event when a ``ProfileEvent.profiles`` was sent as a part of a - result set for a CTS API call and was rendered in the end user's UI - (that is, the ``ProfileEvent.recruiter``). - VIEW (int): The VIEW event records the action of a candidate's profile being viewed - by an end user. This is critical to tracking product metrics and should - be sent for every profile VIEW that happens in your system, whether the - event is associated with an API call (for example, a recruiter making a - request for a result set and clicking on a profile) or not (a recruiter - using the system to view profile details without making a request). - - For a VIEW events associated with API calls, the - ``ClientEvent.request_id`` should be populated. If the VIEW is not - associated with an API call, ``request_id`` should not be populated. - - This event requires a valid recruiter and one valid ID in profiles. - BOOKMARK (int): The profile is bookmarked. - """ - - PROFILE_EVENT_TYPE_UNSPECIFIED = 0 - IMPRESSION = 1 - VIEW = 2 - BOOKMARK = 3 - - -class Resume(object): - class ResumeType(enum.IntEnum): - """ - The format of a structured resume. - - Attributes: - RESUME_TYPE_UNSPECIFIED (int): Default value. - HRXML (int): The profile contents in HR-XML format. - See https://schemas.liquid-technologies.com/hr-xml/2007-04-15/ for more - information about Human Resources XML. - OTHER_RESUME_TYPE (int): Resume type not specified. - """ - - RESUME_TYPE_UNSPECIFIED = 0 - HRXML = 1 - OTHER_RESUME_TYPE = 2 - - -class SearchJobsRequest(object): - class DiversificationLevel(enum.IntEnum): - """ - Controls whether highly similar jobs are returned next to each other in - the search results. Jobs are identified as highly similar based on - their titles, job categories, and locations. Highly similar results are - clustered so that only one representative job of the cluster is - displayed to the job seeker higher up in the results, with the other jobs - being displayed lower down in the results. - - Attributes: - DIVERSIFICATION_LEVEL_UNSPECIFIED (int): The diversification level isn't specified. - DISABLED (int): Disables diversification. Jobs that would normally be pushed to the last - page would not have their positions altered. This may result in highly - similar jobs appearing in sequence in the search results. - SIMPLE (int): Default diversifying behavior. The result list is ordered so that - highly similar results are pushed to the end of the last page of search - results. If you are using pageToken to page through the result set, - latency might be lower but we can't guarantee that all results are - returned. If you are using page offset, latency might be higher but all - results are returned. - """ - - DIVERSIFICATION_LEVEL_UNSPECIFIED = 0 - DISABLED = 1 - SIMPLE = 2 - - class SearchMode(enum.IntEnum): - """ - A string-represented enumeration of the job search mode. The service - operate differently for different modes of service. - - Attributes: - SEARCH_MODE_UNSPECIFIED (int): The mode of the search method isn't specified. The default search - behavior is identical to JOB\_SEARCH search behavior. - JOB_SEARCH (int): The job search matches against all jobs, and featured jobs - (jobs with promotionValue > 0) are not specially handled. - FEATURED_JOB_SEARCH (int): The job search matches only against featured jobs (jobs with a - promotionValue > 0). This method doesn't return any jobs having a - promotionValue <= 0. The search results order is determined by the - promotionValue (jobs with a higher promotionValue are returned higher up - in the search results), with relevance being used as a tiebreaker. - """ - - SEARCH_MODE_UNSPECIFIED = 0 - JOB_SEARCH = 1 - FEATURED_JOB_SEARCH = 2 - - class CustomRankingInfo(object): - class ImportanceLevel(enum.IntEnum): - """ - The importance level for ``CustomRankingInfo.ranking_expression``. - - Attributes: - IMPORTANCE_LEVEL_UNSPECIFIED (int): Default value if the importance level isn't specified. - NONE (int): The given ranking expression is of None importance, existing relevance - score (determined by API algorithm) dominates job's final ranking - position. - LOW (int): The given ranking expression is of Low importance in terms of job's - final ranking position compared to existing relevance - score (determined by API algorithm). - MILD (int): The given ranking expression is of Mild importance in terms of job's - final ranking position compared to existing relevance - score (determined by API algorithm). - MEDIUM (int): The given ranking expression is of Medium importance in terms of job's - final ranking position compared to existing relevance - score (determined by API algorithm). - HIGH (int): The given ranking expression is of High importance in terms of job's - final ranking position compared to existing relevance - score (determined by API algorithm). - EXTREME (int): The given ranking expression is of Extreme importance, and dominates - job's final ranking position with existing relevance - score (determined by API algorithm) ignored. - """ - - IMPORTANCE_LEVEL_UNSPECIFIED = 0 - NONE = 1 - LOW = 2 - MILD = 3 - MEDIUM = 4 - HIGH = 5 - EXTREME = 6 - - -class Tenant(object): - class DataUsageType(enum.IntEnum): - """ - Enum that represents how user data owned by the tenant is used. - - Attributes: - DATA_USAGE_TYPE_UNSPECIFIED (int): Default value. - AGGREGATED (int): Data owned by this tenant is used to improve search/recommendation - quality across tenants. - ISOLATED (int): Data owned by this tenant is used to improve search/recommendation - quality for this tenant only. - """ - - DATA_USAGE_TYPE_UNSPECIFIED = 0 - AGGREGATED = 1 - ISOLATED = 2 - - -class TimeFilter(object): - class TimeField(enum.IntEnum): - """ - Time fields can be used in TimeFilter. - - Attributes: - TIME_FIELD_UNSPECIFIED (int): Default value. - CREATE_TIME (int): Earliest profile create time. - UPDATE_TIME (int): Latest profile update time. - """ - - TIME_FIELD_UNSPECIFIED = 0 - CREATE_TIME = 1 - UPDATE_TIME = 2 diff --git a/talent/google/cloud/talent_v4beta1/gapic/event_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/event_service_client.py deleted file mode 100644 index 356671e471a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/event_service_client.py +++ /dev/null @@ -1,298 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 EventService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic import event_service_client_config -from google.cloud.talent_v4beta1.gapic.transports import event_service_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class EventServiceClient(object): - """A service handles client event report.""" - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.EventService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - EventServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.EventServiceGrpcTransport, - Callable[[~.Credentials, type], ~.EventServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = event_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=event_service_grpc_transport.EventServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = event_service_grpc_transport.EventServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_client_event( - self, - parent, - client_event, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Report events issued when end user interacts with customer's application - that uses Cloud Talent Solution. You may inspect the created events in - `self service - tools `__. - `Learn - more `__ - about self service tools. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.EventServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `client_event`: - >>> client_event = {} - >>> - >>> response = client.create_client_event(parent, client_event) - - Args: - parent (str): Required. Resource name of the tenant under which the event is created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created, for example, "projects/foo". - client_event (Union[dict, ~google.cloud.talent_v4beta1.types.ClientEvent]): Required. Events issued when end user interacts with customer's application that - uses Cloud Talent Solution. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.ClientEvent` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.ClientEvent` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_client_event" not in self._inner_api_calls: - self._inner_api_calls[ - "create_client_event" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_client_event, - default_retry=self._method_configs["CreateClientEvent"].retry, - default_timeout=self._method_configs["CreateClientEvent"].timeout, - client_info=self._client_info, - ) - - request = event_service_pb2.CreateClientEventRequest( - parent=parent, client_event=client_event - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_client_event"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/talent/google/cloud/talent_v4beta1/gapic/event_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/event_service_client_config.py deleted file mode 100644 index 0e27fa36f15d..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/event_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.EventService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateClientEvent": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py deleted file mode 100644 index 741ac4cdb4b9..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/job_service_client.py +++ /dev/null @@ -1,1725 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 JobService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic import job_service_client_config -from google.cloud.talent_v4beta1.gapic.transports import job_service_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import filters_pb2 -from google.cloud.talent_v4beta1.proto import histogram_pb2 -from google.cloud.talent_v4beta1.proto import job_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class JobServiceClient(object): - """A service handles job management, including job CRUD, enumeration and search.""" - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.JobService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - JobServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def company_path(cls, project, tenant, company): - """Return a fully-qualified company string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/companies/{company}", - project=project, - tenant=tenant, - company=company, - ) - - @classmethod - def company_without_tenant_path(cls, project, company): - """Return a fully-qualified company_without_tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/companies/{company}", project=project, company=company - ) - - @classmethod - def job_path(cls, project, tenant, jobs): - """Return a fully-qualified job string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/jobs/{jobs}", - project=project, - tenant=tenant, - jobs=jobs, - ) - - @classmethod - def job_without_tenant_path(cls, project, jobs): - """Return a fully-qualified job_without_tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/jobs/{jobs}", project=project, jobs=jobs - ) - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.JobServiceGrpcTransport, - Callable[[~.Credentials, type], ~.JobServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = job_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=job_service_grpc_transport.JobServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = job_service_grpc_transport.JobServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_job( - self, - parent, - job, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new job. - - Typically, the job becomes searchable within 10 seconds, but it may take - up to 5 minutes. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `job`: - >>> job = {} - >>> - >>> response = client.create_job(parent, job) - - Args: - parent (str): Required. The resource name of the tenant under which the job is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified a - default tenant is created. For example, "projects/foo". - job (Union[dict, ~google.cloud.talent_v4beta1.types.Job]): Required. The Job to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Job` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Job` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_job" not in self._inner_api_calls: - self._inner_api_calls[ - "create_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_job, - default_retry=self._method_configs["CreateJob"].retry, - default_timeout=self._method_configs["CreateJob"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.CreateJobRequest(parent=parent, job=job) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves the specified job, whose status is OPEN or recently EXPIRED - within the last 90 days. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> name = client.job_path('[PROJECT]', '[TENANT]', '[JOBS]') - >>> - >>> response = client.get_job(name) - - Args: - name (str): Required. The resource name of the job to retrieve. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". For - example, "projects/foo/tenants/bar/jobs/baz". - - If tenant id is unspecified, the default tenant is used. For example, - "projects/foo/jobs/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Job` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_job" not in self._inner_api_calls: - self._inner_api_calls[ - "get_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_job, - default_retry=self._method_configs["GetJob"].retry, - default_timeout=self._method_configs["GetJob"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.GetJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_job( - self, - job, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates specified job. - - Typically, updated contents become visible in search results within 10 - seconds, but it may take up to 5 minutes. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> # TODO: Initialize `job`: - >>> job = {} - >>> - >>> response = client.update_job(job) - - Args: - job (Union[dict, ~google.cloud.talent_v4beta1.types.Job]): Required. The Job to be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Job` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): Strongly recommended for the best service experience. - - If ``update_mask`` is provided, only the specified fields in ``job`` are - updated. Otherwise all the fields are updated. - - A field mask to restrict the fields that are updated. Only top level - fields of ``Job`` are supported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Job` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_job" not in self._inner_api_calls: - self._inner_api_calls[ - "update_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_job, - default_retry=self._method_configs["UpdateJob"].retry, - default_timeout=self._method_configs["UpdateJob"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.UpdateJobRequest(job=job, update_mask=update_mask) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("job.name", job.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_job( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes the specified job. - - Typically, the job becomes unsearchable within 10 seconds, but it may take - up to 5 minutes. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> name = client.job_path('[PROJECT]', '[TENANT]', '[JOBS]') - >>> - >>> client.delete_job(name) - - Args: - name (str): Required. The resource name of the job to be deleted. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". For - example, "projects/foo/tenants/bar/jobs/baz". - - If tenant id is unspecified, the default tenant is used. For example, - "projects/foo/jobs/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_job" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_job" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_job, - default_retry=self._method_configs["DeleteJob"].retry, - default_timeout=self._method_configs["DeleteJob"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.DeleteJobRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_job"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_jobs( - self, - parent, - filter_, - page_size=None, - job_view=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists jobs by filter. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `filter_`: - >>> filter_ = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_jobs(parent, filter_): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_jobs(parent, filter_).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the tenant under which the job is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - filter_ (str): Required. The filter string specifies the jobs to be enumerated. - - Supported operator: =, AND - - The fields eligible for filtering are: - - - ``companyName`` (Required) - - ``requisitionId`` - - ``status`` Available values: OPEN, EXPIRED, ALL. Defaults to OPEN if - no value is specified. - - Sample Query: - - - companyName = "projects/foo/tenants/bar/companies/baz" - - companyName = "projects/foo/tenants/bar/companies/baz" AND - requisitionId = "req-1" - - companyName = "projects/foo/tenants/bar/companies/baz" AND status = - "EXPIRED" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - job_view (~google.cloud.talent_v4beta1.types.JobView): The desired job attributes returned for jobs in the search response. - Defaults to ``JobView.JOB_VIEW_FULL`` if no value is specified. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.Job` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "list_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_jobs, - default_retry=self._method_configs["ListJobs"].retry, - default_timeout=self._method_configs["ListJobs"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.ListJobsRequest( - parent=parent, filter=filter_, page_size=page_size, job_view=job_view - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_jobs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="jobs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def batch_delete_jobs( - self, - parent, - filter_, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a list of ``Job``\ s by filter. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `filter_`: - >>> filter_ = '' - >>> - >>> client.batch_delete_jobs(parent, filter_) - - Args: - parent (str): Required. The resource name of the tenant under which the job is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - filter_ (str): Required. The filter string specifies the jobs to be deleted. - - Supported operator: =, AND - - The fields eligible for filtering are: - - - ``companyName`` (Required) - - ``requisitionId`` (Required) - - Sample Query: companyName = "projects/foo/companies/bar" AND - requisitionId = "req-1" - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_delete_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_delete_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_delete_jobs, - default_retry=self._method_configs["BatchDeleteJobs"].retry, - default_timeout=self._method_configs["BatchDeleteJobs"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.BatchDeleteJobsRequest(parent=parent, filter=filter_) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["batch_delete_jobs"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def search_jobs( - self, - parent, - request_metadata, - search_mode=None, - job_query=None, - enable_broadening=None, - require_precise_result_size=None, - histogram_queries=None, - job_view=None, - offset=None, - page_size=None, - order_by=None, - diversification_level=None, - custom_ranking_info=None, - disable_keyword_match=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches for jobs using the provided ``SearchJobsRequest``. - - This call constrains the ``visibility`` of jobs present in the database, - and only returns jobs that the caller has permission to search against. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `request_metadata`: - >>> request_metadata = {} - >>> - >>> # Iterate over all results - >>> for element in client.search_jobs(parent, request_metadata): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_jobs(parent, request_metadata).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the tenant to search within. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - request_metadata (Union[dict, ~google.cloud.talent_v4beta1.types.RequestMetadata]): Required. The meta information collected about the job searcher, used to - improve the search quality of the service. The identifiers (such as - ``user_id``) are provided by users, and must be unique and consistent. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.RequestMetadata` - search_mode (~google.cloud.talent_v4beta1.types.SearchMode): Mode of a search. - - Defaults to ``SearchMode.JOB_SEARCH``. - job_query (Union[dict, ~google.cloud.talent_v4beta1.types.JobQuery]): Query used to search against jobs, such as keyword, location filters, etc. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.JobQuery` - enable_broadening (bool): Controls whether to broaden the search when it produces sparse results. - Broadened queries append results to the end of the matching results - list. - - Defaults to false. - require_precise_result_size (bool): Controls if the search job request requires the return of a precise - count of the first 300 results. Setting this to ``true`` ensures - consistency in the number of results per page. Best practice is to set - this value to true if a client allows users to jump directly to a - non-sequential search results page. - - Enabling this flag may adversely impact performance. - - Defaults to false. - histogram_queries (list[Union[dict, ~google.cloud.talent_v4beta1.types.HistogramQuery]]): An expression specifies a histogram request against matching jobs. - - Expression syntax is an aggregation function call with histogram facets - and other options. - - Available aggregation function calls are: - - - ``count(string_histogram_facet)``: Count the number of matching - entities, for each distinct attribute value. - - ``count(numeric_histogram_facet, list of buckets)``: Count the number - of matching entities within each bucket. - - Data types: - - - Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9\_]+. - - String: string like "any string with backslash escape for quote(")." - - Number: whole number and floating point number like 10, -1 and -0.01. - - List: list of elements with comma(,) separator surrounded by square - brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - - Built-in constants: - - - MIN (minimum number similar to java Double.MIN\_VALUE) - - MAX (maximum number similar to java Double.MAX\_VALUE) - - Built-in functions: - - - bucket(start, end[, label]): bucket built-in function creates a - bucket with range of \`start, end). Note that the end is exclusive, - for example, bucket(1, MAX, "positive number") or bucket(1, 10). - - Job histogram facets: - - - company\_display\_name: histogram by [Job.company\_display\_name\`. - - employment\_type: histogram by ``Job.employment_types``, for example, - "FULL\_TIME", "PART\_TIME". - - company\_size: histogram by ``CompanySize``, for example, "SMALL", - "MEDIUM", "BIG". - - publish\_time\_in\_month: histogram by the - ``Job.posting_publish_time`` in months. Must specify list of numeric - buckets in spec. - - publish\_time\_in\_year: histogram by the - ``Job.posting_publish_time`` in years. Must specify list of numeric - buckets in spec. - - degree\_types: histogram by the ``Job.degree_types``, for example, - "Bachelors", "Masters". - - job\_level: histogram by the ``Job.job_level``, for example, "Entry - Level". - - country: histogram by the country code of jobs, for example, "US", - "FR". - - admin1: histogram by the admin1 code of jobs, which is a global - placeholder referring to the state, province, or the particular term - a country uses to define the geographic structure below the country - level, for example, "CA", "IL". - - city: histogram by a combination of the "city name, admin1 code". For - example, "Mountain View, CA", "New York, NY". - - admin1\_country: histogram by a combination of the "admin1 code, - country", for example, "CA, US", "IL, US". - - city\_coordinate: histogram by the city center's GPS coordinates - (latitude and longitude), for example, 37.4038522,-122.0987765. Since - the coordinates of a city center can change, customers may need to - refresh them periodically. - - locale: histogram by the ``Job.language_code``, for example, "en-US", - "fr-FR". - - language: histogram by the language subtag of the - ``Job.language_code``, for example, "en", "fr". - - category: histogram by the ``JobCategory``, for example, - "COMPUTER\_AND\_IT", "HEALTHCARE". - - base\_compensation\_unit: histogram by the - ``CompensationInfo.CompensationUnit`` of base salary, for example, - "WEEKLY", "MONTHLY". - - base\_compensation: histogram by the base salary. Must specify list - of numeric buckets to group results by. - - annualized\_base\_compensation: histogram by the base annualized - salary. Must specify list of numeric buckets to group results by. - - annualized\_total\_compensation: histogram by the total annualized - salary. Must specify list of numeric buckets to group results by. - - string\_custom\_attribute: histogram by string - ``Job.custom_attributes``. Values can be accessed via square bracket - notations like string\_custom\_attribute["key1"]. - - numeric\_custom\_attribute: histogram by numeric - ``Job.custom_attributes``. Values can be accessed via square bracket - notations like numeric\_custom\_attribute["key1"]. Must specify list - of numeric buckets to group results by. - - Example expressions: - - - ``count(admin1)`` - - ``count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), bucket(100000, MAX)])`` - - ``count(string_custom_attribute["some-string-custom-attribute"])`` - - ``count(numeric_custom_attribute["some-numeric-custom-attribute"], [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.HistogramQuery` - job_view (~google.cloud.talent_v4beta1.types.JobView): The desired job attributes returned for jobs in the search response. - Defaults to ``JobView.JOB_VIEW_SMALL`` if no value is specified. - offset (int): An integer that specifies the current offset (that is, starting result - location, amongst the jobs deemed by the API as relevant) in search - results. This field is only considered if ``page_token`` is unset. - - The maximum allowed value is 5000. Otherwise an error is thrown. - - The maximum allowed value is 5000. Otherwise an error is thrown. - - For example, 0 means to return results starting from the first matching - job, and 10 means to return from the 11th job. This can be used for - pagination, (for example, pageSize = 10 and offset = 10 means to return - from the second page). - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): The criteria determining how search results are sorted. Default is - ``"relevance desc"``. - - Supported options are: - - - ``"relevance desc"``: By relevance descending, as determined by the - API algorithms. Relevance thresholding of query results is only - available with this ordering. - - ``"posting_publish_time desc"``: By ``Job.posting_publish_time`` - descending. - - ``"posting_update_time desc"``: By ``Job.posting_update_time`` - descending. - - ``"title"``: By ``Job.title`` ascending. - - ``"title desc"``: By ``Job.title`` descending. - - ``"annualized_base_compensation"``: By job's - ``CompensationInfo.annualized_base_compensation_range`` ascending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_base_compensation desc"``: By job's - ``CompensationInfo.annualized_base_compensation_range`` descending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_total_compensation"``: By job's - ``CompensationInfo.annualized_total_compensation_range`` ascending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_total_compensation desc"``: By job's - ``CompensationInfo.annualized_total_compensation_range`` descending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"custom_ranking desc"``: By the relevance score adjusted to the - ``SearchJobsRequest.CustomRankingInfo.ranking_expression`` with - weight factor assigned by - ``SearchJobsRequest.CustomRankingInfo.importance_level`` in - descending order. - - Location sorting: Use the special syntax to order jobs by distance: - ``"distance_from('Hawaii')"``: Order by distance from Hawaii. - ``"distance_from(19.89, 155.5)"``: Order by distance from a - coordinate. - ``"distance_from('Hawaii'), distance_from('Puerto Rico')"``: Order by - multiple locations. See details below. - ``"distance_from('Hawaii'), distance_from(19.89, 155.5)"``: Order by - multiple locations. See details below. The string can have a maximum - of 256 characters. When multiple distance centers are provided, a job - that is close to any of the distance centers would have a high rank. - When a job has multiple locations, the job location closest to one of - the distance centers will be used. Jobs that don't have locations - will be ranked at the bottom. Distance is calculated with a precision - of 11.3 meters (37.4 feet). Diversification strategy is still applied - unless explicitly disabled in ``diversification_level``. - diversification_level (~google.cloud.talent_v4beta1.types.DiversificationLevel): Controls whether highly similar jobs are returned next to each other in - the search results. Jobs are identified as highly similar based on their - titles, job categories, and locations. Highly similar results are - clustered so that only one representative job of the cluster is - displayed to the job seeker higher up in the results, with the other - jobs being displayed lower down in the results. - - Defaults to ``DiversificationLevel.SIMPLE`` if no value is specified. - custom_ranking_info (Union[dict, ~google.cloud.talent_v4beta1.types.CustomRankingInfo]): Controls over how job documents get ranked on top of existing relevance - score (determined by API algorithm). - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.CustomRankingInfo` - disable_keyword_match (bool): Controls whether to disable exact keyword match on ``Job.title``, - ``Job.description``, ``Job.company_display_name``, ``Job.addresses``, - ``Job.qualifications``. When disable keyword match is turned off, a - keyword match returns jobs that do not match given category filters when - there are matching keywords. For example, for the query "program - manager," a result is returned even if the job posting has the title - "software developer," which doesn't fall into "program manager" - ontology, but does have "program manager" appearing in its description. - - For queries like "cloud" that don't contain title or location specific - ontology, jobs with "cloud" keyword matches are returned regardless of - this flag's value. - - Use ``Company.keyword_searchable_job_custom_attributes`` if - company-specific globally matched custom field/attribute string values - are needed. Enabling keyword match improves recall of subsequent search - requests. - - Defaults to false. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.MatchingJob` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "search_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_jobs, - default_retry=self._method_configs["SearchJobs"].retry, - default_timeout=self._method_configs["SearchJobs"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.SearchJobsRequest( - parent=parent, - request_metadata=request_metadata, - search_mode=search_mode, - job_query=job_query, - enable_broadening=enable_broadening, - require_precise_result_size=require_precise_result_size, - histogram_queries=histogram_queries, - job_view=job_view, - offset=offset, - page_size=page_size, - order_by=order_by, - diversification_level=diversification_level, - custom_ranking_info=custom_ranking_info, - disable_keyword_match=disable_keyword_match, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_jobs"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="matching_jobs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def search_jobs_for_alert( - self, - parent, - request_metadata, - search_mode=None, - job_query=None, - enable_broadening=None, - require_precise_result_size=None, - histogram_queries=None, - job_view=None, - offset=None, - page_size=None, - order_by=None, - diversification_level=None, - custom_ranking_info=None, - disable_keyword_match=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches for jobs using the provided ``SearchJobsRequest``. - - This API call is intended for the use case of targeting passive job - seekers (for example, job seekers who have signed up to receive email - alerts about potential job opportunities), and has different algorithmic - adjustments that are targeted to passive job seekers. - - This call constrains the ``visibility`` of jobs present in the database, - and only returns jobs the caller has permission to search against. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `request_metadata`: - >>> request_metadata = {} - >>> - >>> # Iterate over all results - >>> for element in client.search_jobs_for_alert(parent, request_metadata): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_jobs_for_alert(parent, request_metadata).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the tenant to search within. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - request_metadata (Union[dict, ~google.cloud.talent_v4beta1.types.RequestMetadata]): Required. The meta information collected about the job searcher, used to - improve the search quality of the service. The identifiers (such as - ``user_id``) are provided by users, and must be unique and consistent. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.RequestMetadata` - search_mode (~google.cloud.talent_v4beta1.types.SearchMode): Mode of a search. - - Defaults to ``SearchMode.JOB_SEARCH``. - job_query (Union[dict, ~google.cloud.talent_v4beta1.types.JobQuery]): Query used to search against jobs, such as keyword, location filters, etc. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.JobQuery` - enable_broadening (bool): Controls whether to broaden the search when it produces sparse results. - Broadened queries append results to the end of the matching results - list. - - Defaults to false. - require_precise_result_size (bool): Controls if the search job request requires the return of a precise - count of the first 300 results. Setting this to ``true`` ensures - consistency in the number of results per page. Best practice is to set - this value to true if a client allows users to jump directly to a - non-sequential search results page. - - Enabling this flag may adversely impact performance. - - Defaults to false. - histogram_queries (list[Union[dict, ~google.cloud.talent_v4beta1.types.HistogramQuery]]): An expression specifies a histogram request against matching jobs. - - Expression syntax is an aggregation function call with histogram facets - and other options. - - Available aggregation function calls are: - - - ``count(string_histogram_facet)``: Count the number of matching - entities, for each distinct attribute value. - - ``count(numeric_histogram_facet, list of buckets)``: Count the number - of matching entities within each bucket. - - Data types: - - - Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9\_]+. - - String: string like "any string with backslash escape for quote(")." - - Number: whole number and floating point number like 10, -1 and -0.01. - - List: list of elements with comma(,) separator surrounded by square - brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - - Built-in constants: - - - MIN (minimum number similar to java Double.MIN\_VALUE) - - MAX (maximum number similar to java Double.MAX\_VALUE) - - Built-in functions: - - - bucket(start, end[, label]): bucket built-in function creates a - bucket with range of \`start, end). Note that the end is exclusive, - for example, bucket(1, MAX, "positive number") or bucket(1, 10). - - Job histogram facets: - - - company\_display\_name: histogram by [Job.company\_display\_name\`. - - employment\_type: histogram by ``Job.employment_types``, for example, - "FULL\_TIME", "PART\_TIME". - - company\_size: histogram by ``CompanySize``, for example, "SMALL", - "MEDIUM", "BIG". - - publish\_time\_in\_month: histogram by the - ``Job.posting_publish_time`` in months. Must specify list of numeric - buckets in spec. - - publish\_time\_in\_year: histogram by the - ``Job.posting_publish_time`` in years. Must specify list of numeric - buckets in spec. - - degree\_types: histogram by the ``Job.degree_types``, for example, - "Bachelors", "Masters". - - job\_level: histogram by the ``Job.job_level``, for example, "Entry - Level". - - country: histogram by the country code of jobs, for example, "US", - "FR". - - admin1: histogram by the admin1 code of jobs, which is a global - placeholder referring to the state, province, or the particular term - a country uses to define the geographic structure below the country - level, for example, "CA", "IL". - - city: histogram by a combination of the "city name, admin1 code". For - example, "Mountain View, CA", "New York, NY". - - admin1\_country: histogram by a combination of the "admin1 code, - country", for example, "CA, US", "IL, US". - - city\_coordinate: histogram by the city center's GPS coordinates - (latitude and longitude), for example, 37.4038522,-122.0987765. Since - the coordinates of a city center can change, customers may need to - refresh them periodically. - - locale: histogram by the ``Job.language_code``, for example, "en-US", - "fr-FR". - - language: histogram by the language subtag of the - ``Job.language_code``, for example, "en", "fr". - - category: histogram by the ``JobCategory``, for example, - "COMPUTER\_AND\_IT", "HEALTHCARE". - - base\_compensation\_unit: histogram by the - ``CompensationInfo.CompensationUnit`` of base salary, for example, - "WEEKLY", "MONTHLY". - - base\_compensation: histogram by the base salary. Must specify list - of numeric buckets to group results by. - - annualized\_base\_compensation: histogram by the base annualized - salary. Must specify list of numeric buckets to group results by. - - annualized\_total\_compensation: histogram by the total annualized - salary. Must specify list of numeric buckets to group results by. - - string\_custom\_attribute: histogram by string - ``Job.custom_attributes``. Values can be accessed via square bracket - notations like string\_custom\_attribute["key1"]. - - numeric\_custom\_attribute: histogram by numeric - ``Job.custom_attributes``. Values can be accessed via square bracket - notations like numeric\_custom\_attribute["key1"]. Must specify list - of numeric buckets to group results by. - - Example expressions: - - - ``count(admin1)`` - - ``count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), bucket(100000, MAX)])`` - - ``count(string_custom_attribute["some-string-custom-attribute"])`` - - ``count(numeric_custom_attribute["some-numeric-custom-attribute"], [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])`` - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.HistogramQuery` - job_view (~google.cloud.talent_v4beta1.types.JobView): The desired job attributes returned for jobs in the search response. - Defaults to ``JobView.JOB_VIEW_SMALL`` if no value is specified. - offset (int): An integer that specifies the current offset (that is, starting result - location, amongst the jobs deemed by the API as relevant) in search - results. This field is only considered if ``page_token`` is unset. - - The maximum allowed value is 5000. Otherwise an error is thrown. - - The maximum allowed value is 5000. Otherwise an error is thrown. - - For example, 0 means to return results starting from the first matching - job, and 10 means to return from the 11th job. This can be used for - pagination, (for example, pageSize = 10 and offset = 10 means to return - from the second page). - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - order_by (str): The criteria determining how search results are sorted. Default is - ``"relevance desc"``. - - Supported options are: - - - ``"relevance desc"``: By relevance descending, as determined by the - API algorithms. Relevance thresholding of query results is only - available with this ordering. - - ``"posting_publish_time desc"``: By ``Job.posting_publish_time`` - descending. - - ``"posting_update_time desc"``: By ``Job.posting_update_time`` - descending. - - ``"title"``: By ``Job.title`` ascending. - - ``"title desc"``: By ``Job.title`` descending. - - ``"annualized_base_compensation"``: By job's - ``CompensationInfo.annualized_base_compensation_range`` ascending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_base_compensation desc"``: By job's - ``CompensationInfo.annualized_base_compensation_range`` descending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_total_compensation"``: By job's - ``CompensationInfo.annualized_total_compensation_range`` ascending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"annualized_total_compensation desc"``: By job's - ``CompensationInfo.annualized_total_compensation_range`` descending. - Jobs whose annualized base compensation is unspecified are put at the - end of search results. - - ``"custom_ranking desc"``: By the relevance score adjusted to the - ``SearchJobsRequest.CustomRankingInfo.ranking_expression`` with - weight factor assigned by - ``SearchJobsRequest.CustomRankingInfo.importance_level`` in - descending order. - - Location sorting: Use the special syntax to order jobs by distance: - ``"distance_from('Hawaii')"``: Order by distance from Hawaii. - ``"distance_from(19.89, 155.5)"``: Order by distance from a - coordinate. - ``"distance_from('Hawaii'), distance_from('Puerto Rico')"``: Order by - multiple locations. See details below. - ``"distance_from('Hawaii'), distance_from(19.89, 155.5)"``: Order by - multiple locations. See details below. The string can have a maximum - of 256 characters. When multiple distance centers are provided, a job - that is close to any of the distance centers would have a high rank. - When a job has multiple locations, the job location closest to one of - the distance centers will be used. Jobs that don't have locations - will be ranked at the bottom. Distance is calculated with a precision - of 11.3 meters (37.4 feet). Diversification strategy is still applied - unless explicitly disabled in ``diversification_level``. - diversification_level (~google.cloud.talent_v4beta1.types.DiversificationLevel): Controls whether highly similar jobs are returned next to each other in - the search results. Jobs are identified as highly similar based on their - titles, job categories, and locations. Highly similar results are - clustered so that only one representative job of the cluster is - displayed to the job seeker higher up in the results, with the other - jobs being displayed lower down in the results. - - Defaults to ``DiversificationLevel.SIMPLE`` if no value is specified. - custom_ranking_info (Union[dict, ~google.cloud.talent_v4beta1.types.CustomRankingInfo]): Controls over how job documents get ranked on top of existing relevance - score (determined by API algorithm). - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.CustomRankingInfo` - disable_keyword_match (bool): Controls whether to disable exact keyword match on ``Job.title``, - ``Job.description``, ``Job.company_display_name``, ``Job.addresses``, - ``Job.qualifications``. When disable keyword match is turned off, a - keyword match returns jobs that do not match given category filters when - there are matching keywords. For example, for the query "program - manager," a result is returned even if the job posting has the title - "software developer," which doesn't fall into "program manager" - ontology, but does have "program manager" appearing in its description. - - For queries like "cloud" that don't contain title or location specific - ontology, jobs with "cloud" keyword matches are returned regardless of - this flag's value. - - Use ``Company.keyword_searchable_job_custom_attributes`` if - company-specific globally matched custom field/attribute string values - are needed. Enabling keyword match improves recall of subsequent search - requests. - - Defaults to false. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.MatchingJob` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_jobs_for_alert" not in self._inner_api_calls: - self._inner_api_calls[ - "search_jobs_for_alert" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_jobs_for_alert, - default_retry=self._method_configs["SearchJobsForAlert"].retry, - default_timeout=self._method_configs["SearchJobsForAlert"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.SearchJobsRequest( - parent=parent, - request_metadata=request_metadata, - search_mode=search_mode, - job_query=job_query, - enable_broadening=enable_broadening, - require_precise_result_size=require_precise_result_size, - histogram_queries=histogram_queries, - job_view=job_view, - offset=offset, - page_size=page_size, - order_by=order_by, - diversification_level=diversification_level, - custom_ranking_info=custom_ranking_info, - disable_keyword_match=disable_keyword_match, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_jobs_for_alert"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="matching_jobs", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def batch_create_jobs( - self, - parent, - jobs, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Begins executing a batch create jobs operation. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `jobs`: - >>> jobs = [] - >>> - >>> response = client.batch_create_jobs(parent, jobs) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The resource name of the tenant under which the job is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - jobs (list[Union[dict, ~google.cloud.talent_v4beta1.types.Job]]): Required. The jobs to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Job` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_create_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_create_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_create_jobs, - default_retry=self._method_configs["BatchCreateJobs"].retry, - default_timeout=self._method_configs["BatchCreateJobs"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.BatchCreateJobsRequest(parent=parent, jobs=jobs) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_create_jobs"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - job_service_pb2.JobOperationResult, - metadata_type=common_pb2.BatchOperationMetadata, - ) - - def batch_update_jobs( - self, - parent, - jobs, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Begins executing a batch update jobs operation. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.JobServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `jobs`: - >>> jobs = [] - >>> - >>> response = client.batch_update_jobs(parent, jobs) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The resource name of the tenant under which the job is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - jobs (list[Union[dict, ~google.cloud.talent_v4beta1.types.Job]]): Required. The jobs to be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Job` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): Strongly recommended for the best service experience. Be aware that it - will also increase latency when checking the status of a batch - operation. - - If ``update_mask`` is provided, only the specified fields in ``Job`` are - updated. Otherwise all the fields are updated. - - A field mask to restrict the fields that are updated. Only top level - fields of ``Job`` are supported. - - If ``update_mask`` is provided, The ``Job`` inside ``JobResult`` will - only contains fields that is updated, plus the Id of the Job. Otherwise, - ``Job`` will include all fields, which can yield a very large response. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_update_jobs" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_update_jobs" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_update_jobs, - default_retry=self._method_configs["BatchUpdateJobs"].retry, - default_timeout=self._method_configs["BatchUpdateJobs"].timeout, - client_info=self._client_info, - ) - - request = job_service_pb2.BatchUpdateJobsRequest( - parent=parent, jobs=jobs, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["batch_update_jobs"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - job_service_pb2.JobOperationResult, - metadata_type=common_pb2.BatchOperationMetadata, - ) diff --git a/talent/google/cloud/talent_v4beta1/gapic/job_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/job_service_client_config.py deleted file mode 100644 index 8dbb1033d77e..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/job_service_client_config.py +++ /dev/null @@ -1,73 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.JobService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetJob": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateJob": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteJob": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListJobs": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "BatchDeleteJobs": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SearchJobs": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "SearchJobsForAlert": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "BatchCreateJobs": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "BatchUpdateJobs": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py deleted file mode 100644 index e6bb3e1772f4..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/profile_service_client.py +++ /dev/null @@ -1,1009 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 ProfileService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic import profile_service_client_config -from google.cloud.talent_v4beta1.gapic.transports import profile_service_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import filters_pb2 -from google.cloud.talent_v4beta1.proto import histogram_pb2 -from google.cloud.talent_v4beta1.proto import job_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import profile_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class ProfileServiceClient(object): - """ - A service that handles profile management, including profile CRUD, - enumeration and search. - """ - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.ProfileService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ProfileServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def profile_path(cls, project, tenant, profile): - """Return a fully-qualified profile string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}/profiles/{profile}", - project=project, - tenant=tenant, - profile=profile, - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ProfileServiceGrpcTransport, - Callable[[~.Credentials, type], ~.ProfileServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = profile_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=profile_service_grpc_transport.ProfileServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = profile_service_grpc_transport.ProfileServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_profiles( - self, - parent, - filter_=None, - page_size=None, - read_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists profiles by filter. The order is unspecified. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_profiles(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_profiles(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the tenant under which the profile is - created. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenants/bar". - filter_ (str): The filter string specifies the profiles to be enumerated. - - Supported operator: =, AND - - The field(s) eligible for filtering are: - - - ``externalId`` - - ``groupId`` - - externalId and groupId cannot be specified at the same time. If both - externalId and groupId are provided, the API will return a bad request - error. - - Sample Query: - - - externalId = "externalId-1" - - groupId = "groupId-1" - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - read_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): A field mask to specify the profile fields to be listed in response. All - fields are listed if it is unset. - - Valid values are: - - - name - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.Profile` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_profiles" not in self._inner_api_calls: - self._inner_api_calls[ - "list_profiles" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_profiles, - default_retry=self._method_configs["ListProfiles"].retry, - default_timeout=self._method_configs["ListProfiles"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.ListProfilesRequest( - parent=parent, filter=filter_, page_size=page_size, read_mask=read_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_profiles"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="profiles", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def create_profile( - self, - parent, - profile, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates and returns a new profile. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `profile`: - >>> profile = {} - >>> - >>> response = client.create_profile(parent, profile) - - Args: - parent (str): Required. The name of the tenant this profile belongs to. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenants/bar". - profile (Union[dict, ~google.cloud.talent_v4beta1.types.Profile]): Required. The profile to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Profile` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Profile` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_profile" not in self._inner_api_calls: - self._inner_api_calls[ - "create_profile" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_profile, - default_retry=self._method_configs["CreateProfile"].retry, - default_timeout=self._method_configs["CreateProfile"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.CreateProfileRequest( - parent=parent, profile=profile - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_profile"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_profile( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets the specified profile. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]') - >>> - >>> response = client.get_profile(name) - - Args: - name (str): Required. Resource name of the profile to get. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}". - For example, "projects/foo/tenants/bar/profiles/baz". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Profile` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_profile" not in self._inner_api_calls: - self._inner_api_calls[ - "get_profile" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_profile, - default_retry=self._method_configs["GetProfile"].retry, - default_timeout=self._method_configs["GetProfile"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.GetProfileRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_profile"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_profile( - self, - profile, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates the specified profile and returns the updated result. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> # TODO: Initialize `profile`: - >>> profile = {} - >>> - >>> response = client.update_profile(profile) - - Args: - profile (Union[dict, ~google.cloud.talent_v4beta1.types.Profile]): Required. Profile to be updated. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Profile` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): A field mask to specify the profile fields to update. - - A full update is performed if it is unset. - - Valid values are: - - - external\_id - - source - - source\_types - - uri - - is\_hirable - - create\_time - - update\_time - - candidate\_update\_time - - resume\_update\_time - - resume - - person\_names - - addresses - - email\_addresses - - phone\_numbers - - personal\_uris - - additional\_contact\_info - - employment\_records - - education\_records - - skills - - activities - - publications - - patents - - certifications - - recruiting\_notes - - custom\_attributes - - group\_id - - external\_system - - source\_note - - primary\_responsibilities - - citizenships - - work\_authorizations - - employee\_types - - language\_code - - qualification\_summary - - allowed\_contact\_types - - preferred\_contact\_types - - contact\_availability - - language\_fluencies - - work\_preference - - industry\_experiences - - work\_environment\_experiences - - work\_availability - - security\_clearances - - references - - assessments - - interviews - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Profile` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_profile" not in self._inner_api_calls: - self._inner_api_calls[ - "update_profile" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_profile, - default_retry=self._method_configs["UpdateProfile"].retry, - default_timeout=self._method_configs["UpdateProfile"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.UpdateProfileRequest( - profile=profile, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("profile.name", profile.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_profile"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_profile( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes the specified profile. - Prerequisite: The profile has no associated applications or assignments - associated. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> name = client.profile_path('[PROJECT]', '[TENANT]', '[PROFILE]') - >>> - >>> client.delete_profile(name) - - Args: - name (str): Required. Resource name of the profile to be deleted. - - The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile\_id}". - For example, "projects/foo/tenants/bar/profiles/baz". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_profile" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_profile" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_profile, - default_retry=self._method_configs["DeleteProfile"].retry, - default_timeout=self._method_configs["DeleteProfile"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.DeleteProfileRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_profile"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def search_profiles( - self, - parent, - request_metadata, - profile_query=None, - page_size=None, - offset=None, - disable_spell_check=None, - order_by=None, - case_sensitive_sort=None, - histogram_queries=None, - result_set_id=None, - strict_keywords_search=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Searches for profiles within a tenant. - - For example, search by raw queries "software engineer in Mountain View" - or search by structured filters (location filter, education filter, - etc.). - - See ``SearchProfilesRequest`` for more information. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.ProfileServiceClient() - >>> - >>> parent = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> # TODO: Initialize `request_metadata`: - >>> request_metadata = {} - >>> - >>> # Iterate over all results - >>> for element in client.search_profiles(parent, request_metadata): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.search_profiles(parent, request_metadata).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The resource name of the tenant to search within. - - The format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenants/bar". - request_metadata (Union[dict, ~google.cloud.talent_v4beta1.types.RequestMetadata]): Required. The meta information collected about the profile search user. This is used - to improve the search quality of the service. These values are provided by - users, and must be precise and consistent. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.RequestMetadata` - profile_query (Union[dict, ~google.cloud.talent_v4beta1.types.ProfileQuery]): Search query to execute. See ``ProfileQuery`` for more details. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.ProfileQuery` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - offset (int): An integer that specifies the current offset (that is, starting result) - in search results. This field is only considered if ``page_token`` is - unset. - - The maximum allowed value is 5000. Otherwise an error is thrown. - - For example, 0 means to search from the first profile, and 10 means to - search from the 11th profile. This can be used for pagination, for - example pageSize = 10 and offset = 10 means to search from the second - page. - disable_spell_check (bool): This flag controls the spell-check feature. If ``false``, the service - attempts to correct a misspelled query. - - For example, "enginee" is corrected to "engineer". - order_by (str): The criteria that determines how search results are sorted. Defaults is - "relevance desc" if no value is specified. - - Supported options are: - - - "relevance desc": By descending relevance, as determined by the API - algorithms. - - "update\_date desc": Sort by ``Profile.update_time`` in descending - order (recently updated profiles first). - - "create\_date desc": Sort by ``Profile.create_time`` in descending - order (recently created profiles first). - - "first\_name": Sort by ``PersonName.PersonStructuredName.given_name`` - in ascending order. - - "first\_name desc": Sort by - ``PersonName.PersonStructuredName.given_name`` in descending order. - - "last\_name": Sort by ``PersonName.PersonStructuredName.family_name`` - in ascending order. - - "last\_name desc": Sort by - ``PersonName.PersonStructuredName.family_name`` in ascending order. - case_sensitive_sort (bool): When sort by field is based on alphabetical order, sort values case - sensitively (based on ASCII) when the value is set to true. Default value - is case in-sensitive sort (false). - histogram_queries (list[Union[dict, ~google.cloud.talent_v4beta1.types.HistogramQuery]]): A list of expressions specifies histogram requests against matching - profiles for ``SearchProfilesRequest``. - - The expression syntax looks like a function definition with parameters. - - Function syntax: function\_name(histogram\_facet[, list of buckets]) - - Data types: - - - Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9\_]+. - - String: string like "any string with backslash escape for quote(")." - - Number: whole number and floating point number like 10, -1 and -0.01. - - List: list of elements with comma(,) separator surrounded by square - brackets. For example, [1, 2, 3] and ["one", "two", "three"]. - - Built-in constants: - - - MIN (minimum number similar to java Double.MIN\_VALUE) - - MAX (maximum number similar to java Double.MAX\_VALUE) - - Built-in functions: - - - bucket(start, end[, label]) Bucket build-in function creates a bucket - with range of \`start, end). Note that the end is exclusive. For - example, bucket(1, MAX, "positive number") or bucket(1, 10). - - Histogram Facets: - - - admin1: Admin1 is a global placeholder for referring to state, - province, or the particular term a country uses to define the - geographic structure below the country level. Examples include states - codes such as "CA", "IL", "NY", and provinces, such as "BC". - - locality: Locality is a global placeholder for referring to city, - town, or the particular term a country uses to define the geographic - structure below the admin1 level. Examples include city names such as - "Mountain View" and "New York". - - extended\_locality: Extended locality is concatenated version of - admin1 and locality with comma separator. For example, "Mountain - View, CA" and "New York, NY". - - postal\_code: Postal code of profile which follows locale code. - - country: Country code (ISO-3166-1 alpha-2 code) of profile, such as - US, JP, GB. - - job\_title: Normalized job titles specified in EmploymentHistory. - - company\_name: Normalized company name of profiles to match on. - - institution: The school name. For example, "MIT", "University of - California, Berkeley" - - degree: Highest education degree in ISCED code. Each value in degree - covers a specific level of education, without any expansion to upper - nor lower levels of education degree. - - experience\_in\_months: experience in months. 0 means 0 month to 1 - month (exclusive). - - application\_date: The application date specifies application start - dates. See [ApplicationDateFilter\` for more details. - - application\_outcome\_notes: The application outcome reason specifies - the reasons behind the outcome of the job application. See - ``ApplicationOutcomeNotesFilter`` for more details. - - application\_job\_title: The application job title specifies the job - applied for in the application. See ``ApplicationJobFilter`` for more - details. - - hirable\_status: Hirable status specifies the profile's hirable - status. - - string\_custom\_attribute: String custom attributes. Values can be - accessed via square bracket notation like - string\_custom\_attribute["key1"]. - - numeric\_custom\_attribute: Numeric custom attributes. Values can be - accessed via square bracket notation like - numeric\_custom\_attribute["key1"]. - - Example expressions: - - - count(admin1) - - count(experience\_in\_months, [bucket(0, 12, "1 year"), bucket(12, - 36, "1-3 years"), bucket(36, MAX, "3+ years")]) - - count(string\_custom\_attribute["assigned\_recruiter"]) - - count(numeric\_custom\_attribute["favorite\_number"], [bucket(MIN, 0, - "negative"), bucket(0, MAX, "non-negative")]) - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.HistogramQuery` - result_set_id (str): An id that uniquely identifies the result set of a ``SearchProfiles`` - call. The id should be retrieved from the ``SearchProfilesResponse`` - message returned from a previous invocation of ``SearchProfiles``. - - A result set is an ordered list of search results. - - If this field is not set, a new result set is computed based on the - ``profile_query``. A new ``result_set_id`` is returned as a handle to - access this result set. - - If this field is set, the service will ignore the resource and - ``profile_query`` values, and simply retrieve a page of results from the - corresponding result set. In this case, one and only one of - ``page_token`` or ``offset`` must be set. - - A typical use case is to invoke ``SearchProfilesRequest`` without this - field, then use the resulting ``result_set_id`` in - ``SearchProfilesResponse`` to page through the results. - strict_keywords_search (bool): This flag is used to indicate whether the service will attempt to - understand synonyms and terms related to the search query or treat the - query "as is" when it generates a set of results. By default this flag is - set to false, thus allowing expanded results to also be returned. For - example a search for "software engineer" might also return candidates who - have experience in jobs similar to software engineer positions. By setting - this flag to true, the service will only attempt to deliver candidates has - software engineer in his/her global fields by treating "software engineer" - as a keyword. - - It is recommended to provide a feature in the UI (such as a checkbox) to - allow recruiters to set this flag to true if they intend to search for - longer boolean strings. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.SummarizedProfile` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "search_profiles" not in self._inner_api_calls: - self._inner_api_calls[ - "search_profiles" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.search_profiles, - default_retry=self._method_configs["SearchProfiles"].retry, - default_timeout=self._method_configs["SearchProfiles"].timeout, - client_info=self._client_info, - ) - - request = profile_service_pb2.SearchProfilesRequest( - parent=parent, - request_metadata=request_metadata, - profile_query=profile_query, - page_size=page_size, - offset=offset, - disable_spell_check=disable_spell_check, - order_by=order_by, - case_sensitive_sort=case_sensitive_sort, - histogram_queries=histogram_queries, - result_set_id=result_set_id, - strict_keywords_search=strict_keywords_search, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["search_profiles"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="summarized_profiles", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/talent/google/cloud/talent_v4beta1/gapic/profile_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/profile_service_client_config.py deleted file mode 100644 index 3283e333c1a1..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/profile_service_client_config.py +++ /dev/null @@ -1,53 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.ProfileService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListProfiles": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateProfile": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetProfile": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProfile": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteProfile": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "SearchProfiles": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py b/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py deleted file mode 100644 index 1195e7dfaebe..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client.py +++ /dev/null @@ -1,636 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.talent.v4beta1 TenantService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.talent_v4beta1.gapic import enums -from google.cloud.talent_v4beta1.gapic import tenant_service_client_config -from google.cloud.talent_v4beta1.gapic.transports import tenant_service_grpc_transport -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import filters_pb2 -from google.cloud.talent_v4beta1.proto import histogram_pb2 -from google.cloud.talent_v4beta1.proto import job_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import profile_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2_grpc -from google.cloud.talent_v4beta1.proto import tenant_pb2 -from google.cloud.talent_v4beta1.proto import tenant_service_pb2 -from google.cloud.talent_v4beta1.proto import tenant_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-talent").version - - -class TenantServiceClient(object): - """A service that handles tenant management, including CRUD and enumeration.""" - - SERVICE_ADDRESS = "jobs.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.talent.v4beta1.TenantService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TenantServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project - ) - - @classmethod - def tenant_path(cls, project, tenant): - """Return a fully-qualified tenant string.""" - return google.api_core.path_template.expand( - "projects/{project}/tenants/{tenant}", project=project, tenant=tenant - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TenantServiceGrpcTransport, - Callable[[~.Credentials, type], ~.TenantServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = tenant_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=tenant_service_grpc_transport.TenantServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = tenant_service_grpc_transport.TenantServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_tenant( - self, - parent, - tenant, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new tenant entity. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.TenantServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `tenant`: - >>> tenant = {} - >>> - >>> response = client.create_tenant(parent, tenant) - - Args: - parent (str): Required. Resource name of the project under which the tenant is - created. - - The format is "projects/{project\_id}", for example, "projects/foo". - tenant (Union[dict, ~google.cloud.talent_v4beta1.types.Tenant]): Required. The tenant to be created. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Tenant` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Tenant` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_tenant" not in self._inner_api_calls: - self._inner_api_calls[ - "create_tenant" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_tenant, - default_retry=self._method_configs["CreateTenant"].retry, - default_timeout=self._method_configs["CreateTenant"].timeout, - client_info=self._client_info, - ) - - request = tenant_service_pb2.CreateTenantRequest(parent=parent, tenant=tenant) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_tenant"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def get_tenant( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Retrieves specified tenant. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.TenantServiceClient() - >>> - >>> name = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> response = client.get_tenant(name) - - Args: - name (str): Required. The resource name of the tenant to be retrieved. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenants/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Tenant` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_tenant" not in self._inner_api_calls: - self._inner_api_calls[ - "get_tenant" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_tenant, - default_retry=self._method_configs["GetTenant"].retry, - default_timeout=self._method_configs["GetTenant"].timeout, - client_info=self._client_info, - ) - - request = tenant_service_pb2.GetTenantRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_tenant"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_tenant( - self, - tenant, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Updates specified tenant. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.TenantServiceClient() - >>> - >>> # TODO: Initialize `tenant`: - >>> tenant = {} - >>> - >>> response = client.update_tenant(tenant) - - Args: - tenant (Union[dict, ~google.cloud.talent_v4beta1.types.Tenant]): Required. The tenant resource to replace the current resource in the system. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.Tenant` - update_mask (Union[dict, ~google.cloud.talent_v4beta1.types.FieldMask]): Strongly recommended for the best service experience. - - If ``update_mask`` is provided, only the specified fields in ``tenant`` - are updated. Otherwise all the fields are updated. - - A field mask to specify the tenant fields to be updated. Only top level - fields of ``Tenant`` are supported. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.talent_v4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.talent_v4beta1.types.Tenant` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_tenant" not in self._inner_api_calls: - self._inner_api_calls[ - "update_tenant" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_tenant, - default_retry=self._method_configs["UpdateTenant"].retry, - default_timeout=self._method_configs["UpdateTenant"].timeout, - client_info=self._client_info, - ) - - request = tenant_service_pb2.UpdateTenantRequest( - tenant=tenant, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("tenant.name", tenant.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_tenant"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_tenant( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes specified tenant. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.TenantServiceClient() - >>> - >>> name = client.tenant_path('[PROJECT]', '[TENANT]') - >>> - >>> client.delete_tenant(name) - - Args: - name (str): Required. The resource name of the tenant to be deleted. - - The format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenants/bar". - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_tenant" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_tenant" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_tenant, - default_retry=self._method_configs["DeleteTenant"].retry, - default_timeout=self._method_configs["DeleteTenant"].timeout, - client_info=self._client_info, - ) - - request = tenant_service_pb2.DeleteTenantRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_tenant"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_tenants( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists all tenants associated with the project. - - Example: - >>> from google.cloud import talent_v4beta1 - >>> - >>> client = talent_v4beta1.TenantServiceClient() - >>> - >>> parent = client.project_path('[PROJECT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_tenants(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_tenants(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Resource name of the project under which the tenant is - created. - - The format is "projects/{project\_id}", for example, "projects/foo". - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.talent_v4beta1.types.Tenant` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_tenants" not in self._inner_api_calls: - self._inner_api_calls[ - "list_tenants" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_tenants, - default_retry=self._method_configs["ListTenants"].retry, - default_timeout=self._method_configs["ListTenants"].timeout, - client_info=self._client_info, - ) - - request = tenant_service_pb2.ListTenantsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_tenants"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="tenants", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator diff --git a/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client_config.py b/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client_config.py deleted file mode 100644 index bc0084357cff..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/tenant_service_client_config.py +++ /dev/null @@ -1,48 +0,0 @@ -config = { - "interfaces": { - "google.cloud.talent.v4beta1.TenantService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 300000, - } - }, - "methods": { - "CreateTenant": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "GetTenant": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateTenant": { - "timeout_millis": 30000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteTenant": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListTenants": { - "timeout_millis": 30000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/__init__.py b/talent/google/cloud/talent_v4beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/application_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/application_service_grpc_transport.py deleted file mode 100644 index 410f761e1863..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/application_service_grpc_transport.py +++ /dev/null @@ -1,178 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import application_service_pb2_grpc - - -class ApplicationServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 ApplicationService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "application_service_stub": application_service_pb2_grpc.ApplicationServiceStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_application(self): - """Return the gRPC stub for :meth:`ApplicationServiceClient.create_application`. - - Creates a new application entity. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["application_service_stub"].CreateApplication - - @property - def get_application(self): - """Return the gRPC stub for :meth:`ApplicationServiceClient.get_application`. - - Retrieves specified application. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["application_service_stub"].GetApplication - - @property - def update_application(self): - """Return the gRPC stub for :meth:`ApplicationServiceClient.update_application`. - - Updates specified application. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["application_service_stub"].UpdateApplication - - @property - def delete_application(self): - """Return the gRPC stub for :meth:`ApplicationServiceClient.delete_application`. - - Deletes specified application. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["application_service_stub"].DeleteApplication - - @property - def list_applications(self): - """Return the gRPC stub for :meth:`ApplicationServiceClient.list_applications`. - - Lists all applications associated with the profile. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["application_service_stub"].ListApplications diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/company_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/company_service_grpc_transport.py deleted file mode 100644 index 0eaa321400c5..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/company_service_grpc_transport.py +++ /dev/null @@ -1,177 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import company_service_pb2_grpc - - -class CompanyServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 CompanyService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "company_service_stub": company_service_pb2_grpc.CompanyServiceStub(channel) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_company(self): - """Return the gRPC stub for :meth:`CompanyServiceClient.create_company`. - - Creates a new company entity. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["company_service_stub"].CreateCompany - - @property - def get_company(self): - """Return the gRPC stub for :meth:`CompanyServiceClient.get_company`. - - Retrieves specified company. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["company_service_stub"].GetCompany - - @property - def update_company(self): - """Return the gRPC stub for :meth:`CompanyServiceClient.update_company`. - - Updates specified company. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["company_service_stub"].UpdateCompany - - @property - def delete_company(self): - """Return the gRPC stub for :meth:`CompanyServiceClient.delete_company`. - - Deletes specified company. - Prerequisite: The company has no jobs associated with it. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["company_service_stub"].DeleteCompany - - @property - def list_companies(self): - """Return the gRPC stub for :meth:`CompanyServiceClient.list_companies`. - - Lists all companies associated with the project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["company_service_stub"].ListCompanies diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/completion_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/completion_grpc_transport.py deleted file mode 100644 index f4258a86f804..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/completion_grpc_transport.py +++ /dev/null @@ -1,125 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import completion_service_pb2_grpc - - -class CompletionGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 Completion API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "completion_stub": completion_service_pb2_grpc.CompletionStub(channel) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def complete_query(self): - """Return the gRPC stub for :meth:`CompletionClient.complete_query`. - - Completes the specified prefix with keyword suggestions. - Intended for use by a job search auto-complete search box. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["completion_stub"].CompleteQuery diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/event_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/event_service_grpc_transport.py deleted file mode 100644 index b1ee752a0e4c..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/event_service_grpc_transport.py +++ /dev/null @@ -1,130 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import event_service_pb2_grpc - - -class EventServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 EventService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "event_service_stub": event_service_pb2_grpc.EventServiceStub(channel) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_client_event(self): - """Return the gRPC stub for :meth:`EventServiceClient.create_client_event`. - - Report events issued when end user interacts with customer's application - that uses Cloud Talent Solution. You may inspect the created events in - `self service - tools `__. - `Learn - more `__ - about self service tools. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["event_service_stub"].CreateClientEvent diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/job_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/job_service_grpc_transport.py deleted file mode 100644 index 60b8ccfca0fb..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/job_service_grpc_transport.py +++ /dev/null @@ -1,268 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.talent_v4beta1.proto import job_service_pb2_grpc - - -class JobServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 JobService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = {"job_service_stub": job_service_pb2_grpc.JobServiceStub(channel)} - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_job(self): - """Return the gRPC stub for :meth:`JobServiceClient.create_job`. - - Creates a new job. - - Typically, the job becomes searchable within 10 seconds, but it may take - up to 5 minutes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].CreateJob - - @property - def get_job(self): - """Return the gRPC stub for :meth:`JobServiceClient.get_job`. - - Retrieves the specified job, whose status is OPEN or recently EXPIRED - within the last 90 days. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].GetJob - - @property - def update_job(self): - """Return the gRPC stub for :meth:`JobServiceClient.update_job`. - - Updates specified job. - - Typically, updated contents become visible in search results within 10 - seconds, but it may take up to 5 minutes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].UpdateJob - - @property - def delete_job(self): - """Return the gRPC stub for :meth:`JobServiceClient.delete_job`. - - Deletes the specified job. - - Typically, the job becomes unsearchable within 10 seconds, but it may take - up to 5 minutes. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].DeleteJob - - @property - def list_jobs(self): - """Return the gRPC stub for :meth:`JobServiceClient.list_jobs`. - - Lists jobs by filter. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].ListJobs - - @property - def batch_delete_jobs(self): - """Return the gRPC stub for :meth:`JobServiceClient.batch_delete_jobs`. - - Deletes a list of ``Job``\ s by filter. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].BatchDeleteJobs - - @property - def search_jobs(self): - """Return the gRPC stub for :meth:`JobServiceClient.search_jobs`. - - Searches for jobs using the provided ``SearchJobsRequest``. - - This call constrains the ``visibility`` of jobs present in the database, - and only returns jobs that the caller has permission to search against. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].SearchJobs - - @property - def search_jobs_for_alert(self): - """Return the gRPC stub for :meth:`JobServiceClient.search_jobs_for_alert`. - - Searches for jobs using the provided ``SearchJobsRequest``. - - This API call is intended for the use case of targeting passive job - seekers (for example, job seekers who have signed up to receive email - alerts about potential job opportunities), and has different algorithmic - adjustments that are targeted to passive job seekers. - - This call constrains the ``visibility`` of jobs present in the database, - and only returns jobs the caller has permission to search against. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].SearchJobsForAlert - - @property - def batch_create_jobs(self): - """Return the gRPC stub for :meth:`JobServiceClient.batch_create_jobs`. - - Begins executing a batch create jobs operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].BatchCreateJobs - - @property - def batch_update_jobs(self): - """Return the gRPC stub for :meth:`JobServiceClient.batch_update_jobs`. - - Begins executing a batch update jobs operation. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["job_service_stub"].BatchUpdateJobs diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/profile_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/profile_service_grpc_transport.py deleted file mode 100644 index a2db5593af55..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/profile_service_grpc_transport.py +++ /dev/null @@ -1,197 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import profile_service_pb2_grpc - - -class ProfileServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 ProfileService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "profile_service_stub": profile_service_pb2_grpc.ProfileServiceStub(channel) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_profiles(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.list_profiles`. - - Lists profiles by filter. The order is unspecified. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].ListProfiles - - @property - def create_profile(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.create_profile`. - - Creates and returns a new profile. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].CreateProfile - - @property - def get_profile(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.get_profile`. - - Gets the specified profile. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].GetProfile - - @property - def update_profile(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.update_profile`. - - Updates the specified profile and returns the updated result. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].UpdateProfile - - @property - def delete_profile(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.delete_profile`. - - Deletes the specified profile. - Prerequisite: The profile has no associated applications or assignments - associated. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].DeleteProfile - - @property - def search_profiles(self): - """Return the gRPC stub for :meth:`ProfileServiceClient.search_profiles`. - - Searches for profiles within a tenant. - - For example, search by raw queries "software engineer in Mountain View" - or search by structured filters (location filter, education filter, - etc.). - - See ``SearchProfilesRequest`` for more information. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["profile_service_stub"].SearchProfiles diff --git a/talent/google/cloud/talent_v4beta1/gapic/transports/tenant_service_grpc_transport.py b/talent/google/cloud/talent_v4beta1/gapic/transports/tenant_service_grpc_transport.py deleted file mode 100644 index dff6e16e8948..000000000000 --- a/talent/google/cloud/talent_v4beta1/gapic/transports/tenant_service_grpc_transport.py +++ /dev/null @@ -1,176 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.talent_v4beta1.proto import tenant_service_pb2_grpc - - -class TenantServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.talent.v4beta1 TenantService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/jobs", - ) - - def __init__( - self, channel=None, credentials=None, address="jobs.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "tenant_service_stub": tenant_service_pb2_grpc.TenantServiceStub(channel) - } - - @classmethod - def create_channel( - cls, address="jobs.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_tenant(self): - """Return the gRPC stub for :meth:`TenantServiceClient.create_tenant`. - - Creates a new tenant entity. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["tenant_service_stub"].CreateTenant - - @property - def get_tenant(self): - """Return the gRPC stub for :meth:`TenantServiceClient.get_tenant`. - - Retrieves specified tenant. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["tenant_service_stub"].GetTenant - - @property - def update_tenant(self): - """Return the gRPC stub for :meth:`TenantServiceClient.update_tenant`. - - Updates specified tenant. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["tenant_service_stub"].UpdateTenant - - @property - def delete_tenant(self): - """Return the gRPC stub for :meth:`TenantServiceClient.delete_tenant`. - - Deletes specified tenant. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["tenant_service_stub"].DeleteTenant - - @property - def list_tenants(self): - """Return the gRPC stub for :meth:`TenantServiceClient.list_tenants`. - - Lists all tenants associated with the project. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["tenant_service_stub"].ListTenants diff --git a/talent/google/cloud/talent_v4beta1/proto/__init__.py b/talent/google/cloud/talent_v4beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/talent/google/cloud/talent_v4beta1/proto/application.proto b/talent/google/cloud/talent_v4beta1/proto/application.proto deleted file mode 100644 index 3efcab00943d..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application.proto +++ /dev/null @@ -1,185 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "ApplicationResourceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// Resource that represents a job application record of a candidate. -message Application { - option (google.api.resource) = { - type: "jobs.googleapis.com/Application" - pattern: "projects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}" - }; - - // Enum that represents the application status. - enum ApplicationState { - // Default value. - APPLICATION_STATE_UNSPECIFIED = 0; - - // The current stage is in progress or pending, for example, interviews in - // progress. - IN_PROGRESS = 1; - - // The current stage was terminated by a candidate decision. - CANDIDATE_WITHDREW = 2; - - // The current stage was terminated by an employer or agency decision. - EMPLOYER_WITHDREW = 3; - - // The current stage is successfully completed, but the next stage (if - // applicable) has not begun. - COMPLETED = 4; - - // The current stage was closed without an exception, or terminated for - // reasons unrealated to the candidate. - CLOSED = 5; - } - - // The stage of the application. - enum ApplicationStage { - // Default value. - APPLICATION_STAGE_UNSPECIFIED = 0; - - // Candidate has applied or a recruiter put candidate into consideration but - // candidate is not yet screened / no decision has been made to move or not - // move the candidate to the next stage. - NEW = 1; - - // A recruiter decided to screen the candidate for this role. - SCREEN = 2; - - // Candidate is being / was sent to the customer / hiring manager for - // detailed review. - HIRING_MANAGER_REVIEW = 3; - - // Candidate was approved by the client / hiring manager and is being / was - // interviewed for the role. - INTERVIEW = 4; - - // Candidate will be / has been given an offer of employment. - OFFER_EXTENDED = 5; - - // Candidate has accepted their offer of employment. - OFFER_ACCEPTED = 6; - - // Candidate has begun (or completed) their employment or assignment with - // the employer. - STARTED = 7; - } - - // Required during application update. - // - // Resource name assigned to an application by the API. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". - // For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". - string name = 1; - - // Required. Client side application identifier, used to uniquely identify the - // application. - // - // The maximum number of allowed characters is 255. - string external_id = 31 [(google.api.field_behavior) = REQUIRED]; - - // Output only. Resource name of the candidate of this application. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". - // For example, "projects/foo/tenants/bar/profiles/baz". - string profile = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // One of either a job or a company is required. - // - // Resource name of the job which the candidate applied for. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For example, - // "projects/foo/tenants/bar/jobs/baz". - string job = 4 [(google.api.resource_reference) = { - type: "jobs.googleapis.com/Job" - }]; - - // One of either a job or a company is required. - // - // Resource name of the company which the candidate applied for. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". - // For example, "projects/foo/tenants/bar/companies/baz". - string company = 5 [(google.api.resource_reference) = { - type: "jobs.googleapis.com/Company" - }]; - - // The application date. - google.type.Date application_date = 7; - - // Required. What is the most recent stage of the application (that is, new, screen, - // send cv, hired, finished work)? This field is intentionally not - // comprehensive of every possible status, but instead, represents statuses - // that would be used to indicate to the ML models good / bad matches. - ApplicationStage stage = 11 [(google.api.field_behavior) = REQUIRED]; - - // The application state. - ApplicationState state = 13; - - // All interviews (screen, onsite, and so on) conducted as part of this - // application (includes details such as user conducting the interview, - // timestamp, feedback, and so on). - repeated Interview interviews = 16; - - // If the candidate is referred by a employee. - google.protobuf.BoolValue referral = 18; - - // Required. Reflects the time that the application was created. - google.protobuf.Timestamp create_time = 19 [(google.api.field_behavior) = REQUIRED]; - - // The last update timestamp. - google.protobuf.Timestamp update_time = 20; - - // Free text reason behind the recruitement outcome (for example, reason for - // withdraw / reject, reason for an unsuccessful finish, and so on). - // - // Number of characters allowed is 100. - string outcome_notes = 21; - - // Outcome positiveness shows how positive the outcome is. - Outcome outcome = 22; - - // Output only. Indicates whether this job application is a match to - // application related filters. This value is only applicable in profile - // search response. - google.protobuf.BoolValue is_match = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Job title snippet shows how the job title is related to a - // search query. It's empty if the job title isn't related to the search - // query. - string job_title_snippet = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/application_pb2.py b/talent/google/cloud/talent_v4beta1/proto/application_pb2.py deleted file mode 100644 index b8e8a5bff80c..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application_pb2.py +++ /dev/null @@ -1,570 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/application.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/application.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\030ApplicationResourceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n3google/cloud/talent_v4beta1/proto/application.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x1cgoogle/api/annotations.proto"\x99\t\n\x0b\x41pplication\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x1f \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07profile\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12)\n\x03job\x18\x04 \x01(\tB\x1c\xfa\x41\x19\n\x17jobs.googleapis.com/Job\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12+\n\x10\x61pplication_date\x18\x07 \x01(\x0b\x32\x11.google.type.Date\x12M\n\x05stage\x18\x0b \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.Application.ApplicationStageB\x03\xe0\x41\x02\x12H\n\x05state\x18\r \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.Application.ApplicationState\x12:\n\ninterviews\x18\x10 \x03(\x0b\x32&.google.cloud.talent.v4beta1.Interview\x12,\n\x08referral\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x34\n\x0b\x63reate_time\x18\x13 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12/\n\x0bupdate_time\x18\x14 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x15\n\routcome_notes\x18\x15 \x01(\t\x12\x35\n\x07outcome\x18\x16 \x01(\x0e\x32$.google.cloud.talent.v4beta1.Outcome\x12\x31\n\x08is_match\x18\x1c \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x03\x12\x1e\n\x11job_title_snippet\x18\x1d \x01(\tB\x03\xe0\x41\x03"\x90\x01\n\x10\x41pplicationState\x12!\n\x1d\x41PPLICATION_STATE_UNSPECIFIED\x10\x00\x12\x0f\n\x0bIN_PROGRESS\x10\x01\x12\x16\n\x12\x43\x41NDIDATE_WITHDREW\x10\x02\x12\x15\n\x11\x45MPLOYER_WITHDREW\x10\x03\x12\r\n\tCOMPLETED\x10\x04\x12\n\n\x06\x43LOSED\x10\x05"\xa9\x01\n\x10\x41pplicationStage\x12!\n\x1d\x41PPLICATION_STAGE_UNSPECIFIED\x10\x00\x12\x07\n\x03NEW\x10\x01\x12\n\n\x06SCREEN\x10\x02\x12\x19\n\x15HIRING_MANAGER_REVIEW\x10\x03\x12\r\n\tINTERVIEW\x10\x04\x12\x12\n\x0eOFFER_EXTENDED\x10\x05\x12\x12\n\x0eOFFER_ACCEPTED\x10\x06\x12\x0b\n\x07STARTED\x10\x07:w\xea\x41t\n\x1fjobs.googleapis.com/Application\x12Qprojects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}B\x86\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x18\x41pplicationResourceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, - google_dot_type_dot_date__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_APPLICATION_APPLICATIONSTATE = _descriptor.EnumDescriptor( - name="ApplicationState", - full_name="google.cloud.talent.v4beta1.Application.ApplicationState", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="APPLICATION_STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IN_PROGRESS", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANDIDATE_WITHDREW", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EMPLOYER_WITHDREW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COMPLETED", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CLOSED", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1052, - serialized_end=1196, -) -_sym_db.RegisterEnumDescriptor(_APPLICATION_APPLICATIONSTATE) - -_APPLICATION_APPLICATIONSTAGE = _descriptor.EnumDescriptor( - name="ApplicationStage", - full_name="google.cloud.talent.v4beta1.Application.ApplicationStage", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="APPLICATION_STAGE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NEW", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SCREEN", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HIRING_MANAGER_REVIEW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INTERVIEW", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OFFER_EXTENDED", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OFFER_ACCEPTED", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STARTED", index=7, number=7, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1199, - serialized_end=1368, -) -_sym_db.RegisterEnumDescriptor(_APPLICATION_APPLICATIONSTAGE) - - -_APPLICATION = _descriptor.Descriptor( - name="Application", - full_name="google.cloud.talent.v4beta1.Application", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.Application.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="external_id", - full_name="google.cloud.talent.v4beta1.Application.external_id", - index=1, - number=31, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profile", - full_name="google.cloud.talent.v4beta1.Application.profile", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.talent.v4beta1.Application.job", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\372A\031\n\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company", - full_name="google.cloud.talent.v4beta1.Application.company", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\372A\035\n\033jobs.googleapis.com/Company"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application_date", - full_name="google.cloud.talent.v4beta1.Application.application_date", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stage", - full_name="google.cloud.talent.v4beta1.Application.stage", - index=6, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.talent.v4beta1.Application.state", - index=7, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="interviews", - full_name="google.cloud.talent.v4beta1.Application.interviews", - index=8, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="referral", - full_name="google.cloud.talent.v4beta1.Application.referral", - index=9, - number=18, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.talent.v4beta1.Application.create_time", - index=10, - number=19, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.talent.v4beta1.Application.update_time", - index=11, - number=20, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="outcome_notes", - full_name="google.cloud.talent.v4beta1.Application.outcome_notes", - index=12, - number=21, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="outcome", - full_name="google.cloud.talent.v4beta1.Application.outcome", - index=13, - number=22, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_match", - full_name="google.cloud.talent.v4beta1.Application.is_match", - index=14, - number=28, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title_snippet", - full_name="google.cloud.talent.v4beta1.Application.job_title_snippet", - index=15, - number=29, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_APPLICATION_APPLICATIONSTATE, _APPLICATION_APPLICATIONSTAGE], - serialized_options=_b( - "\352At\n\037jobs.googleapis.com/Application\022Qprojects/{project}/tenants/{tenant}/profiles/{profile}/applications/{application}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=312, - serialized_end=1489, -) - -_APPLICATION.fields_by_name[ - "application_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_APPLICATION.fields_by_name["stage"].enum_type = _APPLICATION_APPLICATIONSTAGE -_APPLICATION.fields_by_name["state"].enum_type = _APPLICATION_APPLICATIONSTATE -_APPLICATION.fields_by_name[ - "interviews" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._INTERVIEW -) -_APPLICATION.fields_by_name[ - "referral" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_APPLICATION.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_APPLICATION.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_APPLICATION.fields_by_name[ - "outcome" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._OUTCOME -_APPLICATION.fields_by_name[ - "is_match" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_APPLICATION_APPLICATIONSTATE.containing_type = _APPLICATION -_APPLICATION_APPLICATIONSTAGE.containing_type = _APPLICATION -DESCRIPTOR.message_types_by_name["Application"] = _APPLICATION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Application = _reflection.GeneratedProtocolMessageType( - "Application", - (_message.Message,), - dict( - DESCRIPTOR=_APPLICATION, - __module__="google.cloud.talent_v4beta1.proto.application_pb2", - __doc__="""Resource that represents a job application record of a - candidate. - - - Attributes: - name: - Required during application update. Resource name assigned to - an application by the API. The format is "projects/{project\_ - id}/tenants/{tenant\_id}/profiles/{profile\_id}/applications/{ - application\_id}". For example, - "projects/foo/tenants/bar/profiles/baz/applications/qux". - external_id: - Required. Client side application identifier, used to uniquely - identify the application. The maximum number of allowed - characters is 255. - profile: - Output only. Resource name of the candidate of this - application. The format is "projects/{project\_id}/tenants/{t - enant\_id}/profiles/{profile\_id}". For example, - "projects/foo/tenants/bar/profiles/baz". - job: - One of either a job or a company is required. Resource name - of the job which the candidate applied for. The format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". - For example, "projects/foo/tenants/bar/jobs/baz". - company: - One of either a job or a company is required. Resource name - of the company which the candidate applied for. The format is - "projects/{project\_id}/tenants/{tenant\_id}/companies/{compan - y\_id}". For example, - "projects/foo/tenants/bar/companies/baz". - application_date: - The application date. - stage: - Required. What is the most recent stage of the application - (that is, new, screen, send cv, hired, finished work)? This - field is intentionally not comprehensive of every possible - status, but instead, represents statuses that would be used to - indicate to the ML models good / bad matches. - state: - The application state. - interviews: - All interviews (screen, onsite, and so on) conducted as part - of this application (includes details such as user conducting - the interview, timestamp, feedback, and so on). - referral: - If the candidate is referred by a employee. - create_time: - Required. Reflects the time that the application was created. - update_time: - The last update timestamp. - outcome_notes: - Free text reason behind the recruitement outcome (for example, - reason for withdraw / reject, reason for an unsuccessful - finish, and so on). Number of characters allowed is 100. - outcome: - Outcome positiveness shows how positive the outcome is. - is_match: - Output only. Indicates whether this job application is a match - to application related filters. This value is only applicable - in profile search response. - job_title_snippet: - Output only. Job title snippet shows how the job title is - related to a search query. It's empty if the job title isn't - related to the search query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Application) - ), -) -_sym_db.RegisterMessage(Application) - - -DESCRIPTOR._options = None -_APPLICATION.fields_by_name["external_id"]._options = None -_APPLICATION.fields_by_name["profile"]._options = None -_APPLICATION.fields_by_name["job"]._options = None -_APPLICATION.fields_by_name["company"]._options = None -_APPLICATION.fields_by_name["stage"]._options = None -_APPLICATION.fields_by_name["create_time"]._options = None -_APPLICATION.fields_by_name["is_match"]._options = None -_APPLICATION.fields_by_name["job_title_snippet"]._options = None -_APPLICATION._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/application_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/application_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/application_service.proto b/talent/google/cloud/talent_v4beta1/proto/application_service.proto deleted file mode 100644 index bfa38296fd4b..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application_service.proto +++ /dev/null @@ -1,182 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/application.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "ApplicationServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service that handles application management, including CRUD and -// enumeration. -service ApplicationService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Creates a new application entity. - rpc CreateApplication(CreateApplicationRequest) returns (Application) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications" - body: "*" - }; - option (google.api.method_signature) = "parent,application"; - } - - // Retrieves specified application. - rpc GetApplication(GetApplicationRequest) returns (Application) { - option (google.api.http) = { - get: "/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates specified application. - rpc UpdateApplication(UpdateApplicationRequest) returns (Application) { - option (google.api.http) = { - patch: "/v4beta1/{application.name=projects/*/tenants/*/profiles/*/applications/*}" - body: "*" - }; - option (google.api.method_signature) = "application"; - } - - // Deletes specified application. - rpc DeleteApplication(DeleteApplicationRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all applications associated with the profile. - rpc ListApplications(ListApplicationsRequest) returns (ListApplicationsResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications" - }; - option (google.api.method_signature) = "parent"; - } -} - -// The Request of the CreateApplication method. -message CreateApplicationRequest { - // Required. Resource name of the profile under which the application is created. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". - // For example, "projects/foo/tenants/bar/profiles/baz". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Profile" - } - ]; - - // Required. The application to be created. - Application application = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for getting a application by name. -message GetApplicationRequest { - // Required. The resource name of the application to be retrieved. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". - // For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Application" - } - ]; -} - -// Request for updating a specified application. -message UpdateApplicationRequest { - // Required. The application resource to replace the current resource in the system. - Application application = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. - // - // If [update_mask][google.cloud.talent.v4beta1.UpdateApplicationRequest.update_mask] is provided, only the specified fields in - // [application][google.cloud.talent.v4beta1.UpdateApplicationRequest.application] are updated. Otherwise all the fields are updated. - // - // A field mask to specify the application fields to be updated. Only - // top level fields of [Application][google.cloud.talent.v4beta1.Application] are supported. - google.protobuf.FieldMask update_mask = 2; -} - -// Request to delete a application. -message DeleteApplicationRequest { - // Required. The resource name of the application to be deleted. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}/applications/{application_id}". - // For example, "projects/foo/tenants/bar/profiles/baz/applications/qux". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Application" - } - ]; -} - -// List applications for which the client has ACL visibility. -message ListApplicationsRequest { - // Required. Resource name of the profile under which the application is created. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", for - // example, "projects/foo/tenants/bar/profiles/baz". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Profile" - } - ]; - - // The starting indicator from which to return results. - string page_token = 2; - - // The maximum number of applications to be returned, at most 100. - // Default is 100 if a non-positive number is provided. - int32 page_size = 3; -} - -// The List applications response object. -message ListApplicationsResponse { - // Applications for the current client. - repeated Application applications = 1; - - // A token to retrieve the next page of results. - string next_page_token = 2; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 3; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/application_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/application_service_pb2.py deleted file mode 100644 index 2d2df62b488f..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application_service_pb2.py +++ /dev/null @@ -1,661 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/application_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - application_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/application_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\027ApplicationServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n;google/cloud/talent_v4beta1/proto/application_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x33google/cloud/talent_v4beta1/proto/application.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x93\x01\n\x18\x43reateApplicationRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Profile\x12\x42\n\x0b\x61pplication\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4beta1.ApplicationB\x03\xe0\x41\x02"N\n\x15GetApplicationRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fjobs.googleapis.com/Application"\x8f\x01\n\x18UpdateApplicationRequest\x12\x42\n\x0b\x61pplication\x18\x01 \x01(\x0b\x32(.google.cloud.talent.v4beta1.ApplicationB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"Q\n\x18\x44\x65leteApplicationRequest\x12\x35\n\x04name\x18\x01 \x01(\tB\'\xe0\x41\x02\xfa\x41!\n\x1fjobs.googleapis.com/Application"u\n\x17ListApplicationsRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Profile\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"\xb4\x01\n\x18ListApplicationsResponse\x12>\n\x0c\x61pplications\x18\x01 \x03(\x0b\x32(.google.cloud.talent.v4beta1.Application\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xfc\x08\n\x12\x41pplicationService\x12\xd4\x01\n\x11\x43reateApplication\x12\x35.google.cloud.talent.v4beta1.CreateApplicationRequest\x1a(.google.cloud.talent.v4beta1.Application"^\x82\xd3\xe4\x93\x02\x43">/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications:\x01*\xda\x41\x12parent,application\x12\xbd\x01\n\x0eGetApplication\x12\x32.google.cloud.talent.v4beta1.GetApplicationRequest\x1a(.google.cloud.talent.v4beta1.Application"M\x82\xd3\xe4\x93\x02@\x12>/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}\xda\x41\x04name\x12\xd9\x01\n\x11UpdateApplication\x12\x35.google.cloud.talent.v4beta1.UpdateApplicationRequest\x1a(.google.cloud.talent.v4beta1.Application"c\x82\xd3\xe4\x93\x02O2J/v4beta1/{application.name=projects/*/tenants/*/profiles/*/applications/*}:\x01*\xda\x41\x0b\x61pplication\x12\xb1\x01\n\x11\x44\x65leteApplication\x12\x35.google.cloud.talent.v4beta1.DeleteApplicationRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}\xda\x41\x04name\x12\xd0\x01\n\x10ListApplications\x12\x34.google.cloud.talent.v4beta1.ListApplicationsRequest\x1a\x35.google.cloud.talent.v4beta1.ListApplicationsResponse"O\x82\xd3\xe4\x93\x02@\x12>/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications\xda\x41\x06parent\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x85\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x17\x41pplicationServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATEAPPLICATIONREQUEST = _descriptor.Descriptor( - name="CreateApplicationRequest", - full_name="google.cloud.talent.v4beta1.CreateApplicationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateApplicationRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Profile" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application", - full_name="google.cloud.talent.v4beta1.CreateApplicationRequest.application", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=372, - serialized_end=519, -) - - -_GETAPPLICATIONREQUEST = _descriptor.Descriptor( - name="GetApplicationRequest", - full_name="google.cloud.talent.v4beta1.GetApplicationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.GetApplicationRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\n\037jobs.googleapis.com/Application" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=521, - serialized_end=599, -) - - -_UPDATEAPPLICATIONREQUEST = _descriptor.Descriptor( - name="UpdateApplicationRequest", - full_name="google.cloud.talent.v4beta1.UpdateApplicationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="application", - full_name="google.cloud.talent.v4beta1.UpdateApplicationRequest.application", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.UpdateApplicationRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=602, - serialized_end=745, -) - - -_DELETEAPPLICATIONREQUEST = _descriptor.Descriptor( - name="DeleteApplicationRequest", - full_name="google.cloud.talent.v4beta1.DeleteApplicationRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.DeleteApplicationRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A!\n\037jobs.googleapis.com/Application" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=747, - serialized_end=828, -) - - -_LISTAPPLICATIONSREQUEST = _descriptor.Descriptor( - name="ListApplicationsRequest", - full_name="google.cloud.talent.v4beta1.ListApplicationsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.ListApplicationsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Profile" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.ListApplicationsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.ListApplicationsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=830, - serialized_end=947, -) - - -_LISTAPPLICATIONSRESPONSE = _descriptor.Descriptor( - name="ListApplicationsResponse", - full_name="google.cloud.talent.v4beta1.ListApplicationsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="applications", - full_name="google.cloud.talent.v4beta1.ListApplicationsResponse.applications", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.ListApplicationsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.ListApplicationsResponse.metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=950, - serialized_end=1130, -) - -_CREATEAPPLICATIONREQUEST.fields_by_name[ - "application" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION -) -_UPDATEAPPLICATIONREQUEST.fields_by_name[ - "application" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION -) -_UPDATEAPPLICATIONREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTAPPLICATIONSRESPONSE.fields_by_name[ - "applications" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION -) -_LISTAPPLICATIONSRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -DESCRIPTOR.message_types_by_name["CreateApplicationRequest"] = _CREATEAPPLICATIONREQUEST -DESCRIPTOR.message_types_by_name["GetApplicationRequest"] = _GETAPPLICATIONREQUEST -DESCRIPTOR.message_types_by_name["UpdateApplicationRequest"] = _UPDATEAPPLICATIONREQUEST -DESCRIPTOR.message_types_by_name["DeleteApplicationRequest"] = _DELETEAPPLICATIONREQUEST -DESCRIPTOR.message_types_by_name["ListApplicationsRequest"] = _LISTAPPLICATIONSREQUEST -DESCRIPTOR.message_types_by_name["ListApplicationsResponse"] = _LISTAPPLICATIONSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateApplicationRequest = _reflection.GeneratedProtocolMessageType( - "CreateApplicationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEAPPLICATIONREQUEST, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""The Request of the CreateApplication method. - - - Attributes: - parent: - Required. Resource name of the profile under which the - application is created. The format is "projects/{project\_id} - /tenants/{tenant\_id}/profiles/{profile\_id}". For example, - "projects/foo/tenants/bar/profiles/baz". - application: - Required. The application to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateApplicationRequest) - ), -) -_sym_db.RegisterMessage(CreateApplicationRequest) - -GetApplicationRequest = _reflection.GeneratedProtocolMessageType( - "GetApplicationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETAPPLICATIONREQUEST, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""Request for getting a application by name. - - - Attributes: - name: - Required. The resource name of the application to be - retrieved. The format is "projects/{project\_id}/tenants/{ten - ant\_id}/profiles/{profile\_id}/applications/{application\_id} - ". For example, - "projects/foo/tenants/bar/profiles/baz/applications/qux". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.GetApplicationRequest) - ), -) -_sym_db.RegisterMessage(GetApplicationRequest) - -UpdateApplicationRequest = _reflection.GeneratedProtocolMessageType( - "UpdateApplicationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEAPPLICATIONREQUEST, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""Request for updating a specified application. - - - Attributes: - application: - Required. The application resource to replace the current - resource in the system. - update_mask: - Strongly recommended for the best service experience. If [upd - ate\_mask][google.cloud.talent.v4beta1.UpdateApplicationReques - t.update\_mask] is provided, only the specified fields in [app - lication][google.cloud.talent.v4beta1.UpdateApplicationRequest - .application] are updated. Otherwise all the fields are - updated. A field mask to specify the application fields to be - updated. Only top level fields of - [Application][google.cloud.talent.v4beta1.Application] are - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.UpdateApplicationRequest) - ), -) -_sym_db.RegisterMessage(UpdateApplicationRequest) - -DeleteApplicationRequest = _reflection.GeneratedProtocolMessageType( - "DeleteApplicationRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEAPPLICATIONREQUEST, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""Request to delete a application. - - - Attributes: - name: - Required. The resource name of the application to be deleted. - The format is "projects/{project\_id}/tenants/{tenant\_id}/pro - files/{profile\_id}/applications/{application\_id}". For - example, - "projects/foo/tenants/bar/profiles/baz/applications/qux". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeleteApplicationRequest) - ), -) -_sym_db.RegisterMessage(DeleteApplicationRequest) - -ListApplicationsRequest = _reflection.GeneratedProtocolMessageType( - "ListApplicationsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTAPPLICATIONSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""List applications for which the client has ACL visibility. - - - Attributes: - parent: - Required. Resource name of the profile under which the - application is created. The format is "projects/{project\_id} - /tenants/{tenant\_id}/profiles/{profile\_id}", for example, - "projects/foo/tenants/bar/profiles/baz". - page_token: - The starting indicator from which to return results. - page_size: - The maximum number of applications to be returned, at most - 100. Default is 100 if a non-positive number is provided. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListApplicationsRequest) - ), -) -_sym_db.RegisterMessage(ListApplicationsRequest) - -ListApplicationsResponse = _reflection.GeneratedProtocolMessageType( - "ListApplicationsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTAPPLICATIONSRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.application_service_pb2", - __doc__="""The List applications response object. - - - Attributes: - applications: - Applications for the current client. - next_page_token: - A token to retrieve the next page of results. - metadata: - Additional information for the API invocation, such as the - request tracking id. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListApplicationsResponse) - ), -) -_sym_db.RegisterMessage(ListApplicationsResponse) - - -DESCRIPTOR._options = None -_CREATEAPPLICATIONREQUEST.fields_by_name["parent"]._options = None -_CREATEAPPLICATIONREQUEST.fields_by_name["application"]._options = None -_GETAPPLICATIONREQUEST.fields_by_name["name"]._options = None -_UPDATEAPPLICATIONREQUEST.fields_by_name["application"]._options = None -_DELETEAPPLICATIONREQUEST.fields_by_name["name"]._options = None -_LISTAPPLICATIONSREQUEST.fields_by_name["parent"]._options = None - -_APPLICATIONSERVICE = _descriptor.ServiceDescriptor( - name="ApplicationService", - full_name="google.cloud.talent.v4beta1.ApplicationService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=1133, - serialized_end=2281, - methods=[ - _descriptor.MethodDescriptor( - name="CreateApplication", - full_name="google.cloud.talent.v4beta1.ApplicationService.CreateApplication", - index=0, - containing_service=None, - input_type=_CREATEAPPLICATIONREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION, - serialized_options=_b( - '\202\323\344\223\002C">/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications:\001*\332A\022parent,application' - ), - ), - _descriptor.MethodDescriptor( - name="GetApplication", - full_name="google.cloud.talent.v4beta1.ApplicationService.GetApplication", - index=1, - containing_service=None, - input_type=_GETAPPLICATIONREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION, - serialized_options=_b( - "\202\323\344\223\002@\022>/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateApplication", - full_name="google.cloud.talent.v4beta1.ApplicationService.UpdateApplication", - index=2, - containing_service=None, - input_type=_UPDATEAPPLICATIONREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2._APPLICATION, - serialized_options=_b( - "\202\323\344\223\002O2J/v4beta1/{application.name=projects/*/tenants/*/profiles/*/applications/*}:\001*\332A\013application" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteApplication", - full_name="google.cloud.talent.v4beta1.ApplicationService.DeleteApplication", - index=3, - containing_service=None, - input_type=_DELETEAPPLICATIONREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002@*>/v4beta1/{name=projects/*/tenants/*/profiles/*/applications/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListApplications", - full_name="google.cloud.talent.v4beta1.ApplicationService.ListApplications", - index=4, - containing_service=None, - input_type=_LISTAPPLICATIONSREQUEST, - output_type=_LISTAPPLICATIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v4beta1/{parent=projects/*/tenants/*/profiles/*}/applications\332A\006parent" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_APPLICATIONSERVICE) - -DESCRIPTOR.services_by_name["ApplicationService"] = _APPLICATIONSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/application_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/application_service_pb2_grpc.py deleted file mode 100644 index 7243e94262b2..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/application_service_pb2_grpc.py +++ /dev/null @@ -1,123 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - application_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - application_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ApplicationServiceStub(object): - """A service that handles application management, including CRUD and - enumeration. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateApplication = channel.unary_unary( - "/google.cloud.talent.v4beta1.ApplicationService/CreateApplication", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.CreateApplicationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.FromString, - ) - self.GetApplication = channel.unary_unary( - "/google.cloud.talent.v4beta1.ApplicationService/GetApplication", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.GetApplicationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.FromString, - ) - self.UpdateApplication = channel.unary_unary( - "/google.cloud.talent.v4beta1.ApplicationService/UpdateApplication", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.UpdateApplicationRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.FromString, - ) - self.DeleteApplication = channel.unary_unary( - "/google.cloud.talent.v4beta1.ApplicationService/DeleteApplication", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.DeleteApplicationRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListApplications = channel.unary_unary( - "/google.cloud.talent.v4beta1.ApplicationService/ListApplications", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.ListApplicationsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.ListApplicationsResponse.FromString, - ) - - -class ApplicationServiceServicer(object): - """A service that handles application management, including CRUD and - enumeration. - """ - - def CreateApplication(self, request, context): - """Creates a new application entity. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetApplication(self, request, context): - """Retrieves specified application. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateApplication(self, request, context): - """Updates specified application. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteApplication(self, request, context): - """Deletes specified application. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListApplications(self, request, context): - """Lists all applications associated with the profile. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ApplicationServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateApplication": grpc.unary_unary_rpc_method_handler( - servicer.CreateApplication, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.CreateApplicationRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.SerializeToString, - ), - "GetApplication": grpc.unary_unary_rpc_method_handler( - servicer.GetApplication, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.GetApplicationRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.SerializeToString, - ), - "UpdateApplication": grpc.unary_unary_rpc_method_handler( - servicer.UpdateApplication, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.UpdateApplicationRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__pb2.Application.SerializeToString, - ), - "DeleteApplication": grpc.unary_unary_rpc_method_handler( - servicer.DeleteApplication, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.DeleteApplicationRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListApplications": grpc.unary_unary_rpc_method_handler( - servicer.ListApplications, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.ListApplicationsRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_application__service__pb2.ListApplicationsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.ApplicationService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/batch.proto b/talent/google/cloud/talent_v4beta1/proto/batch.proto deleted file mode 100644 index 577a304d34fb..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/batch.proto +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "BatchProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; diff --git a/talent/google/cloud/talent_v4beta1/proto/batch_pb2.py b/talent/google/cloud/talent_v4beta1/proto/batch_pb2.py deleted file mode 100644 index 8570369db736..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/batch_pb2.py +++ /dev/null @@ -1,39 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/batch.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/batch.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\nBatchProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - "\n-google/cloud/talent_v4beta1/proto/batch.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.protoBx\n\x1f\x63om.google.cloud.talent.v4beta1B\nBatchProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3" - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/batch_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/batch_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/batch_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/common.proto b/talent/google/cloud/talent_v4beta1/proto/common.proto deleted file mode 100644 index 2524a492d4d8..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/common.proto +++ /dev/null @@ -1,1074 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/latlng.proto"; -import "google/type/money.proto"; -import "google/type/postal_address.proto"; -import "google/type/timeofday.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "CommonProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// Message representing a period of time between two timestamps. -message TimestampRange { - // Begin of the period (inclusive). - google.protobuf.Timestamp start_time = 1; - - // End of the period (exclusive). - google.protobuf.Timestamp end_time = 2; -} - -// A resource that represents a location with full geographic information. -message Location { - // An enum which represents the type of a location. - enum LocationType { - // Default value if the type isn't specified. - LOCATION_TYPE_UNSPECIFIED = 0; - - // A country level location. - COUNTRY = 1; - - // A state or equivalent level location. - ADMINISTRATIVE_AREA = 2; - - // A county or equivalent level location. - SUB_ADMINISTRATIVE_AREA = 3; - - // A city or equivalent level location. - LOCALITY = 4; - - // A postal code level location. - POSTAL_CODE = 5; - - // A sublocality is a subdivision of a locality, for example a city borough, - // ward, or arrondissement. Sublocalities are usually recognized by a local - // political authority. For example, Manhattan and Brooklyn are recognized - // as boroughs by the City of New York, and are therefore modeled as - // sublocalities. - SUB_LOCALITY = 6; - - // A district or equivalent level location. - SUB_LOCALITY_1 = 7; - - // A smaller district or equivalent level display. - SUB_LOCALITY_2 = 8; - - // A neighborhood level location. - NEIGHBORHOOD = 9; - - // A street address level location. - STREET_ADDRESS = 10; - } - - // The type of a location, which corresponds to the address lines field of - // [google.type.PostalAddress][google.type.PostalAddress]. For example, "Downtown, Atlanta, GA, USA" - // has a type of [LocationType.NEIGHBORHOOD][google.cloud.talent.v4beta1.Location.LocationType.NEIGHBORHOOD], and "Kansas City, KS, USA" - // has a type of [LocationType.LOCALITY][google.cloud.talent.v4beta1.Location.LocationType.LOCALITY]. - LocationType location_type = 1; - - // Postal address of the location that includes human readable information, - // such as postal delivery and payments addresses. Given a postal address, - // a postal service can deliver items to a premises, P.O. Box, or other - // delivery location. - google.type.PostalAddress postal_address = 2; - - // An object representing a latitude/longitude pair. - google.type.LatLng lat_lng = 3; - - // Radius in miles of the job location. This value is derived from the - // location bounding box in which a circle with the specified radius - // centered from [google.type.LatLng][google.type.LatLng] covers the area associated with the - // job location. - // For example, currently, "Mountain View, CA, USA" has a radius of - // 6.17 miles. - double radius_miles = 4; -} - -// An enum that represents the size of the company. -enum CompanySize { - // Default value if the size isn't specified. - COMPANY_SIZE_UNSPECIFIED = 0; - - // The company has less than 50 employees. - MINI = 1; - - // The company has between 50 and 99 employees. - SMALL = 2; - - // The company has between 100 and 499 employees. - SMEDIUM = 3; - - // The company has between 500 and 999 employees. - MEDIUM = 4; - - // The company has between 1,000 and 4,999 employees. - BIG = 5; - - // The company has between 5,000 and 9,999 employees. - BIGGER = 6; - - // The company has 10,000 or more employees. - GIANT = 7; -} - -// An enum that represents employee benefits included with the job. -enum JobBenefit { - // Default value if the type isn't specified. - JOB_BENEFIT_UNSPECIFIED = 0; - - // The job includes access to programs that support child care, such - // as daycare. - CHILD_CARE = 1; - - // The job includes dental services covered by a dental - // insurance plan. - DENTAL = 2; - - // The job offers specific benefits to domestic partners. - DOMESTIC_PARTNER = 3; - - // The job allows for a flexible work schedule. - FLEXIBLE_HOURS = 4; - - // The job includes health services covered by a medical insurance plan. - MEDICAL = 5; - - // The job includes a life insurance plan provided by the employer or - // available for purchase by the employee. - LIFE_INSURANCE = 6; - - // The job allows for a leave of absence to a parent to care for a newborn - // child. - PARENTAL_LEAVE = 7; - - // The job includes a workplace retirement plan provided by the - // employer or available for purchase by the employee. - RETIREMENT_PLAN = 8; - - // The job allows for paid time off due to illness. - SICK_DAYS = 9; - - // The job includes paid time off for vacation. - VACATION = 10; - - // The job includes vision services covered by a vision - // insurance plan. - VISION = 11; -} - -// Educational degree level defined in International Standard Classification -// of Education (ISCED). -enum DegreeType { - // Default value. Represents no degree, or early childhood education. - // Maps to ISCED code 0. - // Ex) Kindergarten - DEGREE_TYPE_UNSPECIFIED = 0; - - // Primary education which is typically the first stage of compulsory - // education. ISCED code 1. - // Ex) Elementary school - PRIMARY_EDUCATION = 1; - - // Lower secondary education; First stage of secondary education building on - // primary education, typically with a more subject-oriented curriculum. - // ISCED code 2. - // Ex) Middle school - LOWER_SECONDARY_EDUCATION = 2; - - // Middle education; Second/final stage of secondary education preparing for - // tertiary education and/or providing skills relevant to employment. - // Usually with an increased range of subject options and streams. ISCED - // code 3. - // Ex) High school - UPPER_SECONDARY_EDUCATION = 3; - - // Adult Remedial Education; Programmes providing learning experiences that - // build on secondary education and prepare for labour market entry and/or - // tertiary education. The content is broader than secondary but not as - // complex as tertiary education. ISCED code 4. - ADULT_REMEDIAL_EDUCATION = 4; - - // Associate's or equivalent; Short first tertiary programmes that are - // typically practically-based, occupationally-specific and prepare for - // labour market entry. These programmes may also provide a pathway to other - // tertiary programmes. ISCED code 5. - ASSOCIATES_OR_EQUIVALENT = 5; - - // Bachelor's or equivalent; Programmes designed to provide intermediate - // academic and/or professional knowledge, skills and competencies leading - // to a first tertiary degree or equivalent qualification. ISCED code 6. - BACHELORS_OR_EQUIVALENT = 6; - - // Master's or equivalent; Programmes designed to provide advanced academic - // and/or professional knowledge, skills and competencies leading to a - // second tertiary degree or equivalent qualification. ISCED code 7. - MASTERS_OR_EQUIVALENT = 7; - - // Doctoral or equivalent; Programmes designed primarily to lead to an - // advanced research qualification, usually concluding with the submission - // and defense of a substantive dissertation of publishable quality based on - // original research. ISCED code 8. - DOCTORAL_OR_EQUIVALENT = 8; -} - -// An enum that represents the employment type of a job. -enum EmploymentType { - // The default value if the employment type isn't specified. - EMPLOYMENT_TYPE_UNSPECIFIED = 0; - - // The job requires working a number of hours that constitute full - // time employment, typically 40 or more hours per week. - FULL_TIME = 1; - - // The job entails working fewer hours than a full time job, - // typically less than 40 hours a week. - PART_TIME = 2; - - // The job is offered as a contracted, as opposed to a salaried employee, - // position. - CONTRACTOR = 3; - - // The job is offered as a contracted position with the understanding - // that it's converted into a full-time position at the end of the - // contract. Jobs of this type are also returned by a search for - // [EmploymentType.CONTRACTOR][google.cloud.talent.v4beta1.EmploymentType.CONTRACTOR] jobs. - CONTRACT_TO_HIRE = 4; - - // The job is offered as a temporary employment opportunity, usually - // a short-term engagement. - TEMPORARY = 5; - - // The job is a fixed-term opportunity for students or entry-level job - // seekers to obtain on-the-job training, typically offered as a summer - // position. - INTERN = 6; - - // The is an opportunity for an individual to volunteer, where there's no - // expectation of compensation for the provided services. - VOLUNTEER = 7; - - // The job requires an employee to work on an as-needed basis with a - // flexible schedule. - PER_DIEM = 8; - - // The job involves employing people in remote areas and flying them - // temporarily to the work site instead of relocating employees and their - // families permanently. - FLY_IN_FLY_OUT = 9; - - // The job does not fit any of the other listed types. - OTHER_EMPLOYMENT_TYPE = 10; -} - -// An enum that represents the required experience level required for the job. -enum JobLevel { - // The default value if the level isn't specified. - JOB_LEVEL_UNSPECIFIED = 0; - - // Entry-level individual contributors, typically with less than 2 years of - // experience in a similar role. Includes interns. - ENTRY_LEVEL = 1; - - // Experienced individual contributors, typically with 2+ years of - // experience in a similar role. - EXPERIENCED = 2; - - // Entry- to mid-level managers responsible for managing a team of people. - MANAGER = 3; - - // Senior-level managers responsible for managing teams of managers. - DIRECTOR = 4; - - // Executive-level managers and above, including C-level positions. - EXECUTIVE = 5; -} - -// An enum that represents the categorization or primary focus of specific -// role. This value is different than the "industry" associated with a role, -// which is related to the categorization of the company listing the job. -enum JobCategory { - // The default value if the category isn't specified. - JOB_CATEGORY_UNSPECIFIED = 0; - - // An accounting and finance job, such as an Accountant. - ACCOUNTING_AND_FINANCE = 1; - - // An administrative and office job, such as an Administrative Assistant. - ADMINISTRATIVE_AND_OFFICE = 2; - - // An advertising and marketing job, such as Marketing Manager. - ADVERTISING_AND_MARKETING = 3; - - // An animal care job, such as Veterinarian. - ANIMAL_CARE = 4; - - // An art, fashion, or design job, such as Designer. - ART_FASHION_AND_DESIGN = 5; - - // A business operations job, such as Business Operations Manager. - BUSINESS_OPERATIONS = 6; - - // A cleaning and facilities job, such as Custodial Staff. - CLEANING_AND_FACILITIES = 7; - - // A computer and IT job, such as Systems Administrator. - COMPUTER_AND_IT = 8; - - // A construction job, such as General Laborer. - CONSTRUCTION = 9; - - // A customer service job, such s Cashier. - CUSTOMER_SERVICE = 10; - - // An education job, such as School Teacher. - EDUCATION = 11; - - // An entertainment and travel job, such as Flight Attendant. - ENTERTAINMENT_AND_TRAVEL = 12; - - // A farming or outdoor job, such as Park Ranger. - FARMING_AND_OUTDOORS = 13; - - // A healthcare job, such as Registered Nurse. - HEALTHCARE = 14; - - // A human resources job, such as Human Resources Director. - HUMAN_RESOURCES = 15; - - // An installation, maintenance, or repair job, such as Electrician. - INSTALLATION_MAINTENANCE_AND_REPAIR = 16; - - // A legal job, such as Law Clerk. - LEGAL = 17; - - // A management job, often used in conjunction with another category, - // such as Store Manager. - MANAGEMENT = 18; - - // A manufacturing or warehouse job, such as Assembly Technician. - MANUFACTURING_AND_WAREHOUSE = 19; - - // A media, communications, or writing job, such as Media Relations. - MEDIA_COMMUNICATIONS_AND_WRITING = 20; - - // An oil, gas or mining job, such as Offshore Driller. - OIL_GAS_AND_MINING = 21; - - // A personal care and services job, such as Hair Stylist. - PERSONAL_CARE_AND_SERVICES = 22; - - // A protective services job, such as Security Guard. - PROTECTIVE_SERVICES = 23; - - // A real estate job, such as Buyer's Agent. - REAL_ESTATE = 24; - - // A restaurant and hospitality job, such as Restaurant Server. - RESTAURANT_AND_HOSPITALITY = 25; - - // A sales and/or retail job, such Sales Associate. - SALES_AND_RETAIL = 26; - - // A science and engineering job, such as Lab Technician. - SCIENCE_AND_ENGINEERING = 27; - - // A social services or non-profit job, such as Case Worker. - SOCIAL_SERVICES_AND_NON_PROFIT = 28; - - // A sports, fitness, or recreation job, such as Personal Trainer. - SPORTS_FITNESS_AND_RECREATION = 29; - - // A transportation or logistics job, such as Truck Driver. - TRANSPORTATION_AND_LOGISTICS = 30; -} - -// An enum that represents the job posting region. In most cases, job postings -// don't need to specify a region. If a region is given, jobs are -// eligible for searches in the specified region. -enum PostingRegion { - // If the region is unspecified, the job is only returned if it - // matches the [LocationFilter][google.cloud.talent.v4beta1.LocationFilter]. - POSTING_REGION_UNSPECIFIED = 0; - - // In addition to exact location matching, job posting is returned when the - // [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] in the search query is in the same administrative area - // as the returned job posting. For example, if a `ADMINISTRATIVE_AREA` job - // is posted in "CA, USA", it's returned if [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] has - // "Mountain View". - // - // Administrative area refers to top-level administrative subdivision of this - // country. For example, US state, IT region, UK constituent nation and - // JP prefecture. - ADMINISTRATIVE_AREA = 1; - - // In addition to exact location matching, job is returned when - // [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] in search query is in the same country as this job. - // For example, if a `NATION_WIDE` job is posted in "USA", it's - // returned if [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] has 'Mountain View'. - NATION = 2; - - // Job allows employees to work remotely (telecommute). - // If locations are provided with this value, the job is - // considered as having a location, but telecommuting is allowed. - TELECOMMUTE = 3; -} - -// Deprecated. All resources are only visible to the owner. -// -// An enum that represents who has view access to the resource. -enum Visibility { - option deprecated = true; - - // Default value. - VISIBILITY_UNSPECIFIED = 0; - - // The resource is only visible to the GCP account who owns it. - ACCOUNT_ONLY = 1; - - // The resource is visible to the owner and may be visible to other - // applications and processes at Google. - SHARED_WITH_GOOGLE = 2; - - // The resource is visible to the owner and may be visible to all other API - // clients. - SHARED_WITH_PUBLIC = 3; -} - -// Enum that represents the usage of the contact information. -enum ContactInfoUsage { - // Default value. - CONTACT_INFO_USAGE_UNSPECIFIED = 0; - - // Personal use. - PERSONAL = 1; - - // Work use. - WORK = 2; - - // School use. - SCHOOL = 3; -} - -// Option for HTML content sanitization on user input fields, for example, job -// description. By setting this option, user can determine whether and how -// sanitization is performed on these fields. -enum HtmlSanitization { - // Default value. - HTML_SANITIZATION_UNSPECIFIED = 0; - - // Disables sanitization on HTML input. - HTML_SANITIZATION_DISABLED = 1; - - // Sanitizes HTML input, only accepts bold, italic, ordered list, and - // unordered list markup tags. - SIMPLE_FORMATTING_ONLY = 2; -} - -// Method for commute. -enum CommuteMethod { - // Commute method isn't specified. - COMMUTE_METHOD_UNSPECIFIED = 0; - - // Commute time is calculated based on driving time. - DRIVING = 1; - - // Commute time is calculated based on public transit including bus, metro, - // subway, and so on. - TRANSIT = 2; - - // Commute time is calculated based on walking time. - WALKING = 3; - - // Commute time is calculated based on biking time. - CYCLING = 4; -} - -// Meta information related to the job searcher or entity -// conducting the job search. This information is used to improve the -// performance of the service. -message RequestMetadata { - // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. - // - // The client-defined scope or source of the service call, which typically - // is the domain on - // which the service has been implemented and is currently being run. - // - // For example, if the service is being run by client Foo, Inc., on - // job board www.foo.com and career site www.bar.com, then this field is - // set to "foo.com" for use on the job board, and "bar.com" for use on the - // career site. - // - // Note that any improvements to the model for a particular tenant site rely - // on this field being set correctly to a unique domain. - // - // The maximum number of allowed characters is 255. - string domain = 1; - - // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. - // - // A unique session identification string. A session is defined as the - // duration of an end user's interaction with the service over a certain - // period. - // Obfuscate this field for privacy concerns before - // providing it to the service. - // - // Note that any improvements to the model for a particular tenant site rely - // on this field being set correctly to a unique session ID. - // - // The maximum number of allowed characters is 255. - string session_id = 2; - - // Required if [allow_missing_ids][google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids] is unset or `false`. - // - // A unique user identification string, as determined by the client. - // To have the strongest positive impact on search quality - // make sure the client-level is unique. - // Obfuscate this field for privacy concerns before - // providing it to the service. - // - // Note that any improvements to the model for a particular tenant site rely - // on this field being set correctly to a unique user ID. - // - // The maximum number of allowed characters is 255. - string user_id = 3; - - // Only set when any of [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], [session_id][google.cloud.talent.v4beta1.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4beta1.RequestMetadata.user_id] isn't - // available for some reason. It is highly recommended not to set this field - // and provide accurate [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], [session_id][google.cloud.talent.v4beta1.RequestMetadata.session_id] and [user_id][google.cloud.talent.v4beta1.RequestMetadata.user_id] for the - // best service experience. - bool allow_missing_ids = 4; - - // The type of device used by the job seeker at the time of the call to the - // service. - DeviceInfo device_info = 5; -} - -// Additional information returned to client, such as debugging information. -message ResponseMetadata { - // A unique id associated with this call. - // This id is logged for tracking purposes. - string request_id = 1; -} - -// Device information collected from the job seeker, candidate, or -// other entity conducting the job search. Providing this information improves -// the quality of the search results across devices. -message DeviceInfo { - // An enumeration describing an API access portal and exposure mechanism. - enum DeviceType { - // The device type isn't specified. - DEVICE_TYPE_UNSPECIFIED = 0; - - // A desktop web browser, such as, Chrome, Firefox, Safari, or Internet - // Explorer) - WEB = 1; - - // A mobile device web browser, such as a phone or tablet with a Chrome - // browser. - MOBILE_WEB = 2; - - // An Android device native application. - ANDROID = 3; - - // An iOS device native application. - IOS = 4; - - // A bot, as opposed to a device operated by human beings, such as a web - // crawler. - BOT = 5; - - // Other devices types. - OTHER = 6; - } - - // Type of the device. - DeviceType device_type = 1; - - // A device-specific ID. The ID must be a unique identifier that - // distinguishes the device from other devices. - string id = 2; -} - -// Custom attribute values that are either filterable or non-filterable. -message CustomAttribute { - // Exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must be specified. - // - // This field is used to perform a string match (`CASE_SENSITIVE_MATCH` or - // `CASE_INSENSITIVE_MATCH`) search. - // For filterable `string_value`s, a maximum total number of 200 values - // is allowed, with each `string_value` has a byte size of no more than - // 500B. For unfilterable `string_values`, the maximum total byte size of - // unfilterable `string_values` is 50KB. - // - // Empty string isn't allowed. - repeated string string_values = 1; - - // Exactly one of [string_values][google.cloud.talent.v4beta1.CustomAttribute.string_values] or [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] must be specified. - // - // This field is used to perform number range search. - // (`EQ`, `GT`, `GE`, `LE`, `LT`) over filterable `long_value`. - // - // Currently at most 1 [long_values][google.cloud.talent.v4beta1.CustomAttribute.long_values] is supported. - repeated int64 long_values = 2; - - // If the `filterable` flag is true, custom field values are searchable. - // If false, values are not searchable. - // - // Default is false. - bool filterable = 3; -} - -// Spell check result. -message SpellingCorrection { - // Indicates if the query was corrected by the spell checker. - bool corrected = 1; - - // Correction output consisting of the corrected keyword string. - string corrected_text = 2; - - // Corrected output with html tags to highlight the corrected words. - // Corrected words are called out with the "..." html tags. - // - // For example, the user input query is "software enginear", where the second - // word, "enginear," is incorrect. It should be "engineer". When spelling - // correction is enabled, this value is - // "software engineer". - string corrected_html = 3; -} - -// Job compensation details. -message CompensationInfo { - // A compensation entry that represents one component of compensation, such - // as base pay, bonus, or other compensation type. - // - // Annualization: One compensation entry can be annualized if - // - it contains valid [amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]. - // - and its [expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year] is set or can be derived. - // Its annualized range is determined as ([amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]) times - // [expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. - message CompensationEntry { - // Compensation type. - // - // Default is [CompensationType.COMPENSATION_TYPE_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationType.COMPENSATION_TYPE_UNSPECIFIED]. - CompensationType type = 1; - - // Frequency of the specified amount. - // - // Default is [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED]. - CompensationUnit unit = 2; - - // Compensation amount. It could be a fixed amount or a floating range. - oneof compensation_amount { - // Compensation amount. - google.type.Money amount = 3; - - // Compensation range. - CompensationRange range = 4; - } - - // Compensation description. For example, could - // indicate equity terms or provide additional context to an estimated - // bonus. - string description = 5; - - // Expected number of units paid each year. If not specified, when - // [Job.employment_types][google.cloud.talent.v4beta1.Job.employment_types] is FULLTIME, a default value is inferred - // based on [unit][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.unit]. Default values: - // - HOURLY: 2080 - // - DAILY: 260 - // - WEEKLY: 52 - // - MONTHLY: 12 - // - ANNUAL: 1 - google.protobuf.DoubleValue expected_units_per_year = 6; - } - - // Compensation range. - message CompensationRange { - // The maximum amount of compensation. If left empty, the value is set - // to a maximal compensation value and the currency code is set to - // match the [currency code][google.type.Money.currency_code] of - // min_compensation. - google.type.Money max_compensation = 2; - - // The minimum amount of compensation. If left empty, the value is set - // to zero and the currency code is set to match the - // [currency code][google.type.Money.currency_code] of max_compensation. - google.type.Money min_compensation = 1; - } - - // The type of compensation. - // - // For compensation amounts specified in non-monetary amounts, - // describe the compensation scheme in the [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description]. - // - // For example, tipping format is described in - // [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] (for example, "expect 15-20% tips based - // on customer bill.") and an estimate of the tips provided in - // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or [CompensationEntry.range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range] ($10 per hour). - // - // For example, equity is described in [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] - // (for example, "1% - 2% equity vesting over 4 years, 1 year cliff") and - // value estimated in [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] or - // [CompensationEntry.range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]. If no value estimate is possible, units are - // [CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit.COMPENSATION_UNIT_UNSPECIFIED] and then further - // clarified in [CompensationEntry.description][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description] field. - enum CompensationType { - // Default value. - COMPENSATION_TYPE_UNSPECIFIED = 0; - - // Base compensation: Refers to the fixed amount of money paid to an - // employee by an employer in return for work performed. Base compensation - // does not include benefits, bonuses or any other potential compensation - // from an employer. - BASE = 1; - - // Bonus. - BONUS = 2; - - // Signing bonus. - SIGNING_BONUS = 3; - - // Equity. - EQUITY = 4; - - // Profit sharing. - PROFIT_SHARING = 5; - - // Commission. - COMMISSIONS = 6; - - // Tips. - TIPS = 7; - - // Other compensation type. - OTHER_COMPENSATION_TYPE = 8; - } - - // Pay frequency. - enum CompensationUnit { - // Default value. - COMPENSATION_UNIT_UNSPECIFIED = 0; - - // Hourly. - HOURLY = 1; - - // Daily. - DAILY = 2; - - // Weekly - WEEKLY = 3; - - // Monthly. - MONTHLY = 4; - - // Yearly. - YEARLY = 5; - - // One time. - ONE_TIME = 6; - - // Other compensation units. - OTHER_COMPENSATION_UNIT = 7; - } - - // Job compensation information. - // - // At most one entry can be of type - // [CompensationInfo.CompensationType.BASE][google.cloud.talent.v4beta1.CompensationInfo.CompensationType.BASE], which is - // referred as **base compensation entry** for the job. - repeated CompensationEntry entries = 1; - - // Output only. Annualized base compensation range. Computed as base compensation entry's - // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] times - // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. - // - // See [CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for explanation on compensation annualization. - CompensationRange annualized_base_compensation_range = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Annualized total compensation range. Computed as all compensation entries' - // [CompensationEntry.amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] times - // [CompensationEntry.expected_units_per_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year]. - // - // See [CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for explanation on compensation annualization. - CompensationRange annualized_total_compensation_range = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Resource that represents a license or certification. -message Certification { - // Name of license or certification. - // - // Number of characters allowed is 100. - string display_name = 1; - - // Acquisition date or effective date of license or certification. - google.type.Date acquire_date = 2; - - // Expiration date of license of certification. - google.type.Date expire_date = 3; - - // Authority of license, such as government. - // - // Number of characters allowed is 100. - string authority = 4; - - // Description of license or certification. - // - // Number of characters allowed is 100,000. - string description = 5; -} - -// Resource that represents a skill of a candidate. -message Skill { - // Skill display name. - // - // For example, "Java", "Python". - // - // Number of characters allowed is 100. - string display_name = 1; - - // The last time this skill was used. - google.type.Date last_used_date = 2; - - // Skill proficiency level which indicates how proficient the candidate is at - // this skill. - SkillProficiencyLevel level = 3; - - // A paragraph describes context of this skill. - // - // Number of characters allowed is 100,000. - string context = 4; - - // Output only. Skill name snippet shows how the [display_name][google.cloud.talent.v4beta1.Skill.display_name] is related to a search - // query. It's empty if the [display_name][google.cloud.talent.v4beta1.Skill.display_name] isn't related to the search - // query. - string skill_name_snippet = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Details of an interview. -message Interview { - // The rating on this interview. - Rating rating = 6; - - // Required. The overall decision resulting from this interview (positive, negative, - // nuetral). - Outcome outcome = 7 [(google.api.field_behavior) = REQUIRED]; -} - -// The details of the score received for an assessment or interview. -message Rating { - // Overall score. - double overall = 1; - - // The minimum value for the score. - double min = 2; - - // The maximum value for the score. - double max = 3; - - // The steps within the score (for example, interval = 1 max = 5 - // min = 1 indicates that the score can be 1, 2, 3, 4, or 5) - double interval = 4; -} - -// Metadata used for long running operations returned by CTS batch APIs. -// It's used to replace [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]. -message BatchOperationMetadata { - enum State { - // Default value. - STATE_UNSPECIFIED = 0; - - // The batch operation is being prepared for processing. - INITIALIZING = 1; - - // The batch operation is actively being processed. - PROCESSING = 2; - - // The batch operation is processed, and at least one item has been - // successfully processed. - SUCCEEDED = 3; - - // The batch operation is done and no item has been successfully processed. - FAILED = 4; - - // The batch operation is in the process of cancelling after - // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. - CANCELLING = 5; - - // The batch operation is done after - // [google.longrunning.Operations.CancelOperation][google.longrunning.Operations.CancelOperation] is called. Any items - // processed before cancelling are returned in the response. - CANCELLED = 6; - } - - // The state of a long running operation. - State state = 1; - - // More detailed information about operation state. - string state_description = 2; - - // Count of successful item(s) inside an operation. - int32 success_count = 3; - - // Count of failed item(s) inside an operation. - int32 failure_count = 4; - - // Count of total item(s) inside an operation. - int32 total_count = 5; - - // The time when the batch operation is created. - google.protobuf.Timestamp create_time = 6; - - // The time when the batch operation status is updated. The metadata and the - // [update_time][google.cloud.talent.v4beta1.BatchOperationMetadata.update_time] is refreshed every minute otherwise cached data is - // returned. - google.protobuf.Timestamp update_time = 7; - - // The time when the batch operation is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to `true`. - google.protobuf.Timestamp end_time = 8; -} - -// Enum that represents the skill proficiency level. -enum SkillProficiencyLevel { - // Default value. - SKILL_PROFICIENCY_LEVEL_UNSPECIFIED = 0; - - // Lacks any proficiency in this skill. - UNSKILLED = 6; - - // Have a common knowledge or an understanding of basic techniques and - // concepts. - FUNDAMENTAL_AWARENESS = 1; - - // Have the level of experience gained in a classroom and/or experimental - // scenarios or as a trainee on-the-job. - NOVICE = 2; - - // Be able to successfully complete tasks in this skill as requested. Help - // from an expert may be required from time to time, but can usually perform - // skill independently. - INTERMEDIATE = 3; - - // Can perform the actions associated with this skill without assistance. - ADVANCED = 4; - - // Known as an expert in this area. - EXPERT = 5; -} - -// The overall outcome /decision / result indicator. -enum Outcome { - // Default value. - OUTCOME_UNSPECIFIED = 0; - - // A positive outcome / passing indicator (for example, candidate was - // recommended for hiring or to be moved forward in the hiring process, - // candidate passed a test). - POSITIVE = 1; - - // A neutral outcome / no clear indicator (for example, no strong - // reccommendation either to move forward / not move forward, neutral score). - NEUTRAL = 2; - - // A negative outcome / failing indicator (for example, candidate was - // recommended to NOT move forward in the hiring process, failed a test). - NEGATIVE = 3; - - // The assessment outcome is not available or otherwise unknown (for example, - // candidate did not complete assessment). - OUTCOME_NOT_AVAILABLE = 4; -} - -// The type of candidate availability signal. -enum AvailabilitySignalType { - // Default value. - AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED = 0; - - // Job application signal. - // - // In the context of [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals], this signal is related - // to the candidate's most recent application. - // [last_update_time][google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time] is - // calculated from max([Application.create_time][google.cloud.talent.v4beta1.Application.create_time]) from all [Application][google.cloud.talent.v4beta1.Application] - // records where [Application.source][google.cloud.talent.v4beta1.Application.source] is any of the following: - // [APPLY_DIRECT_WEB][google.cloud.talent.v4beta1.Application.ApplicationSource.APPLY_DIRECT_WEB] - // [APPLY_DIRECT_MOBILE_WEB][google.cloud.talent.v4beta1.Application.ApplicationSource.APPLY_DIRECT_MOBILE_WEB] - // [APPLY_DIRECT_MOBILE_APP][google.cloud.talent.v4beta1.Application.ApplicationSource.APPLY_DIRECT_MOBILE_APP] - // [APPLY_DIRECT_IN_PERSON][google.cloud.talent.v4beta1.Application.ApplicationSource.APPLY_DIRECT_IN_PERSON] - // [APPLY_INDIRECT][google.cloud.talent.v4beta1.Application.ApplicationSource.APPLY_INDIRECT] - // - // In the context of [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter], the filter is applied on - // [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals] where - // [type][google.cloud.talent.v4beta1.AvailabilitySignal.type] is JOB_APPLICATION. - JOB_APPLICATION = 1; - - // Resume update signal. - // - // In the context of [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals], this signal is related - // to the candidate's most recent update to their resume. - // For a [SummarizedProfile.summary][google.cloud.talent.v4beta1.SummarizedProfile.summary], - // [last_update_time][google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time] is - // calculated from max([Profile.resume_update_time][google.cloud.talent.v4beta1.Profile.resume_update_time]) from all - // [SummarizedProfile.profiles][google.cloud.talent.v4beta1.SummarizedProfile.profiles]. - // - // In the context of [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter], the filter is applied on - // [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals] where - // [type][google.cloud.talent.v4beta1.AvailabilitySignal.type] is RESUME_UPDATE. - RESUME_UPDATE = 2; - - // Candidate update signal. - // - // In the context of [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals], this signal is related - // to the candidate's most recent update to their profile. - // For a [SummarizedProfile.summary][google.cloud.talent.v4beta1.SummarizedProfile.summary], - // [last_update_time][google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time] is - // calculated from max([Profile.candidate_update_time][google.cloud.talent.v4beta1.Profile.candidate_update_time]) from all - // [SummarizedProfile.profiles][google.cloud.talent.v4beta1.SummarizedProfile.profiles]. - // - // In the context of [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter], the filter is applied on - // [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals] where - // [type][google.cloud.talent.v4beta1.AvailabilitySignal.type] is CANDIDATE_UPDATE. - CANDIDATE_UPDATE = 3; - - // Client submission signal. - // - // In the context of [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals], this signal is related - // to the candidate's most recent submission. - // [last_update_time][google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time] is - // calculated from max([Application.create_time][google.cloud.talent.v4beta1.Application.create_time]) from all [Application][google.cloud.talent.v4beta1.Application] - // records where [Application.stage][google.cloud.talent.v4beta1.Application.stage] is any of the following: - // [HIRING_MANAGER_REVIEW][google.cloud.talent.v4beta1.Application.ApplicationStage.HIRING_MANAGER_REVIEW] - // [INTERVIEW][google.cloud.talent.v4beta1.Application.ApplicationStage.INTERVIEW] - // [OFFER_EXTENDED][google.cloud.talent.v4beta1.Application.ApplicationStage.OFFER_EXTENDED] - // [OFFER_ACCEPTED][google.cloud.talent.v4beta1.Application.ApplicationStage.OFFER_ACCEPTED] - // [STARTED][google.cloud.talent.v4beta1.Application.ApplicationStage.STARTED] - // - // In the context of [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter], the filter is applied on - // [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals] where - // [type][google.cloud.talent.v4beta1.AvailabilitySignal.type] is CLIENT_SUBMISSION. - CLIENT_SUBMISSION = 4; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/common_pb2.py b/talent/google/cloud/talent_v4beta1/proto/common_pb2.py deleted file mode 100644 index 9af7164c8ccd..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/common_pb2.py +++ /dev/null @@ -1,3140 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/common.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 -from google.type import money_pb2 as google_dot_type_dot_money__pb2 -from google.type import postal_address_pb2 as google_dot_type_dot_postal__address__pb2 -from google.type import timeofday_pb2 as google_dot_type_dot_timeofday__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/common.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\013CommonProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n.google/cloud/talent_v4beta1/proto/common.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x18google/type/latlng.proto\x1a\x17google/type/money.proto\x1a google/type/postal_address.proto\x1a\x1bgoogle/type/timeofday.proto\x1a\x1cgoogle/api/annotations.proto"n\n\x0eTimestampRange\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\xb7\x03\n\x08Location\x12I\n\rlocation_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.Location.LocationType\x12\x32\n\x0epostal_address\x18\x02 \x01(\x0b\x32\x1a.google.type.PostalAddress\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x14\n\x0cradius_miles\x18\x04 \x01(\x01"\xef\x01\n\x0cLocationType\x12\x1d\n\x19LOCATION_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43OUNTRY\x10\x01\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x02\x12\x1b\n\x17SUB_ADMINISTRATIVE_AREA\x10\x03\x12\x0c\n\x08LOCALITY\x10\x04\x12\x0f\n\x0bPOSTAL_CODE\x10\x05\x12\x10\n\x0cSUB_LOCALITY\x10\x06\x12\x12\n\x0eSUB_LOCALITY_1\x10\x07\x12\x12\n\x0eSUB_LOCALITY_2\x10\x08\x12\x10\n\x0cNEIGHBORHOOD\x10\t\x12\x12\n\x0eSTREET_ADDRESS\x10\n"\x9f\x01\n\x0fRequestMetadata\x12\x0e\n\x06\x64omain\x18\x01 \x01(\t\x12\x12\n\nsession_id\x18\x02 \x01(\t\x12\x0f\n\x07user_id\x18\x03 \x01(\t\x12\x19\n\x11\x61llow_missing_ids\x18\x04 \x01(\x08\x12<\n\x0b\x64\x65vice_info\x18\x05 \x01(\x0b\x32\'.google.cloud.talent.v4beta1.DeviceInfo"&\n\x10ResponseMetadata\x12\x12\n\nrequest_id\x18\x01 \x01(\t"\xcf\x01\n\nDeviceInfo\x12G\n\x0b\x64\x65vice_type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.DeviceInfo.DeviceType\x12\n\n\x02id\x18\x02 \x01(\t"l\n\nDeviceType\x12\x1b\n\x17\x44\x45VICE_TYPE_UNSPECIFIED\x10\x00\x12\x07\n\x03WEB\x10\x01\x12\x0e\n\nMOBILE_WEB\x10\x02\x12\x0b\n\x07\x41NDROID\x10\x03\x12\x07\n\x03IOS\x10\x04\x12\x07\n\x03\x42OT\x10\x05\x12\t\n\x05OTHER\x10\x06"Q\n\x0f\x43ustomAttribute\x12\x15\n\rstring_values\x18\x01 \x03(\t\x12\x13\n\x0blong_values\x18\x02 \x03(\x03\x12\x12\n\nfilterable\x18\x03 \x01(\x08"W\n\x12SpellingCorrection\x12\x11\n\tcorrected\x18\x01 \x01(\x08\x12\x16\n\x0e\x63orrected_text\x18\x02 \x01(\t\x12\x16\n\x0e\x63orrected_html\x18\x03 \x01(\t"\xa6\t\n\x10\x43ompensationInfo\x12P\n\x07\x65ntries\x18\x01 \x03(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry\x12p\n"annualized_base_compensation_range\x18\x02 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x12q\n#annualized_total_compensation_range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeB\x03\xe0\x41\x03\x1a\x92\x03\n\x11\x43ompensationEntry\x12L\n\x04type\x18\x01 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationType\x12L\n\x04unit\x18\x02 \x01(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit\x12$\n\x06\x61mount\x18\x03 \x01(\x0b\x32\x12.google.type.MoneyH\x00\x12P\n\x05range\x18\x04 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRangeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t\x12=\n\x17\x65xpected_units_per_year\x18\x06 \x01(\x0b\x32\x1c.google.protobuf.DoubleValueB\x15\n\x13\x63ompensation_amount\x1ao\n\x11\x43ompensationRange\x12,\n\x10max_compensation\x18\x02 \x01(\x0b\x32\x12.google.type.Money\x12,\n\x10min_compensation\x18\x01 \x01(\x0b\x32\x12.google.type.Money"\xb5\x01\n\x10\x43ompensationType\x12!\n\x1d\x43OMPENSATION_TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04\x42\x41SE\x10\x01\x12\t\n\x05\x42ONUS\x10\x02\x12\x11\n\rSIGNING_BONUS\x10\x03\x12\n\n\x06\x45QUITY\x10\x04\x12\x12\n\x0ePROFIT_SHARING\x10\x05\x12\x0f\n\x0b\x43OMMISSIONS\x10\x06\x12\x08\n\x04TIPS\x10\x07\x12\x1b\n\x17OTHER_COMPENSATION_TYPE\x10\x08"\x9c\x01\n\x10\x43ompensationUnit\x12!\n\x1d\x43OMPENSATION_UNIT_UNSPECIFIED\x10\x00\x12\n\n\x06HOURLY\x10\x01\x12\t\n\x05\x44\x41ILY\x10\x02\x12\n\n\x06WEEKLY\x10\x03\x12\x0b\n\x07MONTHLY\x10\x04\x12\n\n\x06YEARLY\x10\x05\x12\x0c\n\x08ONE_TIME\x10\x06\x12\x1b\n\x17OTHER_COMPENSATION_UNIT\x10\x07"\x9e\x01\n\rCertification\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\'\n\x0c\x61\x63quire_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12&\n\x0b\x65xpire_date\x18\x03 \x01(\x0b\x32\x11.google.type.Date\x12\x11\n\tauthority\x18\x04 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x05 \x01(\t"\xbd\x01\n\x05Skill\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12)\n\x0elast_used_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12\x41\n\x05level\x18\x03 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.SkillProficiencyLevel\x12\x0f\n\x07\x63ontext\x18\x04 \x01(\t\x12\x1f\n\x12skill_name_snippet\x18\x05 \x01(\tB\x03\xe0\x41\x03"|\n\tInterview\x12\x33\n\x06rating\x18\x06 \x01(\x0b\x32#.google.cloud.talent.v4beta1.Rating\x12:\n\x07outcome\x18\x07 \x01(\x0e\x32$.google.cloud.talent.v4beta1.OutcomeB\x03\xe0\x41\x02"E\n\x06Rating\x12\x0f\n\x07overall\x18\x01 \x01(\x01\x12\x0b\n\x03min\x18\x02 \x01(\x01\x12\x0b\n\x03max\x18\x03 \x01(\x01\x12\x10\n\x08interval\x18\x04 \x01(\x01"\xcc\x03\n\x16\x42\x61tchOperationMetadata\x12H\n\x05state\x18\x01 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.BatchOperationMetadata.State\x12\x19\n\x11state_description\x18\x02 \x01(\t\x12\x15\n\rsuccess_count\x18\x03 \x01(\x05\x12\x15\n\rfailure_count\x18\x04 \x01(\x05\x12\x13\n\x0btotal_count\x18\x05 \x01(\x05\x12/\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"z\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cINITIALIZING\x10\x01\x12\x0e\n\nPROCESSING\x10\x02\x12\r\n\tSUCCEEDED\x10\x03\x12\n\n\x06\x46\x41ILED\x10\x04\x12\x0e\n\nCANCELLING\x10\x05\x12\r\n\tCANCELLED\x10\x06*y\n\x0b\x43ompanySize\x12\x1c\n\x18\x43OMPANY_SIZE_UNSPECIFIED\x10\x00\x12\x08\n\x04MINI\x10\x01\x12\t\n\x05SMALL\x10\x02\x12\x0b\n\x07SMEDIUM\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x07\n\x03\x42IG\x10\x05\x12\n\n\x06\x42IGGER\x10\x06\x12\t\n\x05GIANT\x10\x07*\xe2\x01\n\nJobBenefit\x12\x1b\n\x17JOB_BENEFIT_UNSPECIFIED\x10\x00\x12\x0e\n\nCHILD_CARE\x10\x01\x12\n\n\x06\x44\x45NTAL\x10\x02\x12\x14\n\x10\x44OMESTIC_PARTNER\x10\x03\x12\x12\n\x0e\x46LEXIBLE_HOURS\x10\x04\x12\x0b\n\x07MEDICAL\x10\x05\x12\x12\n\x0eLIFE_INSURANCE\x10\x06\x12\x12\n\x0ePARENTAL_LEAVE\x10\x07\x12\x13\n\x0fRETIREMENT_PLAN\x10\x08\x12\r\n\tSICK_DAYS\x10\t\x12\x0c\n\x08VACATION\x10\n\x12\n\n\x06VISION\x10\x0b*\x8e\x02\n\nDegreeType\x12\x1b\n\x17\x44\x45GREE_TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11PRIMARY_EDUCATION\x10\x01\x12\x1d\n\x19LOWER_SECONDARY_EDUCATION\x10\x02\x12\x1d\n\x19UPPER_SECONDARY_EDUCATION\x10\x03\x12\x1c\n\x18\x41\x44ULT_REMEDIAL_EDUCATION\x10\x04\x12\x1c\n\x18\x41SSOCIATES_OR_EQUIVALENT\x10\x05\x12\x1b\n\x17\x42\x41\x43HELORS_OR_EQUIVALENT\x10\x06\x12\x19\n\x15MASTERS_OR_EQUIVALENT\x10\x07\x12\x1a\n\x16\x44OCTORAL_OR_EQUIVALENT\x10\x08*\xdc\x01\n\x0e\x45mploymentType\x12\x1f\n\x1b\x45MPLOYMENT_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tFULL_TIME\x10\x01\x12\r\n\tPART_TIME\x10\x02\x12\x0e\n\nCONTRACTOR\x10\x03\x12\x14\n\x10\x43ONTRACT_TO_HIRE\x10\x04\x12\r\n\tTEMPORARY\x10\x05\x12\n\n\x06INTERN\x10\x06\x12\r\n\tVOLUNTEER\x10\x07\x12\x0c\n\x08PER_DIEM\x10\x08\x12\x12\n\x0e\x46LY_IN_FLY_OUT\x10\t\x12\x19\n\x15OTHER_EMPLOYMENT_TYPE\x10\n*q\n\x08JobLevel\x12\x19\n\x15JOB_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x45NTRY_LEVEL\x10\x01\x12\x0f\n\x0b\x45XPERIENCED\x10\x02\x12\x0b\n\x07MANAGER\x10\x03\x12\x0c\n\x08\x44IRECTOR\x10\x04\x12\r\n\tEXECUTIVE\x10\x05*\xba\x06\n\x0bJobCategory\x12\x1c\n\x18JOB_CATEGORY_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41\x43\x43OUNTING_AND_FINANCE\x10\x01\x12\x1d\n\x19\x41\x44MINISTRATIVE_AND_OFFICE\x10\x02\x12\x1d\n\x19\x41\x44VERTISING_AND_MARKETING\x10\x03\x12\x0f\n\x0b\x41NIMAL_CARE\x10\x04\x12\x1a\n\x16\x41RT_FASHION_AND_DESIGN\x10\x05\x12\x17\n\x13\x42USINESS_OPERATIONS\x10\x06\x12\x1b\n\x17\x43LEANING_AND_FACILITIES\x10\x07\x12\x13\n\x0f\x43OMPUTER_AND_IT\x10\x08\x12\x10\n\x0c\x43ONSTRUCTION\x10\t\x12\x14\n\x10\x43USTOMER_SERVICE\x10\n\x12\r\n\tEDUCATION\x10\x0b\x12\x1c\n\x18\x45NTERTAINMENT_AND_TRAVEL\x10\x0c\x12\x18\n\x14\x46\x41RMING_AND_OUTDOORS\x10\r\x12\x0e\n\nHEALTHCARE\x10\x0e\x12\x13\n\x0fHUMAN_RESOURCES\x10\x0f\x12\'\n#INSTALLATION_MAINTENANCE_AND_REPAIR\x10\x10\x12\t\n\x05LEGAL\x10\x11\x12\x0e\n\nMANAGEMENT\x10\x12\x12\x1f\n\x1bMANUFACTURING_AND_WAREHOUSE\x10\x13\x12$\n MEDIA_COMMUNICATIONS_AND_WRITING\x10\x14\x12\x16\n\x12OIL_GAS_AND_MINING\x10\x15\x12\x1e\n\x1aPERSONAL_CARE_AND_SERVICES\x10\x16\x12\x17\n\x13PROTECTIVE_SERVICES\x10\x17\x12\x0f\n\x0bREAL_ESTATE\x10\x18\x12\x1e\n\x1aRESTAURANT_AND_HOSPITALITY\x10\x19\x12\x14\n\x10SALES_AND_RETAIL\x10\x1a\x12\x1b\n\x17SCIENCE_AND_ENGINEERING\x10\x1b\x12"\n\x1eSOCIAL_SERVICES_AND_NON_PROFIT\x10\x1c\x12!\n\x1dSPORTS_FITNESS_AND_RECREATION\x10\x1d\x12 \n\x1cTRANSPORTATION_AND_LOGISTICS\x10\x1e*e\n\rPostingRegion\x12\x1e\n\x1aPOSTING_REGION_UNSPECIFIED\x10\x00\x12\x17\n\x13\x41\x44MINISTRATIVE_AREA\x10\x01\x12\n\n\x06NATION\x10\x02\x12\x0f\n\x0bTELECOMMUTE\x10\x03*n\n\nVisibility\x12\x1a\n\x16VISIBILITY_UNSPECIFIED\x10\x00\x12\x10\n\x0c\x41\x43\x43OUNT_ONLY\x10\x01\x12\x16\n\x12SHARED_WITH_GOOGLE\x10\x02\x12\x16\n\x12SHARED_WITH_PUBLIC\x10\x03\x1a\x02\x18\x01*Z\n\x10\x43ontactInfoUsage\x12"\n\x1e\x43ONTACT_INFO_USAGE_UNSPECIFIED\x10\x00\x12\x0c\n\x08PERSONAL\x10\x01\x12\x08\n\x04WORK\x10\x02\x12\n\n\x06SCHOOL\x10\x03*q\n\x10HtmlSanitization\x12!\n\x1dHTML_SANITIZATION_UNSPECIFIED\x10\x00\x12\x1e\n\x1aHTML_SANITIZATION_DISABLED\x10\x01\x12\x1a\n\x16SIMPLE_FORMATTING_ONLY\x10\x02*c\n\rCommuteMethod\x12\x1e\n\x1a\x43OMMUTE_METHOD_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x44RIVING\x10\x01\x12\x0b\n\x07TRANSIT\x10\x02\x12\x0b\n\x07WALKING\x10\x03\x12\x0b\n\x07\x43YCLING\x10\x04*\xa2\x01\n\x15SkillProficiencyLevel\x12\'\n#SKILL_PROFICIENCY_LEVEL_UNSPECIFIED\x10\x00\x12\r\n\tUNSKILLED\x10\x06\x12\x19\n\x15\x46UNDAMENTAL_AWARENESS\x10\x01\x12\n\n\x06NOVICE\x10\x02\x12\x10\n\x0cINTERMEDIATE\x10\x03\x12\x0c\n\x08\x41\x44VANCED\x10\x04\x12\n\n\x06\x45XPERT\x10\x05*f\n\x07Outcome\x12\x17\n\x13OUTCOME_UNSPECIFIED\x10\x00\x12\x0c\n\x08POSITIVE\x10\x01\x12\x0b\n\x07NEUTRAL\x10\x02\x12\x0c\n\x08NEGATIVE\x10\x03\x12\x19\n\x15OUTCOME_NOT_AVAILABLE\x10\x04*\x97\x01\n\x16\x41vailabilitySignalType\x12(\n$AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED\x10\x00\x12\x13\n\x0fJOB_APPLICATION\x10\x01\x12\x11\n\rRESUME_UPDATE\x10\x02\x12\x14\n\x10\x43\x41NDIDATE_UPDATE\x10\x03\x12\x15\n\x11\x43LIENT_SUBMISSION\x10\x04\x42y\n\x1f\x63om.google.cloud.talent.v4beta1B\x0b\x43ommonProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, - google_dot_type_dot_date__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - google_dot_type_dot_money__pb2.DESCRIPTOR, - google_dot_type_dot_postal__address__pb2.DESCRIPTOR, - google_dot_type_dot_timeofday__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - -_COMPANYSIZE = _descriptor.EnumDescriptor( - name="CompanySize", - full_name="google.cloud.talent.v4beta1.CompanySize", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPANY_SIZE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MINI", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SMALL", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SMEDIUM", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MEDIUM", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BIG", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BIGGER", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="GIANT", index=7, number=7, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3689, - serialized_end=3810, -) -_sym_db.RegisterEnumDescriptor(_COMPANYSIZE) - -CompanySize = enum_type_wrapper.EnumTypeWrapper(_COMPANYSIZE) -_JOBBENEFIT = _descriptor.EnumDescriptor( - name="JobBenefit", - full_name="google.cloud.talent.v4beta1.JobBenefit", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="JOB_BENEFIT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHILD_CARE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DENTAL", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DOMESTIC_PARTNER", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FLEXIBLE_HOURS", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MEDICAL", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIFE_INSURANCE", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PARENTAL_LEAVE", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RETIREMENT_PLAN", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SICK_DAYS", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VACATION", index=10, number=10, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VISION", index=11, number=11, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3813, - serialized_end=4039, -) -_sym_db.RegisterEnumDescriptor(_JOBBENEFIT) - -JobBenefit = enum_type_wrapper.EnumTypeWrapper(_JOBBENEFIT) -_DEGREETYPE = _descriptor.EnumDescriptor( - name="DegreeType", - full_name="google.cloud.talent.v4beta1.DegreeType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DEGREE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PRIMARY_EDUCATION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOWER_SECONDARY_EDUCATION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UPPER_SECONDARY_EDUCATION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ADULT_REMEDIAL_EDUCATION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ASSOCIATES_OR_EQUIVALENT", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BACHELORS_OR_EQUIVALENT", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MASTERS_OR_EQUIVALENT", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DOCTORAL_OR_EQUIVALENT", - index=8, - number=8, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4042, - serialized_end=4312, -) -_sym_db.RegisterEnumDescriptor(_DEGREETYPE) - -DegreeType = enum_type_wrapper.EnumTypeWrapper(_DEGREETYPE) -_EMPLOYMENTTYPE = _descriptor.EnumDescriptor( - name="EmploymentType", - full_name="google.cloud.talent.v4beta1.EmploymentType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EMPLOYMENT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FULL_TIME", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PART_TIME", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CONTRACTOR", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CONTRACT_TO_HIRE", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEMPORARY", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="INTERN", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VOLUNTEER", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PER_DIEM", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FLY_IN_FLY_OUT", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER_EMPLOYMENT_TYPE", - index=10, - number=10, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4315, - serialized_end=4535, -) -_sym_db.RegisterEnumDescriptor(_EMPLOYMENTTYPE) - -EmploymentType = enum_type_wrapper.EnumTypeWrapper(_EMPLOYMENTTYPE) -_JOBLEVEL = _descriptor.EnumDescriptor( - name="JobLevel", - full_name="google.cloud.talent.v4beta1.JobLevel", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="JOB_LEVEL_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ENTRY_LEVEL", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EXPERIENCED", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MANAGER", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DIRECTOR", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EXECUTIVE", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4537, - serialized_end=4650, -) -_sym_db.RegisterEnumDescriptor(_JOBLEVEL) - -JobLevel = enum_type_wrapper.EnumTypeWrapper(_JOBLEVEL) -_JOBCATEGORY = _descriptor.EnumDescriptor( - name="JobCategory", - full_name="google.cloud.talent.v4beta1.JobCategory", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="JOB_CATEGORY_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ACCOUNTING_AND_FINANCE", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ADMINISTRATIVE_AND_OFFICE", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ADVERTISING_AND_MARKETING", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ANIMAL_CARE", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ART_FASHION_AND_DESIGN", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BUSINESS_OPERATIONS", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CLEANING_AND_FACILITIES", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COMPUTER_AND_IT", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CONSTRUCTION", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CUSTOMER_SERVICE", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EDUCATION", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ENTERTAINMENT_AND_TRAVEL", - index=12, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FARMING_AND_OUTDOORS", - index=13, - number=13, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="HEALTHCARE", index=14, number=14, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HUMAN_RESOURCES", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INSTALLATION_MAINTENANCE_AND_REPAIR", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEGAL", index=17, number=17, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MANAGEMENT", index=18, number=18, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MANUFACTURING_AND_WAREHOUSE", - index=19, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MEDIA_COMMUNICATIONS_AND_WRITING", - index=20, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OIL_GAS_AND_MINING", - index=21, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PERSONAL_CARE_AND_SERVICES", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROTECTIVE_SERVICES", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="REAL_ESTATE", index=24, number=24, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RESTAURANT_AND_HOSPITALITY", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SALES_AND_RETAIL", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SCIENCE_AND_ENGINEERING", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SOCIAL_SERVICES_AND_NON_PROFIT", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SPORTS_FITNESS_AND_RECREATION", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TRANSPORTATION_AND_LOGISTICS", - index=30, - number=30, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4653, - serialized_end=5479, -) -_sym_db.RegisterEnumDescriptor(_JOBCATEGORY) - -JobCategory = enum_type_wrapper.EnumTypeWrapper(_JOBCATEGORY) -_POSTINGREGION = _descriptor.EnumDescriptor( - name="PostingRegion", - full_name="google.cloud.talent.v4beta1.PostingRegion", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="POSTING_REGION_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ADMINISTRATIVE_AREA", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NATION", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TELECOMMUTE", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5481, - serialized_end=5582, -) -_sym_db.RegisterEnumDescriptor(_POSTINGREGION) - -PostingRegion = enum_type_wrapper.EnumTypeWrapper(_POSTINGREGION) -_VISIBILITY = _descriptor.EnumDescriptor( - name="Visibility", - full_name="google.cloud.talent.v4beta1.Visibility", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="VISIBILITY_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ACCOUNT_ONLY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHARED_WITH_GOOGLE", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHARED_WITH_PUBLIC", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=_b("\030\001"), - serialized_start=5584, - serialized_end=5694, -) -_sym_db.RegisterEnumDescriptor(_VISIBILITY) - -Visibility = enum_type_wrapper.EnumTypeWrapper(_VISIBILITY) -_CONTACTINFOUSAGE = _descriptor.EnumDescriptor( - name="ContactInfoUsage", - full_name="google.cloud.talent.v4beta1.ContactInfoUsage", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="CONTACT_INFO_USAGE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PERSONAL", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WORK", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SCHOOL", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5696, - serialized_end=5786, -) -_sym_db.RegisterEnumDescriptor(_CONTACTINFOUSAGE) - -ContactInfoUsage = enum_type_wrapper.EnumTypeWrapper(_CONTACTINFOUSAGE) -_HTMLSANITIZATION = _descriptor.EnumDescriptor( - name="HtmlSanitization", - full_name="google.cloud.talent.v4beta1.HtmlSanitization", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="HTML_SANITIZATION_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="HTML_SANITIZATION_DISABLED", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SIMPLE_FORMATTING_ONLY", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5788, - serialized_end=5901, -) -_sym_db.RegisterEnumDescriptor(_HTMLSANITIZATION) - -HtmlSanitization = enum_type_wrapper.EnumTypeWrapper(_HTMLSANITIZATION) -_COMMUTEMETHOD = _descriptor.EnumDescriptor( - name="CommuteMethod", - full_name="google.cloud.talent.v4beta1.CommuteMethod", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMMUTE_METHOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DRIVING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TRANSIT", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WALKING", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CYCLING", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5903, - serialized_end=6002, -) -_sym_db.RegisterEnumDescriptor(_COMMUTEMETHOD) - -CommuteMethod = enum_type_wrapper.EnumTypeWrapper(_COMMUTEMETHOD) -_SKILLPROFICIENCYLEVEL = _descriptor.EnumDescriptor( - name="SkillProficiencyLevel", - full_name="google.cloud.talent.v4beta1.SkillProficiencyLevel", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SKILL_PROFICIENCY_LEVEL_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNSKILLED", index=1, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FUNDAMENTAL_AWARENESS", - index=2, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOVICE", index=3, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="INTERMEDIATE", index=4, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ADVANCED", index=5, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EXPERT", index=6, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6005, - serialized_end=6167, -) -_sym_db.RegisterEnumDescriptor(_SKILLPROFICIENCYLEVEL) - -SkillProficiencyLevel = enum_type_wrapper.EnumTypeWrapper(_SKILLPROFICIENCYLEVEL) -_OUTCOME = _descriptor.EnumDescriptor( - name="Outcome", - full_name="google.cloud.talent.v4beta1.Outcome", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="OUTCOME_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="POSITIVE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NEUTRAL", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NEGATIVE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OUTCOME_NOT_AVAILABLE", - index=4, - number=4, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6169, - serialized_end=6271, -) -_sym_db.RegisterEnumDescriptor(_OUTCOME) - -Outcome = enum_type_wrapper.EnumTypeWrapper(_OUTCOME) -_AVAILABILITYSIGNALTYPE = _descriptor.EnumDescriptor( - name="AvailabilitySignalType", - full_name="google.cloud.talent.v4beta1.AvailabilitySignalType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_APPLICATION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RESUME_UPDATE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANDIDATE_UPDATE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CLIENT_SUBMISSION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6274, - serialized_end=6425, -) -_sym_db.RegisterEnumDescriptor(_AVAILABILITYSIGNALTYPE) - -AvailabilitySignalType = enum_type_wrapper.EnumTypeWrapper(_AVAILABILITYSIGNALTYPE) -COMPANY_SIZE_UNSPECIFIED = 0 -MINI = 1 -SMALL = 2 -SMEDIUM = 3 -MEDIUM = 4 -BIG = 5 -BIGGER = 6 -GIANT = 7 -JOB_BENEFIT_UNSPECIFIED = 0 -CHILD_CARE = 1 -DENTAL = 2 -DOMESTIC_PARTNER = 3 -FLEXIBLE_HOURS = 4 -MEDICAL = 5 -LIFE_INSURANCE = 6 -PARENTAL_LEAVE = 7 -RETIREMENT_PLAN = 8 -SICK_DAYS = 9 -VACATION = 10 -VISION = 11 -DEGREE_TYPE_UNSPECIFIED = 0 -PRIMARY_EDUCATION = 1 -LOWER_SECONDARY_EDUCATION = 2 -UPPER_SECONDARY_EDUCATION = 3 -ADULT_REMEDIAL_EDUCATION = 4 -ASSOCIATES_OR_EQUIVALENT = 5 -BACHELORS_OR_EQUIVALENT = 6 -MASTERS_OR_EQUIVALENT = 7 -DOCTORAL_OR_EQUIVALENT = 8 -EMPLOYMENT_TYPE_UNSPECIFIED = 0 -FULL_TIME = 1 -PART_TIME = 2 -CONTRACTOR = 3 -CONTRACT_TO_HIRE = 4 -TEMPORARY = 5 -INTERN = 6 -VOLUNTEER = 7 -PER_DIEM = 8 -FLY_IN_FLY_OUT = 9 -OTHER_EMPLOYMENT_TYPE = 10 -JOB_LEVEL_UNSPECIFIED = 0 -ENTRY_LEVEL = 1 -EXPERIENCED = 2 -MANAGER = 3 -DIRECTOR = 4 -EXECUTIVE = 5 -JOB_CATEGORY_UNSPECIFIED = 0 -ACCOUNTING_AND_FINANCE = 1 -ADMINISTRATIVE_AND_OFFICE = 2 -ADVERTISING_AND_MARKETING = 3 -ANIMAL_CARE = 4 -ART_FASHION_AND_DESIGN = 5 -BUSINESS_OPERATIONS = 6 -CLEANING_AND_FACILITIES = 7 -COMPUTER_AND_IT = 8 -CONSTRUCTION = 9 -CUSTOMER_SERVICE = 10 -EDUCATION = 11 -ENTERTAINMENT_AND_TRAVEL = 12 -FARMING_AND_OUTDOORS = 13 -HEALTHCARE = 14 -HUMAN_RESOURCES = 15 -INSTALLATION_MAINTENANCE_AND_REPAIR = 16 -LEGAL = 17 -MANAGEMENT = 18 -MANUFACTURING_AND_WAREHOUSE = 19 -MEDIA_COMMUNICATIONS_AND_WRITING = 20 -OIL_GAS_AND_MINING = 21 -PERSONAL_CARE_AND_SERVICES = 22 -PROTECTIVE_SERVICES = 23 -REAL_ESTATE = 24 -RESTAURANT_AND_HOSPITALITY = 25 -SALES_AND_RETAIL = 26 -SCIENCE_AND_ENGINEERING = 27 -SOCIAL_SERVICES_AND_NON_PROFIT = 28 -SPORTS_FITNESS_AND_RECREATION = 29 -TRANSPORTATION_AND_LOGISTICS = 30 -POSTING_REGION_UNSPECIFIED = 0 -ADMINISTRATIVE_AREA = 1 -NATION = 2 -TELECOMMUTE = 3 -VISIBILITY_UNSPECIFIED = 0 -ACCOUNT_ONLY = 1 -SHARED_WITH_GOOGLE = 2 -SHARED_WITH_PUBLIC = 3 -CONTACT_INFO_USAGE_UNSPECIFIED = 0 -PERSONAL = 1 -WORK = 2 -SCHOOL = 3 -HTML_SANITIZATION_UNSPECIFIED = 0 -HTML_SANITIZATION_DISABLED = 1 -SIMPLE_FORMATTING_ONLY = 2 -COMMUTE_METHOD_UNSPECIFIED = 0 -DRIVING = 1 -TRANSIT = 2 -WALKING = 3 -CYCLING = 4 -SKILL_PROFICIENCY_LEVEL_UNSPECIFIED = 0 -UNSKILLED = 6 -FUNDAMENTAL_AWARENESS = 1 -NOVICE = 2 -INTERMEDIATE = 3 -ADVANCED = 4 -EXPERT = 5 -OUTCOME_UNSPECIFIED = 0 -POSITIVE = 1 -NEUTRAL = 2 -NEGATIVE = 3 -OUTCOME_NOT_AVAILABLE = 4 -AVAILABILITY_SIGNAL_TYPE_UNSPECIFIED = 0 -JOB_APPLICATION = 1 -RESUME_UPDATE = 2 -CANDIDATE_UPDATE = 3 -CLIENT_SUBMISSION = 4 - - -_LOCATION_LOCATIONTYPE = _descriptor.EnumDescriptor( - name="LocationType", - full_name="google.cloud.talent.v4beta1.Location.LocationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LOCATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="COUNTRY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ADMINISTRATIVE_AREA", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SUB_ADMINISTRATIVE_AREA", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOCALITY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSTAL_CODE", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUB_LOCALITY", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUB_LOCALITY_1", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUB_LOCALITY_2", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NEIGHBORHOOD", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="STREET_ADDRESS", - index=10, - number=10, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=658, - serialized_end=897, -) -_sym_db.RegisterEnumDescriptor(_LOCATION_LOCATIONTYPE) - -_DEVICEINFO_DEVICETYPE = _descriptor.EnumDescriptor( - name="DeviceType", - full_name="google.cloud.talent.v4beta1.DeviceInfo.DeviceType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DEVICE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="WEB", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOBILE_WEB", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ANDROID", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="IOS", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BOT", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1201, - serialized_end=1309, -) -_sym_db.RegisterEnumDescriptor(_DEVICEINFO_DEVICETYPE) - -_COMPENSATIONINFO_COMPENSATIONTYPE = _descriptor.EnumDescriptor( - name="CompensationType", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPENSATION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BASE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BONUS", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SIGNING_BONUS", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EQUITY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PROFIT_SHARING", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="COMMISSIONS", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TIPS", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER_COMPENSATION_TYPE", - index=8, - number=8, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2334, - serialized_end=2515, -) -_sym_db.RegisterEnumDescriptor(_COMPENSATIONINFO_COMPENSATIONTYPE) - -_COMPENSATIONINFO_COMPENSATIONUNIT = _descriptor.EnumDescriptor( - name="CompensationUnit", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPENSATION_UNIT_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="HOURLY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DAILY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WEEKLY", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MONTHLY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="YEARLY", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ONE_TIME", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER_COMPENSATION_UNIT", - index=7, - number=7, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2518, - serialized_end=2674, -) -_sym_db.RegisterEnumDescriptor(_COMPENSATIONINFO_COMPENSATIONUNIT) - -_BATCHOPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="INITIALIZING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PROCESSING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCEEDED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLING", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3565, - serialized_end=3687, -) -_sym_db.RegisterEnumDescriptor(_BATCHOPERATIONMETADATA_STATE) - - -_TIMESTAMPRANGE = _descriptor.Descriptor( - name="TimestampRange", - full_name="google.cloud.talent.v4beta1.TimestampRange", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.talent.v4beta1.TimestampRange.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.talent.v4beta1.TimestampRange.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=345, - serialized_end=455, -) - - -_LOCATION = _descriptor.Descriptor( - name="Location", - full_name="google.cloud.talent.v4beta1.Location", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="location_type", - full_name="google.cloud.talent.v4beta1.Location.location_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="postal_address", - full_name="google.cloud.talent.v4beta1.Location.postal_address", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.talent.v4beta1.Location.lat_lng", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="radius_miles", - full_name="google.cloud.talent.v4beta1.Location.radius_miles", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LOCATION_LOCATIONTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=458, - serialized_end=897, -) - - -_REQUESTMETADATA = _descriptor.Descriptor( - name="RequestMetadata", - full_name="google.cloud.talent.v4beta1.RequestMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="domain", - full_name="google.cloud.talent.v4beta1.RequestMetadata.domain", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="session_id", - full_name="google.cloud.talent.v4beta1.RequestMetadata.session_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="user_id", - full_name="google.cloud.talent.v4beta1.RequestMetadata.user_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="allow_missing_ids", - full_name="google.cloud.talent.v4beta1.RequestMetadata.allow_missing_ids", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="device_info", - full_name="google.cloud.talent.v4beta1.RequestMetadata.device_info", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=900, - serialized_end=1059, -) - - -_RESPONSEMETADATA = _descriptor.Descriptor( - name="ResponseMetadata", - full_name="google.cloud.talent.v4beta1.ResponseMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="google.cloud.talent.v4beta1.ResponseMetadata.request_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1061, - serialized_end=1099, -) - - -_DEVICEINFO = _descriptor.Descriptor( - name="DeviceInfo", - full_name="google.cloud.talent.v4beta1.DeviceInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="device_type", - full_name="google.cloud.talent.v4beta1.DeviceInfo.device_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.cloud.talent.v4beta1.DeviceInfo.id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_DEVICEINFO_DEVICETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1102, - serialized_end=1309, -) - - -_CUSTOMATTRIBUTE = _descriptor.Descriptor( - name="CustomAttribute", - full_name="google.cloud.talent.v4beta1.CustomAttribute", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="string_values", - full_name="google.cloud.talent.v4beta1.CustomAttribute.string_values", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="long_values", - full_name="google.cloud.talent.v4beta1.CustomAttribute.long_values", - index=1, - number=2, - type=3, - cpp_type=2, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filterable", - full_name="google.cloud.talent.v4beta1.CustomAttribute.filterable", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1311, - serialized_end=1392, -) - - -_SPELLINGCORRECTION = _descriptor.Descriptor( - name="SpellingCorrection", - full_name="google.cloud.talent.v4beta1.SpellingCorrection", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="corrected", - full_name="google.cloud.talent.v4beta1.SpellingCorrection.corrected", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="corrected_text", - full_name="google.cloud.talent.v4beta1.SpellingCorrection.corrected_text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="corrected_html", - full_name="google.cloud.talent.v4beta1.SpellingCorrection.corrected_html", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1394, - serialized_end=1481, -) - - -_COMPENSATIONINFO_COMPENSATIONENTRY = _descriptor.Descriptor( - name="CompensationEntry", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="unit", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.unit", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="amount", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="range", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.description", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expected_units_per_year", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected_units_per_year", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="compensation_amount", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.compensation_amount", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=1816, - serialized_end=2218, -) - -_COMPENSATIONINFO_COMPENSATIONRANGE = _descriptor.Descriptor( - name="CompensationRange", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationRange", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="max_compensation", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.max_compensation", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="min_compensation", - full_name="google.cloud.talent.v4beta1.CompensationInfo.CompensationRange.min_compensation", - index=1, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2220, - serialized_end=2331, -) - -_COMPENSATIONINFO = _descriptor.Descriptor( - name="CompensationInfo", - full_name="google.cloud.talent.v4beta1.CompensationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entries", - full_name="google.cloud.talent.v4beta1.CompensationInfo.entries", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annualized_base_compensation_range", - full_name="google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annualized_total_compensation_range", - full_name="google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _COMPENSATIONINFO_COMPENSATIONENTRY, - _COMPENSATIONINFO_COMPENSATIONRANGE, - ], - enum_types=[_COMPENSATIONINFO_COMPENSATIONTYPE, _COMPENSATIONINFO_COMPENSATIONUNIT], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1484, - serialized_end=2674, -) - - -_CERTIFICATION = _descriptor.Descriptor( - name="Certification", - full_name="google.cloud.talent.v4beta1.Certification", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.talent.v4beta1.Certification.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="acquire_date", - full_name="google.cloud.talent.v4beta1.Certification.acquire_date", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expire_date", - full_name="google.cloud.talent.v4beta1.Certification.expire_date", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="authority", - full_name="google.cloud.talent.v4beta1.Certification.authority", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.Certification.description", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2677, - serialized_end=2835, -) - - -_SKILL = _descriptor.Descriptor( - name="Skill", - full_name="google.cloud.talent.v4beta1.Skill", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.talent.v4beta1.Skill.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="last_used_date", - full_name="google.cloud.talent.v4beta1.Skill.last_used_date", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="level", - full_name="google.cloud.talent.v4beta1.Skill.level", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="context", - full_name="google.cloud.talent.v4beta1.Skill.context", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skill_name_snippet", - full_name="google.cloud.talent.v4beta1.Skill.skill_name_snippet", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2838, - serialized_end=3027, -) - - -_INTERVIEW = _descriptor.Descriptor( - name="Interview", - full_name="google.cloud.talent.v4beta1.Interview", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="rating", - full_name="google.cloud.talent.v4beta1.Interview.rating", - index=0, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="outcome", - full_name="google.cloud.talent.v4beta1.Interview.outcome", - index=1, - number=7, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3029, - serialized_end=3153, -) - - -_RATING = _descriptor.Descriptor( - name="Rating", - full_name="google.cloud.talent.v4beta1.Rating", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="overall", - full_name="google.cloud.talent.v4beta1.Rating.overall", - index=0, - number=1, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="min", - full_name="google.cloud.talent.v4beta1.Rating.min", - index=1, - number=2, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max", - full_name="google.cloud.talent.v4beta1.Rating.max", - index=2, - number=3, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="interval", - full_name="google.cloud.talent.v4beta1.Rating.interval", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3155, - serialized_end=3224, -) - - -_BATCHOPERATIONMETADATA = _descriptor.Descriptor( - name="BatchOperationMetadata", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="state_description", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.state_description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="success_count", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.success_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="failure_count", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.failure_count", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_count", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.total_count", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.create_time", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.update_time", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.talent.v4beta1.BatchOperationMetadata.end_time", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BATCHOPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3227, - serialized_end=3687, -) - -_TIMESTAMPRANGE.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TIMESTAMPRANGE.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LOCATION.fields_by_name["location_type"].enum_type = _LOCATION_LOCATIONTYPE -_LOCATION.fields_by_name[ - "postal_address" -].message_type = google_dot_type_dot_postal__address__pb2._POSTALADDRESS -_LOCATION.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LOCATION_LOCATIONTYPE.containing_type = _LOCATION -_REQUESTMETADATA.fields_by_name["device_info"].message_type = _DEVICEINFO -_DEVICEINFO.fields_by_name["device_type"].enum_type = _DEVICEINFO_DEVICETYPE -_DEVICEINFO_DEVICETYPE.containing_type = _DEVICEINFO -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "type" -].enum_type = _COMPENSATIONINFO_COMPENSATIONTYPE -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "unit" -].enum_type = _COMPENSATIONINFO_COMPENSATIONUNIT -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "amount" -].message_type = google_dot_type_dot_money__pb2._MONEY -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "range" -].message_type = _COMPENSATIONINFO_COMPENSATIONRANGE -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "expected_units_per_year" -].message_type = google_dot_protobuf_dot_wrappers__pb2._DOUBLEVALUE -_COMPENSATIONINFO_COMPENSATIONENTRY.containing_type = _COMPENSATIONINFO -_COMPENSATIONINFO_COMPENSATIONENTRY.oneofs_by_name["compensation_amount"].fields.append( - _COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name["amount"] -) -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "amount" -].containing_oneof = _COMPENSATIONINFO_COMPENSATIONENTRY.oneofs_by_name[ - "compensation_amount" -] -_COMPENSATIONINFO_COMPENSATIONENTRY.oneofs_by_name["compensation_amount"].fields.append( - _COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name["range"] -) -_COMPENSATIONINFO_COMPENSATIONENTRY.fields_by_name[ - "range" -].containing_oneof = _COMPENSATIONINFO_COMPENSATIONENTRY.oneofs_by_name[ - "compensation_amount" -] -_COMPENSATIONINFO_COMPENSATIONRANGE.fields_by_name[ - "max_compensation" -].message_type = google_dot_type_dot_money__pb2._MONEY -_COMPENSATIONINFO_COMPENSATIONRANGE.fields_by_name[ - "min_compensation" -].message_type = google_dot_type_dot_money__pb2._MONEY -_COMPENSATIONINFO_COMPENSATIONRANGE.containing_type = _COMPENSATIONINFO -_COMPENSATIONINFO.fields_by_name[ - "entries" -].message_type = _COMPENSATIONINFO_COMPENSATIONENTRY -_COMPENSATIONINFO.fields_by_name[ - "annualized_base_compensation_range" -].message_type = _COMPENSATIONINFO_COMPENSATIONRANGE -_COMPENSATIONINFO.fields_by_name[ - "annualized_total_compensation_range" -].message_type = _COMPENSATIONINFO_COMPENSATIONRANGE -_COMPENSATIONINFO_COMPENSATIONTYPE.containing_type = _COMPENSATIONINFO -_COMPENSATIONINFO_COMPENSATIONUNIT.containing_type = _COMPENSATIONINFO -_CERTIFICATION.fields_by_name[ - "acquire_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_CERTIFICATION.fields_by_name[ - "expire_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_SKILL.fields_by_name[ - "last_used_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_SKILL.fields_by_name["level"].enum_type = _SKILLPROFICIENCYLEVEL -_INTERVIEW.fields_by_name["rating"].message_type = _RATING -_INTERVIEW.fields_by_name["outcome"].enum_type = _OUTCOME -_BATCHOPERATIONMETADATA.fields_by_name[ - "state" -].enum_type = _BATCHOPERATIONMETADATA_STATE -_BATCHOPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA_STATE.containing_type = _BATCHOPERATIONMETADATA -DESCRIPTOR.message_types_by_name["TimestampRange"] = _TIMESTAMPRANGE -DESCRIPTOR.message_types_by_name["Location"] = _LOCATION -DESCRIPTOR.message_types_by_name["RequestMetadata"] = _REQUESTMETADATA -DESCRIPTOR.message_types_by_name["ResponseMetadata"] = _RESPONSEMETADATA -DESCRIPTOR.message_types_by_name["DeviceInfo"] = _DEVICEINFO -DESCRIPTOR.message_types_by_name["CustomAttribute"] = _CUSTOMATTRIBUTE -DESCRIPTOR.message_types_by_name["SpellingCorrection"] = _SPELLINGCORRECTION -DESCRIPTOR.message_types_by_name["CompensationInfo"] = _COMPENSATIONINFO -DESCRIPTOR.message_types_by_name["Certification"] = _CERTIFICATION -DESCRIPTOR.message_types_by_name["Skill"] = _SKILL -DESCRIPTOR.message_types_by_name["Interview"] = _INTERVIEW -DESCRIPTOR.message_types_by_name["Rating"] = _RATING -DESCRIPTOR.message_types_by_name["BatchOperationMetadata"] = _BATCHOPERATIONMETADATA -DESCRIPTOR.enum_types_by_name["CompanySize"] = _COMPANYSIZE -DESCRIPTOR.enum_types_by_name["JobBenefit"] = _JOBBENEFIT -DESCRIPTOR.enum_types_by_name["DegreeType"] = _DEGREETYPE -DESCRIPTOR.enum_types_by_name["EmploymentType"] = _EMPLOYMENTTYPE -DESCRIPTOR.enum_types_by_name["JobLevel"] = _JOBLEVEL -DESCRIPTOR.enum_types_by_name["JobCategory"] = _JOBCATEGORY -DESCRIPTOR.enum_types_by_name["PostingRegion"] = _POSTINGREGION -DESCRIPTOR.enum_types_by_name["Visibility"] = _VISIBILITY -DESCRIPTOR.enum_types_by_name["ContactInfoUsage"] = _CONTACTINFOUSAGE -DESCRIPTOR.enum_types_by_name["HtmlSanitization"] = _HTMLSANITIZATION -DESCRIPTOR.enum_types_by_name["CommuteMethod"] = _COMMUTEMETHOD -DESCRIPTOR.enum_types_by_name["SkillProficiencyLevel"] = _SKILLPROFICIENCYLEVEL -DESCRIPTOR.enum_types_by_name["Outcome"] = _OUTCOME -DESCRIPTOR.enum_types_by_name["AvailabilitySignalType"] = _AVAILABILITYSIGNALTYPE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TimestampRange = _reflection.GeneratedProtocolMessageType( - "TimestampRange", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESTAMPRANGE, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Message representing a period of time between two - timestamps. - - - Attributes: - start_time: - Begin of the period (inclusive). - end_time: - End of the period (exclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.TimestampRange) - ), -) -_sym_db.RegisterMessage(TimestampRange) - -Location = _reflection.GeneratedProtocolMessageType( - "Location", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATION, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""A resource that represents a location with full geographic - information. - - - Attributes: - location_type: - The type of a location, which corresponds to the address lines - field of - [google.type.PostalAddress][google.type.PostalAddress]. For - example, "Downtown, Atlanta, GA, USA" has a type of [LocationT - ype.NEIGHBORHOOD][google.cloud.talent.v4beta1.Location.Locatio - nType.NEIGHBORHOOD], and "Kansas City, KS, USA" has a type of - [LocationType.LOCALITY][google.cloud.talent.v4beta1.Location.L - ocationType.LOCALITY]. - postal_address: - Postal address of the location that includes human readable - information, such as postal delivery and payments addresses. - Given a postal address, a postal service can deliver items to - a premises, P.O. Box, or other delivery location. - lat_lng: - An object representing a latitude/longitude pair. - radius_miles: - Radius in miles of the job location. This value is derived - from the location bounding box in which a circle with the - specified radius centered from - [google.type.LatLng][google.type.LatLng] covers the area - associated with the job location. For example, currently, - "Mountain View, CA, USA" has a radius of 6.17 miles. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Location) - ), -) -_sym_db.RegisterMessage(Location) - -RequestMetadata = _reflection.GeneratedProtocolMessageType( - "RequestMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_REQUESTMETADATA, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Meta information related to the job searcher or entity - conducting the job search. This information is used to improve the - performance of the service. - - - Attributes: - domain: - Required if [allow\_missing\_ids][google.cloud.talent.v4beta1. - RequestMetadata.allow\_missing\_ids] is unset or ``false``. - The client-defined scope or source of the service call, which - typically is the domain on which the service has been - implemented and is currently being run. For example, if the - service is being run by client Foo, Inc., on job board - www.foo.com and career site www.bar.com, then this field is - set to "foo.com" for use on the job board, and "bar.com" for - use on the career site. Note that any improvements to the - model for a particular tenant site rely on this field being - set correctly to a unique domain. The maximum number of - allowed characters is 255. - session_id: - Required if [allow\_missing\_ids][google.cloud.talent.v4beta1. - RequestMetadata.allow\_missing\_ids] is unset or ``false``. A - unique session identification string. A session is defined as - the duration of an end user's interaction with the service - over a certain period. Obfuscate this field for privacy - concerns before providing it to the service. Note that any - improvements to the model for a particular tenant site rely on - this field being set correctly to a unique session ID. The - maximum number of allowed characters is 255. - user_id: - Required if [allow\_missing\_ids][google.cloud.talent.v4beta1. - RequestMetadata.allow\_missing\_ids] is unset or ``false``. A - unique user identification string, as determined by the - client. To have the strongest positive impact on search - quality make sure the client-level is unique. Obfuscate this - field for privacy concerns before providing it to the service. - Note that any improvements to the model for a particular - tenant site rely on this field being set correctly to a unique - user ID. The maximum number of allowed characters is 255. - allow_missing_ids: - Only set when any of - [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], - [session\_id][google.cloud.talent.v4beta1.RequestMetadata.sess - ion\_id] and [user\_id][google.cloud.talent.v4beta1.RequestMet - adata.user\_id] isn't available for some reason. It is highly - recommended not to set this field and provide accurate - [domain][google.cloud.talent.v4beta1.RequestMetadata.domain], - [session\_id][google.cloud.talent.v4beta1.RequestMetadata.sess - ion\_id] and [user\_id][google.cloud.talent.v4beta1.RequestMet - adata.user\_id] for the best service experience. - device_info: - The type of device used by the job seeker at the time of the - call to the service. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.RequestMetadata) - ), -) -_sym_db.RegisterMessage(RequestMetadata) - -ResponseMetadata = _reflection.GeneratedProtocolMessageType( - "ResponseMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_RESPONSEMETADATA, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Additional information returned to client, such as - debugging information. - - - Attributes: - request_id: - A unique id associated with this call. This id is logged for - tracking purposes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ResponseMetadata) - ), -) -_sym_db.RegisterMessage(ResponseMetadata) - -DeviceInfo = _reflection.GeneratedProtocolMessageType( - "DeviceInfo", - (_message.Message,), - dict( - DESCRIPTOR=_DEVICEINFO, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Device information collected from the job seeker, - candidate, or other entity conducting the job search. Providing this - information improves the quality of the search results across devices. - - - Attributes: - device_type: - Type of the device. - id: - A device-specific ID. The ID must be a unique identifier that - distinguishes the device from other devices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeviceInfo) - ), -) -_sym_db.RegisterMessage(DeviceInfo) - -CustomAttribute = _reflection.GeneratedProtocolMessageType( - "CustomAttribute", - (_message.Message,), - dict( - DESCRIPTOR=_CUSTOMATTRIBUTE, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Custom attribute values that are either filterable or - non-filterable. - - - Attributes: - string_values: - Exactly one of [string\_values][google.cloud.talent.v4beta1.Cu - stomAttribute.string\_values] or [long\_values][google.cloud.t - alent.v4beta1.CustomAttribute.long\_values] must be specified. - This field is used to perform a string match - (``CASE_SENSITIVE_MATCH`` or ``CASE_INSENSITIVE_MATCH``) - search. For filterable ``string_value``\ s, a maximum total - number of 200 values is allowed, with each ``string_value`` - has a byte size of no more than 500B. For unfilterable - ``string_values``, the maximum total byte size of unfilterable - ``string_values`` is 50KB. Empty string isn't allowed. - long_values: - Exactly one of [string\_values][google.cloud.talent.v4beta1.Cu - stomAttribute.string\_values] or [long\_values][google.cloud.t - alent.v4beta1.CustomAttribute.long\_values] must be specified. - This field is used to perform number range search. (``EQ``, - ``GT``, ``GE``, ``LE``, ``LT``) over filterable - ``long_value``. Currently at most 1 [long\_values][google.clo - ud.talent.v4beta1.CustomAttribute.long\_values] is supported. - filterable: - If the ``filterable`` flag is true, custom field values are - searchable. If false, values are not searchable. Default is - false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CustomAttribute) - ), -) -_sym_db.RegisterMessage(CustomAttribute) - -SpellingCorrection = _reflection.GeneratedProtocolMessageType( - "SpellingCorrection", - (_message.Message,), - dict( - DESCRIPTOR=_SPELLINGCORRECTION, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Spell check result. - - - Attributes: - corrected: - Indicates if the query was corrected by the spell checker. - corrected_text: - Correction output consisting of the corrected keyword string. - corrected_html: - Corrected output with html tags to highlight the corrected - words. Corrected words are called out with the "..." html - tags. For example, the user input query is "software - enginear", where the second word, "enginear," is incorrect. It - should be "engineer". When spelling correction is enabled, - this value is "software engineer". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SpellingCorrection) - ), -) -_sym_db.RegisterMessage(SpellingCorrection) - -CompensationInfo = _reflection.GeneratedProtocolMessageType( - "CompensationInfo", - (_message.Message,), - dict( - CompensationEntry=_reflection.GeneratedProtocolMessageType( - "CompensationEntry", - (_message.Message,), - dict( - DESCRIPTOR=_COMPENSATIONINFO_COMPENSATIONENTRY, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""A compensation entry that represents one component of - compensation, such as base pay, bonus, or other compensation type. - - Annualization: One compensation entry can be annualized if - it contains - valid - [amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] - or - [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]. - - and its - [expected\_units\_per\_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected\_units\_per\_year] - is set or can be derived. Its annualized range is determined as - ([amount][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] - or - [range][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.range]) - times - [expected\_units\_per\_year][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry.expected\_units\_per\_year]. - - - Attributes: - type: - Compensation type. Default is [CompensationType.COMPENSATION\ - _TYPE\_UNSPECIFIED][google.cloud.talent.v4beta1.CompensationIn - fo.CompensationType.COMPENSATION\_TYPE\_UNSPECIFIED]. - unit: - Frequency of the specified amount. Default is [CompensationUn - it.COMPENSATION\_UNIT\_UNSPECIFIED][google.cloud.talent.v4beta - 1.CompensationInfo.CompensationUnit.COMPENSATION\_UNIT\_UNSPEC - IFIED]. - compensation_amount: - Compensation amount. It could be a fixed amount or a floating - range. - amount: - Compensation amount. - range: - Compensation range. - description: - Compensation description. For example, could indicate equity - terms or provide additional context to an estimated bonus. - expected_units_per_year: - Expected number of units paid each year. If not specified, - when [Job.employment\_types][google.cloud.talent.v4beta1.Job.e - mployment\_types] is FULLTIME, a default value is inferred - based on [unit][google.cloud.talent.v4beta1.CompensationInfo.C - ompensationEntry.unit]. Default values: - HOURLY: 2080 - - DAILY: 260 - WEEKLY: 52 - MONTHLY: 12 - ANNUAL: 1 - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry) - ), - ), - CompensationRange=_reflection.GeneratedProtocolMessageType( - "CompensationRange", - (_message.Message,), - dict( - DESCRIPTOR=_COMPENSATIONINFO_COMPENSATIONRANGE, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Compensation range. - - - Attributes: - max_compensation: - The maximum amount of compensation. If left empty, the value - is set to a maximal compensation value and the currency code - is set to match the [currency - code][google.type.Money.currency\_code] of min\_compensation. - min_compensation: - The minimum amount of compensation. If left empty, the value - is set to zero and the currency code is set to match the - [currency code][google.type.Money.currency\_code] of - max\_compensation. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompensationInfo.CompensationRange) - ), - ), - DESCRIPTOR=_COMPENSATIONINFO, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Job compensation details. - - - Attributes: - entries: - Job compensation information. At most one entry can be of - type [CompensationInfo.CompensationType.BASE][google.cloud.tal - ent.v4beta1.CompensationInfo.CompensationType.BASE], which is - referred as **base compensation entry** for the job. - annualized_base_compensation_range: - Output only. Annualized base compensation range. Computed as - base compensation entry's [CompensationEntry.amount][google.cl - oud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] - times [CompensationEntry.expected\_units\_per\_year][google.cl - oud.talent.v4beta1.CompensationInfo.CompensationEntry.expected - \_units\_per\_year]. See [CompensationEntry][google.cloud.tal - ent.v4beta1.CompensationInfo.CompensationEntry] for - explanation on compensation annualization. - annualized_total_compensation_range: - Output only. Annualized total compensation range. Computed as - all compensation entries' [CompensationEntry.amount][google.cl - oud.talent.v4beta1.CompensationInfo.CompensationEntry.amount] - times [CompensationEntry.expected\_units\_per\_year][google.cl - oud.talent.v4beta1.CompensationInfo.CompensationEntry.expected - \_units\_per\_year]. See [CompensationEntry][google.cloud.tal - ent.v4beta1.CompensationInfo.CompensationEntry] for - explanation on compensation annualization. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompensationInfo) - ), -) -_sym_db.RegisterMessage(CompensationInfo) -_sym_db.RegisterMessage(CompensationInfo.CompensationEntry) -_sym_db.RegisterMessage(CompensationInfo.CompensationRange) - -Certification = _reflection.GeneratedProtocolMessageType( - "Certification", - (_message.Message,), - dict( - DESCRIPTOR=_CERTIFICATION, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Resource that represents a license or certification. - - - Attributes: - display_name: - Name of license or certification. Number of characters - allowed is 100. - acquire_date: - Acquisition date or effective date of license or - certification. - expire_date: - Expiration date of license of certification. - authority: - Authority of license, such as government. Number of - characters allowed is 100. - description: - Description of license or certification. Number of characters - allowed is 100,000. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Certification) - ), -) -_sym_db.RegisterMessage(Certification) - -Skill = _reflection.GeneratedProtocolMessageType( - "Skill", - (_message.Message,), - dict( - DESCRIPTOR=_SKILL, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Resource that represents a skill of a candidate. - - - Attributes: - display_name: - Skill display name. For example, "Java", "Python". Number of - characters allowed is 100. - last_used_date: - The last time this skill was used. - level: - Skill proficiency level which indicates how proficient the - candidate is at this skill. - context: - A paragraph describes context of this skill. Number of - characters allowed is 100,000. - skill_name_snippet: - Output only. Skill name snippet shows how the [display\_name][ - google.cloud.talent.v4beta1.Skill.display\_name] is related to - a search query. It's empty if the [display\_name][google.cloud - .talent.v4beta1.Skill.display\_name] isn't related to the - search query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Skill) - ), -) -_sym_db.RegisterMessage(Skill) - -Interview = _reflection.GeneratedProtocolMessageType( - "Interview", - (_message.Message,), - dict( - DESCRIPTOR=_INTERVIEW, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Details of an interview. - - - Attributes: - rating: - The rating on this interview. - outcome: - Required. The overall decision resulting from this interview - (positive, negative, nuetral). - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Interview) - ), -) -_sym_db.RegisterMessage(Interview) - -Rating = _reflection.GeneratedProtocolMessageType( - "Rating", - (_message.Message,), - dict( - DESCRIPTOR=_RATING, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""The details of the score received for an assessment or - interview. - - - Attributes: - overall: - Overall score. - min: - The minimum value for the score. - max: - The maximum value for the score. - interval: - The steps within the score (for example, interval = 1 max = 5 - min = 1 indicates that the score can be 1, 2, 3, 4, or 5) - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Rating) - ), -) -_sym_db.RegisterMessage(Rating) - -BatchOperationMetadata = _reflection.GeneratedProtocolMessageType( - "BatchOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHOPERATIONMETADATA, - __module__="google.cloud.talent_v4beta1.proto.common_pb2", - __doc__="""Metadata used for long running operations returned by CTS - batch APIs. It's used to replace - [google.longrunning.Operation.metadata][google.longrunning.Operation.metadata]. - - - Attributes: - state: - The state of a long running operation. - state_description: - More detailed information about operation state. - success_count: - Count of successful item(s) inside an operation. - failure_count: - Count of failed item(s) inside an operation. - total_count: - Count of total item(s) inside an operation. - create_time: - The time when the batch operation is created. - update_time: - The time when the batch operation status is updated. The - metadata and the [update\_time][google.cloud.talent.v4beta1.Ba - tchOperationMetadata.update\_time] is refreshed every minute - otherwise cached data is returned. - end_time: - The time when the batch operation is finished and [google.long - running.Operation.done][google.longrunning.Operation.done] is - set to ``true``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.BatchOperationMetadata) - ), -) -_sym_db.RegisterMessage(BatchOperationMetadata) - - -DESCRIPTOR._options = None -_VISIBILITY._options = None -_COMPENSATIONINFO.fields_by_name["annualized_base_compensation_range"]._options = None -_COMPENSATIONINFO.fields_by_name["annualized_total_compensation_range"]._options = None -_SKILL.fields_by_name["skill_name_snippet"]._options = None -_INTERVIEW.fields_by_name["outcome"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/common_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/common_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/common_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/company.proto b/talent/google/cloud/talent_v4beta1/proto/company.proto deleted file mode 100644 index 74f0b88943ed..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company.proto +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "CompanyResourceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A Company resource represents a company in the service. A company is the -// entity that owns job postings, that is, the hiring entity responsible for -// employing applicants for the job position. -message Company { - option (google.api.resource) = { - type: "jobs.googleapis.com/Company" - pattern: "projects/{project}/companies/{company}" - pattern: "projects/{project}/tenants/{tenant}/companies/{company}" - }; - - // Derived details about the company. - message DerivedInfo { - // A structured headquarters location of the company, resolved from - // [Company.headquarters_address][google.cloud.talent.v4beta1.Company.headquarters_address] if provided. - Location headquarters_location = 1; - } - - // Required during company update. - // - // The resource name for a company. This is generated by the service when a - // company is created. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for - // example, "projects/foo/tenants/bar/companies/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/companies/bar". - string name = 1; - - // Required. The display name of the company, for example, "Google LLC". - string display_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Client side company identifier, used to uniquely identify the - // company. - // - // The maximum number of allowed characters is 255. - string external_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // The employer's company size. - CompanySize size = 4; - - // The street address of the company's main headquarters, which may be - // different from the job location. The service attempts - // to geolocate the provided address, and populates a more specific - // location wherever possible in [DerivedInfo.headquarters_location][google.cloud.talent.v4beta1.Company.DerivedInfo.headquarters_location]. - string headquarters_address = 5; - - // Set to true if it is the hiring agency that post jobs for other - // employers. - // - // Defaults to false if not provided. - bool hiring_agency = 6; - - // Equal Employment Opportunity legal disclaimer text to be - // associated with all jobs, and typically to be displayed in all - // roles. - // - // The maximum number of allowed characters is 500. - string eeo_text = 7; - - // The URI representing the company's primary web site or home page, - // for example, "https://www.google.com". - // - // The maximum number of allowed characters is 255. - string website_uri = 8; - - // The URI to employer's career site or careers page on the employer's web - // site, for example, "https://careers.google.com". - string career_site_uri = 9; - - // A URI that hosts the employer's company logo. - string image_uri = 10; - - // A list of keys of filterable [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes], whose - // corresponding `string_values` are used in keyword searches. Jobs with - // `string_values` under these specified field keys are returned if any - // of the values match the search keyword. Custom field values with - // parenthesis, brackets and special symbols are not searchable as-is, - // and those keyword queries must be surrounded by quotes. - repeated string keyword_searchable_job_custom_attributes = 11; - - // Output only. Derived details about the company. - DerivedInfo derived_info = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Indicates whether a company is flagged to be suspended from - // public availability by the service when job content appears suspicious, - // abusive, or spammy. - bool suspended = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/company_pb2.py b/talent/google/cloud/talent_v4beta1/proto/company_pb2.py deleted file mode 100644 index 1def4dd3a20b..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company_pb2.py +++ /dev/null @@ -1,454 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/company.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/company.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\024CompanyResourceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n/google/cloud/talent_v4beta1/proto/company.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1cgoogle/api/annotations.proto"\xfc\x04\n\x07\x43ompany\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x19\n\x0c\x64isplay_name\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x65xternal_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x36\n\x04size\x18\x04 \x01(\x0e\x32(.google.cloud.talent.v4beta1.CompanySize\x12\x1c\n\x14headquarters_address\x18\x05 \x01(\t\x12\x15\n\rhiring_agency\x18\x06 \x01(\x08\x12\x10\n\x08\x65\x65o_text\x18\x07 \x01(\t\x12\x13\n\x0bwebsite_uri\x18\x08 \x01(\t\x12\x17\n\x0f\x63\x61reer_site_uri\x18\t \x01(\t\x12\x11\n\timage_uri\x18\n \x01(\t\x12\x30\n(keyword_searchable_job_custom_attributes\x18\x0b \x03(\t\x12K\n\x0c\x64\x65rived_info\x18\x0c \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Company.DerivedInfoB\x03\xe0\x41\x03\x12\x16\n\tsuspended\x18\r \x01(\x08\x42\x03\xe0\x41\x03\x1aS\n\x0b\x44\x65rivedInfo\x12\x44\n\x15headquarters_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location:\x81\x01\xea\x41~\n\x1bjobs.googleapis.com/Company\x12&projects/{project}/companies/{company}\x12\x37projects/{project}/tenants/{tenant}/companies/{company}B\x82\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x14\x43ompanyResourceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_COMPANY_DERIVEDINFO = _descriptor.Descriptor( - name="DerivedInfo", - full_name="google.cloud.talent.v4beta1.Company.DerivedInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="headquarters_location", - full_name="google.cloud.talent.v4beta1.Company.DerivedInfo.headquarters_location", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=640, - serialized_end=723, -) - -_COMPANY = _descriptor.Descriptor( - name="Company", - full_name="google.cloud.talent.v4beta1.Company", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.Company.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.talent.v4beta1.Company.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="external_id", - full_name="google.cloud.talent.v4beta1.Company.external_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="size", - full_name="google.cloud.talent.v4beta1.Company.size", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="headquarters_address", - full_name="google.cloud.talent.v4beta1.Company.headquarters_address", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="hiring_agency", - full_name="google.cloud.talent.v4beta1.Company.hiring_agency", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="eeo_text", - full_name="google.cloud.talent.v4beta1.Company.eeo_text", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="website_uri", - full_name="google.cloud.talent.v4beta1.Company.website_uri", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="career_site_uri", - full_name="google.cloud.talent.v4beta1.Company.career_site_uri", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.talent.v4beta1.Company.image_uri", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="keyword_searchable_job_custom_attributes", - full_name="google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes", - index=10, - number=11, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="derived_info", - full_name="google.cloud.talent.v4beta1.Company.derived_info", - index=11, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="suspended", - full_name="google.cloud.talent.v4beta1.Company.suspended", - index=12, - number=13, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_COMPANY_DERIVEDINFO], - enum_types=[], - serialized_options=_b( - "\352A~\n\033jobs.googleapis.com/Company\022&projects/{project}/companies/{company}\0227projects/{project}/tenants/{tenant}/companies/{company}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=219, - serialized_end=855, -) - -_COMPANY_DERIVEDINFO.fields_by_name[ - "headquarters_location" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._LOCATION -) -_COMPANY_DERIVEDINFO.containing_type = _COMPANY -_COMPANY.fields_by_name[ - "size" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._COMPANYSIZE -) -_COMPANY.fields_by_name["derived_info"].message_type = _COMPANY_DERIVEDINFO -DESCRIPTOR.message_types_by_name["Company"] = _COMPANY -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Company = _reflection.GeneratedProtocolMessageType( - "Company", - (_message.Message,), - dict( - DerivedInfo=_reflection.GeneratedProtocolMessageType( - "DerivedInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COMPANY_DERIVEDINFO, - __module__="google.cloud.talent_v4beta1.proto.company_pb2", - __doc__="""Derived details about the company. - - - Attributes: - headquarters_location: - A structured headquarters location of the company, resolved - from [Company.headquarters\_address][google.cloud.talent.v4bet - a1.Company.headquarters\_address] if provided. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Company.DerivedInfo) - ), - ), - DESCRIPTOR=_COMPANY, - __module__="google.cloud.talent_v4beta1.proto.company_pb2", - __doc__="""A Company resource represents a company in the service. A - company is the entity that owns job postings, that is, the hiring entity - responsible for employing applicants for the job position. - - - Attributes: - name: - Required during company update. The resource name for a - company. This is generated by the service when a company is - created. The format is "projects/{project\_id}/tenants/{tenan - t\_id}/companies/{company\_id}", for example, - "projects/foo/tenants/bar/companies/baz". If tenant id is - unspecified, the default tenant is used. For example, - "projects/foo/companies/bar". - display_name: - Required. The display name of the company, for example, - "Google LLC". - external_id: - Required. Client side company identifier, used to uniquely - identify the company. The maximum number of allowed - characters is 255. - size: - The employer's company size. - headquarters_address: - The street address of the company's main headquarters, which - may be different from the job location. The service attempts - to geolocate the provided address, and populates a more - specific location wherever possible in [DerivedInfo.headquarte - rs\_location][google.cloud.talent.v4beta1.Company.DerivedInfo. - headquarters\_location]. - hiring_agency: - Set to true if it is the hiring agency that post jobs for - other employers. Defaults to false if not provided. - eeo_text: - Equal Employment Opportunity legal disclaimer text to be - associated with all jobs, and typically to be displayed in all - roles. The maximum number of allowed characters is 500. - website_uri: - The URI representing the company's primary web site or home - page, for example, "https://www.google.com". The maximum - number of allowed characters is 255. - career_site_uri: - The URI to employer's career site or careers page on the - employer's web site, for example, - "https://careers.google.com". - image_uri: - A URI that hosts the employer's company logo. - keyword_searchable_job_custom_attributes: - A list of keys of filterable [Job.custom\_attributes][google.c - loud.talent.v4beta1.Job.custom\_attributes], whose - corresponding ``string_values`` are used in keyword searches. - Jobs with ``string_values`` under these specified field keys - are returned if any of the values match the search keyword. - Custom field values with parenthesis, brackets and special - symbols are not searchable as-is, and those keyword queries - must be surrounded by quotes. - derived_info: - Output only. Derived details about the company. - suspended: - Output only. Indicates whether a company is flagged to be - suspended from public availability by the service when job - content appears suspicious, abusive, or spammy. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Company) - ), -) -_sym_db.RegisterMessage(Company) -_sym_db.RegisterMessage(Company.DerivedInfo) - - -DESCRIPTOR._options = None -_COMPANY.fields_by_name["display_name"]._options = None -_COMPANY.fields_by_name["external_id"]._options = None -_COMPANY.fields_by_name["derived_info"]._options = None -_COMPANY.fields_by_name["suspended"]._options = None -_COMPANY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/company_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/company_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/company_service.proto b/talent/google/cloud/talent_v4beta1/proto/company_service.proto deleted file mode 100644 index daeb2cceaeff..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company_service.proto +++ /dev/null @@ -1,215 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/cloud/talent/v4beta1/company.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "CompanyServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service that handles company management, including CRUD and enumeration. -service CompanyService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Creates a new company entity. - rpc CreateCompany(CreateCompanyRequest) returns (Company) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/companies" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/companies" - body: "*" - } - }; - option (google.api.method_signature) = "parent,company"; - } - - // Retrieves specified company. - rpc GetCompany(GetCompanyRequest) returns (Company) { - option (google.api.http) = { - get: "/v4beta1/{name=projects/*/tenants/*/companies/*}" - additional_bindings { - get: "/v4beta1/{name=projects/*/companies/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Updates specified company. - rpc UpdateCompany(UpdateCompanyRequest) returns (Company) { - option (google.api.http) = { - patch: "/v4beta1/{company.name=projects/*/tenants/*/companies/*}" - body: "*" - additional_bindings { - patch: "/v4beta1/{company.name=projects/*/companies/*}" - body: "*" - } - }; - option (google.api.method_signature) = "company"; - } - - // Deletes specified company. - // Prerequisite: The company has no jobs associated with it. - rpc DeleteCompany(DeleteCompanyRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v4beta1/{name=projects/*/tenants/*/companies/*}" - additional_bindings { - delete: "/v4beta1/{name=projects/*/companies/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Lists all companies associated with the project. - rpc ListCompanies(ListCompaniesRequest) returns (ListCompaniesResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*/tenants/*}/companies" - additional_bindings { - get: "/v4beta1/{parent=projects/*}/companies" - } - }; - option (google.api.method_signature) = "parent"; - } -} - -// The Request of the CreateCompany method. -message CreateCompanyRequest { - // Required. Resource name of the tenant under which the company is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created, for example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Company" - } - ]; - - // Required. The company to be created. - Company company = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for getting a company by name. -message GetCompanyRequest { - // Required. The resource name of the company to be retrieved. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for - // example, "projects/api-test-project/tenants/foo/companies/bar". - // - // If tenant id is unspecified, the default tenant is used, for - // example, "projects/api-test-project/companies/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Company" - } - ]; -} - -// Request for updating a specified company. -message UpdateCompanyRequest { - // Required. The company resource to replace the current resource in the system. - Company company = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. - // - // If [update_mask][google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask] is provided, only the specified fields in - // [company][google.cloud.talent.v4beta1.UpdateCompanyRequest.company] are updated. Otherwise all the fields are updated. - // - // A field mask to specify the company fields to be updated. Only - // top level fields of [Company][google.cloud.talent.v4beta1.Company] are supported. - google.protobuf.FieldMask update_mask = 2; -} - -// Request to delete a company. -message DeleteCompanyRequest { - // Required. The resource name of the company to be deleted. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for - // example, "projects/foo/tenants/bar/companies/baz". - // - // If tenant id is unspecified, the default tenant is used, for - // example, "projects/foo/companies/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Company" - } - ]; -} - -// List companies for which the client has ACL visibility. -message ListCompaniesRequest { - // Required. Resource name of the tenant under which the company is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenant/bar". - // - // If tenant id is unspecified, the default tenant will be used, for - // example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/TenantOrProject" - } - ]; - - // The starting indicator from which to return results. - string page_token = 2; - - // The maximum number of companies to be returned, at most 100. - // Default is 100 if a non-positive number is provided. - int32 page_size = 3; - - // Set to true if the companies requested must have open jobs. - // - // Defaults to false. - // - // If true, at most [page_size][google.cloud.talent.v4beta1.ListCompaniesRequest.page_size] of companies are fetched, among which - // only those with open jobs are returned. - bool require_open_jobs = 4; -} - -// The List companies response object. -message ListCompaniesResponse { - // Companies for the current client. - repeated Company companies = 1; - - // A token to retrieve the next page of results. - string next_page_token = 2; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 3; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/company_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/company_service_pb2.py deleted file mode 100644 index fb47f132ba7f..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company_service_pb2.py +++ /dev/null @@ -1,688 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/company_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - company_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/company_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\023CompanyServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n7google/cloud/talent_v4beta1/proto/company_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a/google/cloud/talent_v4beta1/proto/company.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x87\x01\n\x14\x43reateCompanyRequest\x12\x33\n\x06parent\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\x12\x1bjobs.googleapis.com/Company\x12:\n\x07\x63ompany\x18\x02 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02"F\n\x11GetCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company"\x83\x01\n\x14UpdateCompanyRequest\x12:\n\x07\x63ompany\x18\x01 \x01(\x0b\x32$.google.cloud.talent.v4beta1.CompanyB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"I\n\x14\x44\x65leteCompanyRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company"\x95\x01\n\x14ListCompaniesRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#jobs.googleapis.com/TenantOrProject\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12\x19\n\x11require_open_jobs\x18\x04 \x01(\x08"\xaa\x01\n\x15ListCompaniesResponse\x12\x37\n\tcompanies\x18\x01 \x03(\x0b\x32$.google.cloud.talent.v4beta1.Company\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xd2\t\n\x0e\x43ompanyService\x12\xe3\x01\n\rCreateCompany\x12\x31.google.cloud.talent.v4beta1.CreateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company"y\x82\xd3\xe4\x93\x02\x62"0/v4beta1/{parent=projects/*/tenants/*}/companies:\x01*Z+"&/v4beta1/{parent=projects/*}/companies:\x01*\xda\x41\x0eparent,company\x12\xcd\x01\n\nGetCompany\x12..google.cloud.talent.v4beta1.GetCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company"i\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\x12&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xed\x01\n\rUpdateCompany\x12\x31.google.cloud.talent.v4beta1.UpdateCompanyRequest\x1a$.google.cloud.talent.v4beta1.Company"\x82\x01\x82\xd3\xe4\x93\x02r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\x01*Z32./v4beta1/{company.name=projects/*/companies/*}:\x01*\xda\x41\x07\x63ompany\x12\xc5\x01\n\rDeleteCompany\x12\x31.google.cloud.talent.v4beta1.DeleteCompanyRequest\x1a\x16.google.protobuf.Empty"i\x82\xd3\xe4\x93\x02\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\xda\x41\x04name\x12\xe3\x01\n\rListCompanies\x12\x31.google.cloud.talent.v4beta1.ListCompaniesRequest\x1a\x32.google.cloud.talent.v4beta1.ListCompaniesResponse"k\x82\xd3\xe4\x93\x02\\\x12\x30/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\x12&/v4beta1/{parent=projects/*}/companies\xda\x41\x06parent\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x81\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x13\x43ompanyServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATECOMPANYREQUEST = _descriptor.Descriptor( - name="CreateCompanyRequest", - full_name="google.cloud.talent.v4beta1.CreateCompanyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateCompanyRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\022\033jobs.googleapis.com/Company" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company", - full_name="google.cloud.talent.v4beta1.CreateCompanyRequest.company", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=364, - serialized_end=499, -) - - -_GETCOMPANYREQUEST = _descriptor.Descriptor( - name="GetCompanyRequest", - full_name="google.cloud.talent.v4beta1.GetCompanyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.GetCompanyRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Company" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=501, - serialized_end=571, -) - - -_UPDATECOMPANYREQUEST = _descriptor.Descriptor( - name="UpdateCompanyRequest", - full_name="google.cloud.talent.v4beta1.UpdateCompanyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="company", - full_name="google.cloud.talent.v4beta1.UpdateCompanyRequest.company", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.UpdateCompanyRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=574, - serialized_end=705, -) - - -_DELETECOMPANYREQUEST = _descriptor.Descriptor( - name="DeleteCompanyRequest", - full_name="google.cloud.talent.v4beta1.DeleteCompanyRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.DeleteCompanyRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Company" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=707, - serialized_end=780, -) - - -_LISTCOMPANIESREQUEST = _descriptor.Descriptor( - name="ListCompaniesRequest", - full_name="google.cloud.talent.v4beta1.ListCompaniesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.ListCompaniesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#jobs.googleapis.com/TenantOrProject" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.ListCompaniesRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.ListCompaniesRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="require_open_jobs", - full_name="google.cloud.talent.v4beta1.ListCompaniesRequest.require_open_jobs", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=783, - serialized_end=932, -) - - -_LISTCOMPANIESRESPONSE = _descriptor.Descriptor( - name="ListCompaniesResponse", - full_name="google.cloud.talent.v4beta1.ListCompaniesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="companies", - full_name="google.cloud.talent.v4beta1.ListCompaniesResponse.companies", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.ListCompaniesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.ListCompaniesResponse.metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=935, - serialized_end=1105, -) - -_CREATECOMPANYREQUEST.fields_by_name[ - "company" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY -) -_UPDATECOMPANYREQUEST.fields_by_name[ - "company" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY -) -_UPDATECOMPANYREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTCOMPANIESRESPONSE.fields_by_name[ - "companies" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY -) -_LISTCOMPANIESRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -DESCRIPTOR.message_types_by_name["CreateCompanyRequest"] = _CREATECOMPANYREQUEST -DESCRIPTOR.message_types_by_name["GetCompanyRequest"] = _GETCOMPANYREQUEST -DESCRIPTOR.message_types_by_name["UpdateCompanyRequest"] = _UPDATECOMPANYREQUEST -DESCRIPTOR.message_types_by_name["DeleteCompanyRequest"] = _DELETECOMPANYREQUEST -DESCRIPTOR.message_types_by_name["ListCompaniesRequest"] = _LISTCOMPANIESREQUEST -DESCRIPTOR.message_types_by_name["ListCompaniesResponse"] = _LISTCOMPANIESRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateCompanyRequest = _reflection.GeneratedProtocolMessageType( - "CreateCompanyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATECOMPANYREQUEST, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""The Request of the CreateCompany method. - - - Attributes: - parent: - Required. Resource name of the tenant under which the company - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}", for example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created, for example, "projects/foo". - company: - Required. The company to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateCompanyRequest) - ), -) -_sym_db.RegisterMessage(CreateCompanyRequest) - -GetCompanyRequest = _reflection.GeneratedProtocolMessageType( - "GetCompanyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETCOMPANYREQUEST, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""Request for getting a company by name. - - - Attributes: - name: - Required. The resource name of the company to be retrieved. - The format is "projects/{project\_id}/tenants/{tenant\_id}/com - panies/{company\_id}", for example, "projects/api-test- - project/tenants/foo/companies/bar". If tenant id is - unspecified, the default tenant is used, for example, - "projects/api-test-project/companies/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.GetCompanyRequest) - ), -) -_sym_db.RegisterMessage(GetCompanyRequest) - -UpdateCompanyRequest = _reflection.GeneratedProtocolMessageType( - "UpdateCompanyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATECOMPANYREQUEST, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""Request for updating a specified company. - - - Attributes: - company: - Required. The company resource to replace the current resource - in the system. - update_mask: - Strongly recommended for the best service experience. If [upd - ate\_mask][google.cloud.talent.v4beta1.UpdateCompanyRequest.up - date\_mask] is provided, only the specified fields in [company - ][google.cloud.talent.v4beta1.UpdateCompanyRequest.company] - are updated. Otherwise all the fields are updated. A field - mask to specify the company fields to be updated. Only top - level fields of [Company][google.cloud.talent.v4beta1.Company] - are supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.UpdateCompanyRequest) - ), -) -_sym_db.RegisterMessage(UpdateCompanyRequest) - -DeleteCompanyRequest = _reflection.GeneratedProtocolMessageType( - "DeleteCompanyRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETECOMPANYREQUEST, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""Request to delete a company. - - - Attributes: - name: - Required. The resource name of the company to be deleted. The - format is "projects/{project\_id}/tenants/{tenant\_id}/compani - es/{company\_id}", for example, - "projects/foo/tenants/bar/companies/baz". If tenant id is - unspecified, the default tenant is used, for example, - "projects/foo/companies/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeleteCompanyRequest) - ), -) -_sym_db.RegisterMessage(DeleteCompanyRequest) - -ListCompaniesRequest = _reflection.GeneratedProtocolMessageType( - "ListCompaniesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCOMPANIESREQUEST, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""List companies for which the client has ACL visibility. - - - Attributes: - parent: - Required. Resource name of the tenant under which the company - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}", for example, - "projects/foo/tenant/bar". If tenant id is unspecified, the - default tenant will be used, for example, "projects/foo". - page_token: - The starting indicator from which to return results. - page_size: - The maximum number of companies to be returned, at most 100. - Default is 100 if a non-positive number is provided. - require_open_jobs: - Set to true if the companies requested must have open jobs. - Defaults to false. If true, at most [page\_size][google.cloud - .talent.v4beta1.ListCompaniesRequest.page\_size] of companies - are fetched, among which only those with open jobs are - returned. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListCompaniesRequest) - ), -) -_sym_db.RegisterMessage(ListCompaniesRequest) - -ListCompaniesResponse = _reflection.GeneratedProtocolMessageType( - "ListCompaniesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTCOMPANIESRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.company_service_pb2", - __doc__="""The List companies response object. - - - Attributes: - companies: - Companies for the current client. - next_page_token: - A token to retrieve the next page of results. - metadata: - Additional information for the API invocation, such as the - request tracking id. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListCompaniesResponse) - ), -) -_sym_db.RegisterMessage(ListCompaniesResponse) - - -DESCRIPTOR._options = None -_CREATECOMPANYREQUEST.fields_by_name["parent"]._options = None -_CREATECOMPANYREQUEST.fields_by_name["company"]._options = None -_GETCOMPANYREQUEST.fields_by_name["name"]._options = None -_UPDATECOMPANYREQUEST.fields_by_name["company"]._options = None -_DELETECOMPANYREQUEST.fields_by_name["name"]._options = None -_LISTCOMPANIESREQUEST.fields_by_name["parent"]._options = None - -_COMPANYSERVICE = _descriptor.ServiceDescriptor( - name="CompanyService", - full_name="google.cloud.talent.v4beta1.CompanyService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=1108, - serialized_end=2342, - methods=[ - _descriptor.MethodDescriptor( - name="CreateCompany", - full_name="google.cloud.talent.v4beta1.CompanyService.CreateCompany", - index=0, - containing_service=None, - input_type=_CREATECOMPANYREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY, - serialized_options=_b( - '\202\323\344\223\002b"0/v4beta1/{parent=projects/*/tenants/*}/companies:\001*Z+"&/v4beta1/{parent=projects/*}/companies:\001*\332A\016parent,company' - ), - ), - _descriptor.MethodDescriptor( - name="GetCompany", - full_name="google.cloud.talent.v4beta1.CompanyService.GetCompany", - index=1, - containing_service=None, - input_type=_GETCOMPANYREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY, - serialized_options=_b( - "\202\323\344\223\002\\\0220/v4beta1/{name=projects/*/tenants/*/companies/*}Z(\022&/v4beta1/{name=projects/*/companies/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateCompany", - full_name="google.cloud.talent.v4beta1.CompanyService.UpdateCompany", - index=2, - containing_service=None, - input_type=_UPDATECOMPANYREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2._COMPANY, - serialized_options=_b( - "\202\323\344\223\002r28/v4beta1/{company.name=projects/*/tenants/*/companies/*}:\001*Z32./v4beta1/{company.name=projects/*/companies/*}:\001*\332A\007company" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteCompany", - full_name="google.cloud.talent.v4beta1.CompanyService.DeleteCompany", - index=3, - containing_service=None, - input_type=_DELETECOMPANYREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002\\*0/v4beta1/{name=projects/*/tenants/*/companies/*}Z(*&/v4beta1/{name=projects/*/companies/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListCompanies", - full_name="google.cloud.talent.v4beta1.CompanyService.ListCompanies", - index=4, - containing_service=None, - input_type=_LISTCOMPANIESREQUEST, - output_type=_LISTCOMPANIESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\\\0220/v4beta1/{parent=projects/*/tenants/*}/companiesZ(\022&/v4beta1/{parent=projects/*}/companies\332A\006parent" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_COMPANYSERVICE) - -DESCRIPTOR.services_by_name["CompanyService"] = _COMPANYSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/company_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/company_service_pb2_grpc.py deleted file mode 100644 index eac13229ba00..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/company_service_pb2_grpc.py +++ /dev/null @@ -1,122 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - company_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - company_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class CompanyServiceStub(object): - """A service that handles company management, including CRUD and enumeration. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateCompany = channel.unary_unary( - "/google.cloud.talent.v4beta1.CompanyService/CreateCompany", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.CreateCompanyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.FromString, - ) - self.GetCompany = channel.unary_unary( - "/google.cloud.talent.v4beta1.CompanyService/GetCompany", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.GetCompanyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.FromString, - ) - self.UpdateCompany = channel.unary_unary( - "/google.cloud.talent.v4beta1.CompanyService/UpdateCompany", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.UpdateCompanyRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.FromString, - ) - self.DeleteCompany = channel.unary_unary( - "/google.cloud.talent.v4beta1.CompanyService/DeleteCompany", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.DeleteCompanyRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListCompanies = channel.unary_unary( - "/google.cloud.talent.v4beta1.CompanyService/ListCompanies", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.ListCompaniesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.ListCompaniesResponse.FromString, - ) - - -class CompanyServiceServicer(object): - """A service that handles company management, including CRUD and enumeration. - """ - - def CreateCompany(self, request, context): - """Creates a new company entity. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetCompany(self, request, context): - """Retrieves specified company. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateCompany(self, request, context): - """Updates specified company. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteCompany(self, request, context): - """Deletes specified company. - Prerequisite: The company has no jobs associated with it. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListCompanies(self, request, context): - """Lists all companies associated with the project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_CompanyServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateCompany": grpc.unary_unary_rpc_method_handler( - servicer.CreateCompany, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.CreateCompanyRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.SerializeToString, - ), - "GetCompany": grpc.unary_unary_rpc_method_handler( - servicer.GetCompany, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.GetCompanyRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.SerializeToString, - ), - "UpdateCompany": grpc.unary_unary_rpc_method_handler( - servicer.UpdateCompany, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.UpdateCompanyRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__pb2.Company.SerializeToString, - ), - "DeleteCompany": grpc.unary_unary_rpc_method_handler( - servicer.DeleteCompany, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.DeleteCompanyRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListCompanies": grpc.unary_unary_rpc_method_handler( - servicer.ListCompanies, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.ListCompaniesRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_company__service__pb2.ListCompaniesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.CompanyService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/completion_service.proto b/talent/google/cloud/talent_v4beta1/proto/completion_service.proto deleted file mode 100644 index d6fba95dfe4d..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/completion_service.proto +++ /dev/null @@ -1,173 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/api/client.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "CompletionServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service handles auto completion. -service Completion { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Completes the specified prefix with keyword suggestions. - // Intended for use by a job search auto-complete search box. - rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*/tenants/*}:complete" - additional_bindings { - get: "/v4beta1/{parent=projects/*}:complete" - } - }; - } -} - -// Auto-complete parameters. -message CompleteQueryRequest { - // Enum to specify the scope of completion. - enum CompletionScope { - // Default value. - COMPLETION_SCOPE_UNSPECIFIED = 0; - - // Suggestions are based only on the data provided by the client. - TENANT = 1; - - // Suggestions are based on all jobs data in the system that's visible to - // the client - PUBLIC = 2; - } - - // Enum to specify auto-completion topics. - enum CompletionType { - // Default value. - COMPLETION_TYPE_UNSPECIFIED = 0; - - // Suggest job titles for jobs autocomplete. - // - // For - // [CompletionType.JOB_TITLE][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.JOB_TITLE] - // type, only open jobs with the same - // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] - // are returned. - JOB_TITLE = 1; - - // Suggest company names for jobs autocomplete. - // - // For - // [CompletionType.COMPANY_NAME][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY_NAME] - // type, only companies having open jobs with the same - // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] - // are returned. - COMPANY_NAME = 2; - - // Suggest both job titles and company names for jobs autocomplete. - // - // For - // [CompletionType.COMBINED][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED] - // type, only open jobs with the same - // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] - // or companies having open jobs with the same - // [language_codes][google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes] - // are returned. - COMBINED = 3; - } - - // Required. Resource name of tenant the completion is performed within. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenant/bar". - // - // If tenant id is unspecified, the default tenant is used, for - // example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/TenantOrProject" - } - ]; - - // Required. The query used to generate suggestions. - // - // The maximum number of allowed characters is 255. - string query = 2 [(google.api.field_behavior) = REQUIRED]; - - // The list of languages of the query. This is - // the BCP-47 language code, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - // - // The maximum number of allowed characters is 255. - repeated string language_codes = 3; - - // Required. Completion result count. - // - // The maximum allowed page size is 10. - int32 page_size = 4 [(google.api.field_behavior) = REQUIRED]; - - // If provided, restricts completion to specified company. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}", for - // example, "projects/foo/tenants/bar/companies/baz". - // - // If tenant id is unspecified, the default tenant is used, for - // example, "projects/foo". - string company = 5 [(google.api.resource_reference) = { - type: "jobs.googleapis.com/Company" - }]; - - // The scope of the completion. The defaults is [CompletionScope.PUBLIC][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope.PUBLIC]. - CompletionScope scope = 6; - - // The completion topic. The default is [CompletionType.COMBINED][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMBINED]. - CompletionType type = 7; -} - -// Response of auto-complete query. -message CompleteQueryResponse { - // Resource that represents completion results. - message CompletionResult { - // The suggestion for the query. - string suggestion = 1; - - // The completion topic. - CompleteQueryRequest.CompletionType type = 2; - - // The URI of the company image for - // [COMPANY_NAME][google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY_NAME]. - string image_uri = 3; - } - - // Results of the matching job/company candidates. - repeated CompletionResult completion_results = 1; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 2; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2.py deleted file mode 100644 index 9d97a99a5fc7..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2.py +++ /dev/null @@ -1,539 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/completion_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.api import client_pb2 as google_dot_api_dot_client__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/completion_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\026CompletionServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n:google/cloud/talent_v4beta1/proto/completion_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x17google/api/client.proto"\x9b\x04\n\x14\x43ompleteQueryRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#jobs.googleapis.com/TenantOrProject\x12\x12\n\x05query\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0elanguage_codes\x18\x03 \x03(\t\x12\x16\n\tpage_size\x18\x04 \x01(\x05\x42\x03\xe0\x41\x02\x12\x31\n\x07\x63ompany\x18\x05 \x01(\tB \xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12P\n\x05scope\x18\x06 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope\x12N\n\x04type\x18\x07 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType"K\n\x0f\x43ompletionScope\x12 \n\x1c\x43OMPLETION_SCOPE_UNSPECIFIED\x10\x00\x12\n\n\x06TENANT\x10\x01\x12\n\n\x06PUBLIC\x10\x02"`\n\x0e\x43ompletionType\x12\x1f\n\x1b\x43OMPLETION_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tJOB_TITLE\x10\x01\x12\x10\n\x0c\x43OMPANY_NAME\x10\x02\x12\x0c\n\x08\x43OMBINED\x10\x03"\xc5\x02\n\x15\x43ompleteQueryResponse\x12_\n\x12\x63ompletion_results\x18\x01 \x03(\x0b\x32\x43.google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult\x12?\n\x08metadata\x18\x02 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x1a\x89\x01\n\x10\x43ompletionResult\x12\x12\n\nsuggestion\x18\x01 \x01(\t\x12N\n\x04type\x18\x02 \x01(\x0e\x32@.google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType\x12\x11\n\timage_uri\x18\x03 \x01(\t2\xd5\x02\n\nCompletion\x12\xd8\x01\n\rCompleteQuery\x12\x31.google.cloud.talent.v4beta1.CompleteQueryRequest\x1a\x32.google.cloud.talent.v4beta1.CompleteQueryResponse"`\x82\xd3\xe4\x93\x02Z\x12//v4beta1/{parent=projects/*/tenants/*}:completeZ\'\x12%/v4beta1/{parent=projects/*}:complete\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x84\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x16\x43ompletionServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - ], -) - - -_COMPLETEQUERYREQUEST_COMPLETIONSCOPE = _descriptor.EnumDescriptor( - name="CompletionScope", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionScope", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPLETION_SCOPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TENANT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PUBLIC", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=621, - serialized_end=696, -) -_sym_db.RegisterEnumDescriptor(_COMPLETEQUERYREQUEST_COMPLETIONSCOPE) - -_COMPLETEQUERYREQUEST_COMPLETIONTYPE = _descriptor.EnumDescriptor( - name="CompletionType", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="COMPLETION_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_TITLE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="COMPANY_NAME", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="COMBINED", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=698, - serialized_end=794, -) -_sym_db.RegisterEnumDescriptor(_COMPLETEQUERYREQUEST_COMPLETIONTYPE) - - -_COMPLETEQUERYREQUEST = _descriptor.Descriptor( - name="CompleteQueryRequest", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#jobs.googleapis.com/TenantOrProject" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="query", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.query", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.language_codes", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.company", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\372A\035\n\033jobs.googleapis.com/Company"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="scope", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.scope", - index=5, - number=6, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.CompleteQueryRequest.type", - index=6, - number=7, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[ - _COMPLETEQUERYREQUEST_COMPLETIONSCOPE, - _COMPLETEQUERYREQUEST_COMPLETIONTYPE, - ], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=255, - serialized_end=794, -) - - -_COMPLETEQUERYRESPONSE_COMPLETIONRESULT = _descriptor.Descriptor( - name="CompletionResult", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="suggestion", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.suggestion", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult.image_uri", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=985, - serialized_end=1122, -) - -_COMPLETEQUERYRESPONSE = _descriptor.Descriptor( - name="CompleteQueryResponse", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="completion_results", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.completion_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.CompleteQueryResponse.metadata", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_COMPLETEQUERYRESPONSE_COMPLETIONRESULT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=797, - serialized_end=1122, -) - -_COMPLETEQUERYREQUEST.fields_by_name[ - "scope" -].enum_type = _COMPLETEQUERYREQUEST_COMPLETIONSCOPE -_COMPLETEQUERYREQUEST.fields_by_name[ - "type" -].enum_type = _COMPLETEQUERYREQUEST_COMPLETIONTYPE -_COMPLETEQUERYREQUEST_COMPLETIONSCOPE.containing_type = _COMPLETEQUERYREQUEST -_COMPLETEQUERYREQUEST_COMPLETIONTYPE.containing_type = _COMPLETEQUERYREQUEST -_COMPLETEQUERYRESPONSE_COMPLETIONRESULT.fields_by_name[ - "type" -].enum_type = _COMPLETEQUERYREQUEST_COMPLETIONTYPE -_COMPLETEQUERYRESPONSE_COMPLETIONRESULT.containing_type = _COMPLETEQUERYRESPONSE -_COMPLETEQUERYRESPONSE.fields_by_name[ - "completion_results" -].message_type = _COMPLETEQUERYRESPONSE_COMPLETIONRESULT -_COMPLETEQUERYRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -DESCRIPTOR.message_types_by_name["CompleteQueryRequest"] = _COMPLETEQUERYREQUEST -DESCRIPTOR.message_types_by_name["CompleteQueryResponse"] = _COMPLETEQUERYRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CompleteQueryRequest = _reflection.GeneratedProtocolMessageType( - "CompleteQueryRequest", - (_message.Message,), - dict( - DESCRIPTOR=_COMPLETEQUERYREQUEST, - __module__="google.cloud.talent_v4beta1.proto.completion_service_pb2", - __doc__="""Auto-complete parameters. - - - Attributes: - parent: - Required. Resource name of tenant the completion is performed - within. The format is - "projects/{project\_id}/tenants/{tenant\_id}", for example, - "projects/foo/tenant/bar". If tenant id is unspecified, the - default tenant is used, for example, "projects/foo". - query: - Required. The query used to generate suggestions. The maximum - number of allowed characters is 255. - language_codes: - The list of languages of the query. This is the BCP-47 - language code, such as "en-US" or "sr-Latn". For more - information, see `Tags for Identifying Languages - `__. The maximum number of - allowed characters is 255. - page_size: - Required. Completion result count. The maximum allowed page - size is 10. - company: - If provided, restricts completion to specified company. The - format is "projects/{project\_id}/tenants/{tenant\_id}/compani - es/{company\_id}", for example, - "projects/foo/tenants/bar/companies/baz". If tenant id is - unspecified, the default tenant is used, for example, - "projects/foo". - scope: - The scope of the completion. The defaults is [CompletionScope. - PUBLIC][google.cloud.talent.v4beta1.CompleteQueryRequest.Compl - etionScope.PUBLIC]. - type: - The completion topic. The default is [CompletionType.COMBINED] - [google.cloud.talent.v4beta1.CompleteQueryRequest.CompletionTy - pe.COMBINED]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompleteQueryRequest) - ), -) -_sym_db.RegisterMessage(CompleteQueryRequest) - -CompleteQueryResponse = _reflection.GeneratedProtocolMessageType( - "CompleteQueryResponse", - (_message.Message,), - dict( - CompletionResult=_reflection.GeneratedProtocolMessageType( - "CompletionResult", - (_message.Message,), - dict( - DESCRIPTOR=_COMPLETEQUERYRESPONSE_COMPLETIONRESULT, - __module__="google.cloud.talent_v4beta1.proto.completion_service_pb2", - __doc__="""Resource that represents completion results. - - - Attributes: - suggestion: - The suggestion for the query. - type: - The completion topic. - image_uri: - The URI of the company image for [COMPANY\_NAME][google.cloud. - talent.v4beta1.CompleteQueryRequest.CompletionType.COMPANY\_NA - ME]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompleteQueryResponse.CompletionResult) - ), - ), - DESCRIPTOR=_COMPLETEQUERYRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.completion_service_pb2", - __doc__="""Response of auto-complete query. - - - Attributes: - completion_results: - Results of the matching job/company candidates. - metadata: - Additional information for the API invocation, such as the - request tracking id. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompleteQueryResponse) - ), -) -_sym_db.RegisterMessage(CompleteQueryResponse) -_sym_db.RegisterMessage(CompleteQueryResponse.CompletionResult) - - -DESCRIPTOR._options = None -_COMPLETEQUERYREQUEST.fields_by_name["parent"]._options = None -_COMPLETEQUERYREQUEST.fields_by_name["query"]._options = None -_COMPLETEQUERYREQUEST.fields_by_name["page_size"]._options = None -_COMPLETEQUERYREQUEST.fields_by_name["company"]._options = None - -_COMPLETION = _descriptor.ServiceDescriptor( - name="Completion", - full_name="google.cloud.talent.v4beta1.Completion", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=1125, - serialized_end=1466, - methods=[ - _descriptor.MethodDescriptor( - name="CompleteQuery", - full_name="google.cloud.talent.v4beta1.Completion.CompleteQuery", - index=0, - containing_service=None, - input_type=_COMPLETEQUERYREQUEST, - output_type=_COMPLETEQUERYRESPONSE, - serialized_options=_b( - "\202\323\344\223\002Z\022//v4beta1/{parent=projects/*/tenants/*}:completeZ'\022%/v4beta1/{parent=projects/*}:complete" - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_COMPLETION) - -DESCRIPTOR.services_by_name["Completion"] = _COMPLETION - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2_grpc.py deleted file mode 100644 index 84cb66dbd4eb..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/completion_service_pb2_grpc.py +++ /dev/null @@ -1,50 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - completion_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_completion__service__pb2, -) - - -class CompletionStub(object): - """A service handles auto completion. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CompleteQuery = channel.unary_unary( - "/google.cloud.talent.v4beta1.Completion/CompleteQuery", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_completion__service__pb2.CompleteQueryRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_completion__service__pb2.CompleteQueryResponse.FromString, - ) - - -class CompletionServicer(object): - """A service handles auto completion. - """ - - def CompleteQuery(self, request, context): - """Completes the specified prefix with keyword suggestions. - Intended for use by a job search auto-complete search box. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_CompletionServicer_to_server(servicer, server): - rpc_method_handlers = { - "CompleteQuery": grpc.unary_unary_rpc_method_handler( - servicer.CompleteQuery, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_completion__service__pb2.CompleteQueryRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_completion__service__pb2.CompleteQueryResponse.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.Completion", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/event.proto b/talent/google/cloud/talent_v4beta1/proto/event.proto deleted file mode 100644 index 8af726a4e6d4..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event.proto +++ /dev/null @@ -1,235 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "EventProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// An event issued when an end user interacts with the application that -// implements Cloud Talent Solution. Providing this information improves the -// quality of results for the API clients, enabling the -// service to perform optimally. The number of events sent must be consistent -// with other calls, such as job searches, issued to the service by the client. -message ClientEvent { - // Strongly recommended for the best service experience. - // - // A unique ID generated in the API responses. It can be found in - // [ResponseMetadata.request_id][google.cloud.talent.v4beta1.ResponseMetadata.request_id]. - string request_id = 1; - - // Required. A unique identifier, generated by the client application. - string event_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The timestamp of the event. - google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. - // - // The detail information of a specific event type. - oneof event { - // An event issued when a job seeker interacts with the application that - // implements Cloud Talent Solution. - JobEvent job_event = 5; - - // An event issued when a profile searcher interacts with the application - // that implements Cloud Talent Solution. - ProfileEvent profile_event = 6; - } - - // Notes about the event provided by recruiters or other users, for example, - // feedback on why a profile was bookmarked. - string event_notes = 9; -} - -// An event issued when a job seeker interacts with the application that -// implements Cloud Talent Solution. -message JobEvent { - // An enumeration of an event attributed to the behavior of the end user, - // such as a job seeker. - enum JobEventType { - // The event is unspecified by other provided values. - JOB_EVENT_TYPE_UNSPECIFIED = 0; - - // The job seeker or other entity interacting with the service has - // had a job rendered in their view, such as in a list of search results in - // a compressed or clipped format. This event is typically associated with - // the viewing of a jobs list on a single page by a job seeker. - IMPRESSION = 1; - - // The job seeker, or other entity interacting with the service, has - // viewed the details of a job, including the full description. This - // event doesn't apply to the viewing a snippet of a job appearing as a - // part of the job search results. Viewing a snippet is associated with an - // [impression][google.cloud.talent.v4beta1.JobEvent.JobEventType.IMPRESSION]). - VIEW = 2; - - // The job seeker or other entity interacting with the service - // performed an action to view a job and was redirected to a different - // website for job. - VIEW_REDIRECT = 3; - - // The job seeker or other entity interacting with the service - // began the process or demonstrated the intention of applying for a job. - APPLICATION_START = 4; - - // The job seeker or other entity interacting with the service - // submitted an application for a job. - APPLICATION_FINISH = 5; - - // The job seeker or other entity interacting with the service - // submitted an application for a job with a single click without - // entering information. If a job seeker performs this action, send only - // this event to the service. Do not also send - // [JobEventType.APPLICATION_START][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_START] or [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_FINISH] - // events. - APPLICATION_QUICK_SUBMISSION = 6; - - // The job seeker or other entity interacting with the service - // performed an action to apply to a job and was redirected to a different - // website to complete the application. - APPLICATION_REDIRECT = 7; - - // The job seeker or other entity interacting with the service began the - // process or demonstrated the intention of applying for a job from the - // search results page without viewing the details of the job posting. - // If sending this event, JobEventType.VIEW event shouldn't be sent. - APPLICATION_START_FROM_SEARCH = 8; - - // The job seeker, or other entity interacting with the service, performs an - // action with a single click from the search results page to apply to a job - // (without viewing the details of the job posting), and is redirected - // to a different website to complete the application. If a candidate - // performs this action, send only this event to the service. Do not also - // send [JobEventType.APPLICATION_START][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_START], - // [JobEventType.APPLICATION_FINISH][google.cloud.talent.v4beta1.JobEvent.JobEventType.APPLICATION_FINISH] or [JobEventType.VIEW][google.cloud.talent.v4beta1.JobEvent.JobEventType.VIEW] events. - APPLICATION_REDIRECT_FROM_SEARCH = 9; - - // This event should be used when a company submits an application - // on behalf of a job seeker. This event is intended for use by staffing - // agencies attempting to place candidates. - APPLICATION_COMPANY_SUBMIT = 10; - - // The job seeker or other entity interacting with the service demonstrated - // an interest in a job by bookmarking or saving it. - BOOKMARK = 11; - - // The job seeker or other entity interacting with the service was - // sent a notification, such as an email alert or device notification, - // containing one or more jobs listings generated by the service. - NOTIFICATION = 12; - - // The job seeker or other entity interacting with the service was - // employed by the hiring entity (employer). Send this event - // only if the job seeker was hired through an application that was - // initiated by a search conducted through the Cloud Talent Solution - // service. - HIRED = 13; - - // A recruiter or staffing agency submitted an application on behalf of the - // candidate after interacting with the service to identify a suitable job - // posting. - SENT_CV = 14; - - // The entity interacting with the service (for example, the job seeker), - // was granted an initial interview by the hiring entity (employer). This - // event should only be sent if the job seeker was granted an interview as - // part of an application that was initiated by a search conducted through / - // recommendation provided by the Cloud Talent Solution service. - INTERVIEW_GRANTED = 15; - } - - // Required. The type of the event (see [JobEventType][google.cloud.talent.v4beta1.JobEvent.JobEventType]). - JobEventType type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The [job name(s)][google.cloud.talent.v4beta1.Job.name] associated with this event. - // For example, if this is an [impression][google.cloud.talent.v4beta1.JobEvent.JobEventType.IMPRESSION] event, - // this field contains the identifiers of all jobs shown to the job seeker. - // If this was a [view][google.cloud.talent.v4beta1.JobEvent.JobEventType.VIEW] event, this field contains the - // identifier of the viewed job. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for - // example, "projects/foo/tenants/bar/jobs/baz". - repeated string jobs = 2 [(google.api.field_behavior) = REQUIRED]; - - // The [profile name][google.cloud.talent.v4beta1.Profile.name] associated with this client event. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", - // for example, "projects/foo/tenants/bar/profiles/baz". - string profile = 3; -} - -// An event issued when a profile searcher interacts with the application -// that implements Cloud Talent Solution. -message ProfileEvent { - // The enum represents types of client events for a candidate profile. - enum ProfileEventType { - // Default value. - PROFILE_EVENT_TYPE_UNSPECIFIED = 0; - - // Send this event when a [ProfileEvent.profiles][google.cloud.talent.v4beta1.ProfileEvent.profiles] was sent as a part of - // a result set for a CTS API call and was rendered in the end user's UI - // (that is, the [ProfileEvent.recruiter][google.cloud.talent.v4beta1.ProfileEvent.recruiter]). - IMPRESSION = 1; - - // The VIEW event records the action of a candidate's profile being - // viewed by an end user. This is critical to tracking product metrics and - // should be sent for every profile VIEW that happens in your system, - // whether the event is associated with an API call (for example, a - // recruiter making a request for a result set and clicking on a profile) - // or not (a recruiter using the system to view profile details without - // making a request). - // - // For a VIEW events associated with API calls, the - // [ClientEvent.request_id][google.cloud.talent.v4beta1.ClientEvent.request_id] should be populated. If the VIEW is not - // associated with an API call, [request_id][google.cloud.talent.v4beta1.ClientEvent.request_id] should - // not be populated. - // - // This event requires a valid recruiter and one valid ID in profiles. - VIEW = 2; - - // The profile is bookmarked. - BOOKMARK = 3; - } - - // Required. Type of event. - ProfileEventType type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The [profile name(s)][google.cloud.talent.v4beta1.Profile.name] associated with this client event. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", - // for example, "projects/foo/tenants/bar/profiles/baz". - repeated string profiles = 2 [(google.api.field_behavior) = REQUIRED]; - - // The [job name(s)][google.cloud.talent.v4beta1.Job.name] associated with this client event. Leave it - // empty if the event isn't associated with a job. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}", for - // example, "projects/foo/tenants/bar/jobs/baz". - repeated string jobs = 6; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/event_pb2.py b/talent/google/cloud/talent_v4beta1/proto/event_pb2.py deleted file mode 100644 index d58c625c4539..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event_pb2.py +++ /dev/null @@ -1,600 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/event.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/event.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\nEventProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n-google/cloud/talent_v4beta1/proto/event.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\x8c\x02\n\x0b\x43lientEvent\x12\x12\n\nrequest_id\x18\x01 \x01(\t\x12\x15\n\x08\x65vent_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x34\n\x0b\x63reate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12:\n\tjob_event\x18\x05 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobEventH\x00\x12\x42\n\rprofile_event\x18\x06 \x01(\x0b\x32).google.cloud.talent.v4beta1.ProfileEventH\x00\x12\x13\n\x0b\x65vent_notes\x18\t \x01(\tB\x07\n\x05\x65vent"\xf6\x03\n\x08JobEvent\x12\x45\n\x04type\x18\x01 \x01(\x0e\x32\x32.google.cloud.talent.v4beta1.JobEvent.JobEventTypeB\x03\xe0\x41\x02\x12\x11\n\x04jobs\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x0f\n\x07profile\x18\x03 \x01(\t"\xfe\x02\n\x0cJobEventType\x12\x1e\n\x1aJOB_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x11\n\rVIEW_REDIRECT\x10\x03\x12\x15\n\x11\x41PPLICATION_START\x10\x04\x12\x16\n\x12\x41PPLICATION_FINISH\x10\x05\x12 \n\x1c\x41PPLICATION_QUICK_SUBMISSION\x10\x06\x12\x18\n\x14\x41PPLICATION_REDIRECT\x10\x07\x12!\n\x1d\x41PPLICATION_START_FROM_SEARCH\x10\x08\x12$\n APPLICATION_REDIRECT_FROM_SEARCH\x10\t\x12\x1e\n\x1a\x41PPLICATION_COMPANY_SUBMIT\x10\n\x12\x0c\n\x08\x42OOKMARK\x10\x0b\x12\x10\n\x0cNOTIFICATION\x10\x0c\x12\t\n\x05HIRED\x10\r\x12\x0b\n\x07SENT_CV\x10\x0e\x12\x15\n\x11INTERVIEW_GRANTED\x10\x0f"\xe2\x01\n\x0cProfileEvent\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.talent.v4beta1.ProfileEvent.ProfileEventTypeB\x03\xe0\x41\x02\x12\x15\n\x08profiles\x18\x02 \x03(\tB\x03\xe0\x41\x02\x12\x0c\n\x04jobs\x18\x06 \x03(\t"^\n\x10ProfileEventType\x12"\n\x1ePROFILE_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nIMPRESSION\x10\x01\x12\x08\n\x04VIEW\x10\x02\x12\x0c\n\x08\x42OOKMARK\x10\x03\x42x\n\x1f\x63om.google.cloud.talent.v4beta1B\nEventProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_JOBEVENT_JOBEVENTTYPE = _descriptor.EnumDescriptor( - name="JobEventType", - full_name="google.cloud.talent.v4beta1.JobEvent.JobEventType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="JOB_EVENT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMPRESSION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIEW", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIEW_REDIRECT", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_START", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_FINISH", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_QUICK_SUBMISSION", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_REDIRECT", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_START_FROM_SEARCH", - index=8, - number=8, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_REDIRECT_FROM_SEARCH", - index=9, - number=9, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="APPLICATION_COMPANY_SUBMIT", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="BOOKMARK", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NOTIFICATION", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HIRED", index=13, number=13, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SENT_CV", index=14, number=14, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="INTERVIEW_GRANTED", - index=15, - number=15, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=566, - serialized_end=948, -) -_sym_db.RegisterEnumDescriptor(_JOBEVENT_JOBEVENTTYPE) - -_PROFILEEVENT_PROFILEEVENTTYPE = _descriptor.EnumDescriptor( - name="ProfileEventType", - full_name="google.cloud.talent.v4beta1.ProfileEvent.ProfileEventType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="PROFILE_EVENT_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMPRESSION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIEW", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BOOKMARK", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1083, - serialized_end=1177, -) -_sym_db.RegisterEnumDescriptor(_PROFILEEVENT_PROFILEEVENTTYPE) - - -_CLIENTEVENT = _descriptor.Descriptor( - name="ClientEvent", - full_name="google.cloud.talent.v4beta1.ClientEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="request_id", - full_name="google.cloud.talent.v4beta1.ClientEvent.request_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="event_id", - full_name="google.cloud.talent.v4beta1.ClientEvent.event_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.talent.v4beta1.ClientEvent.create_time", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_event", - full_name="google.cloud.talent.v4beta1.ClientEvent.job_event", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profile_event", - full_name="google.cloud.talent.v4beta1.ClientEvent.profile_event", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="event_notes", - full_name="google.cloud.talent.v4beta1.ClientEvent.event_notes", - index=5, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="event", - full_name="google.cloud.talent.v4beta1.ClientEvent.event", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=175, - serialized_end=443, -) - - -_JOBEVENT = _descriptor.Descriptor( - name="JobEvent", - full_name="google.cloud.talent.v4beta1.JobEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.JobEvent.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="jobs", - full_name="google.cloud.talent.v4beta1.JobEvent.jobs", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profile", - full_name="google.cloud.talent.v4beta1.JobEvent.profile", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_JOBEVENT_JOBEVENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=446, - serialized_end=948, -) - - -_PROFILEEVENT = _descriptor.Descriptor( - name="ProfileEvent", - full_name="google.cloud.talent.v4beta1.ProfileEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.ProfileEvent.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profiles", - full_name="google.cloud.talent.v4beta1.ProfileEvent.profiles", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="jobs", - full_name="google.cloud.talent.v4beta1.ProfileEvent.jobs", - index=2, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PROFILEEVENT_PROFILEEVENTTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=951, - serialized_end=1177, -) - -_CLIENTEVENT.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_CLIENTEVENT.fields_by_name["job_event"].message_type = _JOBEVENT -_CLIENTEVENT.fields_by_name["profile_event"].message_type = _PROFILEEVENT -_CLIENTEVENT.oneofs_by_name["event"].fields.append( - _CLIENTEVENT.fields_by_name["job_event"] -) -_CLIENTEVENT.fields_by_name["job_event"].containing_oneof = _CLIENTEVENT.oneofs_by_name[ - "event" -] -_CLIENTEVENT.oneofs_by_name["event"].fields.append( - _CLIENTEVENT.fields_by_name["profile_event"] -) -_CLIENTEVENT.fields_by_name[ - "profile_event" -].containing_oneof = _CLIENTEVENT.oneofs_by_name["event"] -_JOBEVENT.fields_by_name["type"].enum_type = _JOBEVENT_JOBEVENTTYPE -_JOBEVENT_JOBEVENTTYPE.containing_type = _JOBEVENT -_PROFILEEVENT.fields_by_name["type"].enum_type = _PROFILEEVENT_PROFILEEVENTTYPE -_PROFILEEVENT_PROFILEEVENTTYPE.containing_type = _PROFILEEVENT -DESCRIPTOR.message_types_by_name["ClientEvent"] = _CLIENTEVENT -DESCRIPTOR.message_types_by_name["JobEvent"] = _JOBEVENT -DESCRIPTOR.message_types_by_name["ProfileEvent"] = _PROFILEEVENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ClientEvent = _reflection.GeneratedProtocolMessageType( - "ClientEvent", - (_message.Message,), - dict( - DESCRIPTOR=_CLIENTEVENT, - __module__="google.cloud.talent_v4beta1.proto.event_pb2", - __doc__="""An event issued when an end user interacts with the - application that implements Cloud Talent Solution. Providing this - information improves the quality of results for the API clients, - enabling the service to perform optimally. The number of events sent - must be consistent with other calls, such as job searches, issued to the - service by the client. - - - Attributes: - request_id: - Strongly recommended for the best service experience. A - unique ID generated in the API responses. It can be found in [ - ResponseMetadata.request\_id][google.cloud.talent.v4beta1.Resp - onseMetadata.request\_id]. - event_id: - Required. A unique identifier, generated by the client - application. - create_time: - Required. The timestamp of the event. - event: - Required. The detail information of a specific event type. - job_event: - An event issued when a job seeker interacts with the - application that implements Cloud Talent Solution. - profile_event: - An event issued when a profile searcher interacts with the - application that implements Cloud Talent Solution. - event_notes: - Notes about the event provided by recruiters or other users, - for example, feedback on why a profile was bookmarked. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ClientEvent) - ), -) -_sym_db.RegisterMessage(ClientEvent) - -JobEvent = _reflection.GeneratedProtocolMessageType( - "JobEvent", - (_message.Message,), - dict( - DESCRIPTOR=_JOBEVENT, - __module__="google.cloud.talent_v4beta1.proto.event_pb2", - __doc__="""An event issued when a job seeker interacts with the - application that implements Cloud Talent Solution. - - - Attributes: - type: - Required. The type of the event (see [JobEventType][google.clo - ud.talent.v4beta1.JobEvent.JobEventType]). - jobs: - Required. The [job - name(s)][google.cloud.talent.v4beta1.Job.name] associated with - this event. For example, if this is an [impression][google.clo - ud.talent.v4beta1.JobEvent.JobEventType.IMPRESSION] event, - this field contains the identifiers of all jobs shown to the - job seeker. If this was a - [view][google.cloud.talent.v4beta1.JobEvent.JobEventType.VIEW] - event, this field contains the identifier of the viewed job. - The format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}", - for example, "projects/foo/tenants/bar/jobs/baz". - profile: - The [profile name][google.cloud.talent.v4beta1.Profile.name] - associated with this client event. The format is "projects/{p - roject\_id}/tenants/{tenant\_id}/profiles/{profile\_id}", for - example, "projects/foo/tenants/bar/profiles/baz". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.JobEvent) - ), -) -_sym_db.RegisterMessage(JobEvent) - -ProfileEvent = _reflection.GeneratedProtocolMessageType( - "ProfileEvent", - (_message.Message,), - dict( - DESCRIPTOR=_PROFILEEVENT, - __module__="google.cloud.talent_v4beta1.proto.event_pb2", - __doc__="""An event issued when a profile searcher interacts with the - application that implements Cloud Talent Solution. - - - Attributes: - type: - Required. Type of event. - profiles: - Required. The [profile - name(s)][google.cloud.talent.v4beta1.Profile.name] associated - with this client event. The format is "projects/{project\_id} - /tenants/{tenant\_id}/profiles/{profile\_id}", for example, - "projects/foo/tenants/bar/profiles/baz". - jobs: - The [job name(s)][google.cloud.talent.v4beta1.Job.name] - associated with this client event. Leave it empty if the event - isn't associated with a job. The format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}", - for example, "projects/foo/tenants/bar/jobs/baz". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ProfileEvent) - ), -) -_sym_db.RegisterMessage(ProfileEvent) - - -DESCRIPTOR._options = None -_CLIENTEVENT.fields_by_name["event_id"]._options = None -_CLIENTEVENT.fields_by_name["create_time"]._options = None -_JOBEVENT.fields_by_name["type"]._options = None -_JOBEVENT.fields_by_name["jobs"]._options = None -_PROFILEEVENT.fields_by_name["type"]._options = None -_PROFILEEVENT.fields_by_name["profiles"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/event_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/event_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/event_service.proto b/talent/google/cloud/talent_v4beta1/proto/event_service.proto deleted file mode 100644 index b5da5f215a98..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event_service.proto +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/event.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "EventServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service handles client event report. -service EventService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Report events issued when end user interacts with customer's application - // that uses Cloud Talent Solution. You may inspect the created events in - // [self service - // tools](https://console.cloud.google.com/talent-solution/overview). - // [Learn - // more](https://cloud.google.com/talent-solution/docs/management-tools) - // about self service tools. - rpc CreateClientEvent(CreateClientEventRequest) returns (ClientEvent) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/clientEvents" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/clientEvents" - body: "*" - } - }; - option (google.api.method_signature) = "parent,client_event"; - } -} - -// The report event request. -message CreateClientEventRequest { - // Required. Resource name of the tenant under which the event is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created, for example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/TenantOrProject" - } - ]; - - // Required. Events issued when end user interacts with customer's application that - // uses Cloud Talent Solution. - ClientEvent client_event = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/event_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/event_service_pb2.py deleted file mode 100644 index 8e8148a71200..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event_service_pb2.py +++ /dev/null @@ -1,171 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/event_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - event_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/event_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\021EventServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n5google/cloud/talent_v4beta1/proto/event_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a-google/cloud/talent_v4beta1/proto/event.proto"\x9c\x01\n\x18\x43reateClientEventRequest\x12;\n\x06parent\x18\x01 \x01(\tB+\xe0\x41\x02\xfa\x41%\n#jobs.googleapis.com/TenantOrProject\x12\x43\n\x0c\x63lient_event\x18\x02 \x01(\x0b\x32(.google.cloud.talent.v4beta1.ClientEventB\x03\xe0\x41\x02\x32\xfa\x02\n\x0c\x45ventService\x12\xfb\x01\n\x11\x43reateClientEvent\x12\x35.google.cloud.talent.v4beta1.CreateClientEventRequest\x1a(.google.cloud.talent.v4beta1.ClientEvent"\x84\x01\x82\xd3\xe4\x93\x02h"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\x01*Z.")/v4beta1/{parent=projects/*}/clientEvents:\x01*\xda\x41\x13parent,client_event\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x7f\n\x1f\x63om.google.cloud.talent.v4beta1B\x11\x45ventServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2.DESCRIPTOR, - ], -) - - -_CREATECLIENTEVENTREQUEST = _descriptor.Descriptor( - name="CreateClientEventRequest", - full_name="google.cloud.talent.v4beta1.CreateClientEventRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateClientEventRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A%\n#jobs.googleapis.com/TenantOrProject" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="client_event", - full_name="google.cloud.talent.v4beta1.CreateClientEventRequest.client_event", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=249, - serialized_end=405, -) - -_CREATECLIENTEVENTREQUEST.fields_by_name[ - "client_event" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2._CLIENTEVENT -) -DESCRIPTOR.message_types_by_name["CreateClientEventRequest"] = _CREATECLIENTEVENTREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateClientEventRequest = _reflection.GeneratedProtocolMessageType( - "CreateClientEventRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATECLIENTEVENTREQUEST, - __module__="google.cloud.talent_v4beta1.proto.event_service_pb2", - __doc__="""The report event request. - - - Attributes: - parent: - Required. Resource name of the tenant under which the event is - created. The format is - "projects/{project\_id}/tenants/{tenant\_id}", for example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created, for example, "projects/foo". - client_event: - Required. Events issued when end user interacts with - customer's application that uses Cloud Talent Solution. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateClientEventRequest) - ), -) -_sym_db.RegisterMessage(CreateClientEventRequest) - - -DESCRIPTOR._options = None -_CREATECLIENTEVENTREQUEST.fields_by_name["parent"]._options = None -_CREATECLIENTEVENTREQUEST.fields_by_name["client_event"]._options = None - -_EVENTSERVICE = _descriptor.ServiceDescriptor( - name="EventService", - full_name="google.cloud.talent.v4beta1.EventService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=408, - serialized_end=786, - methods=[ - _descriptor.MethodDescriptor( - name="CreateClientEvent", - full_name="google.cloud.talent.v4beta1.EventService.CreateClientEvent", - index=0, - containing_service=None, - input_type=_CREATECLIENTEVENTREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2._CLIENTEVENT, - serialized_options=_b( - '\202\323\344\223\002h"3/v4beta1/{parent=projects/*/tenants/*}/clientEvents:\001*Z.")/v4beta1/{parent=projects/*}/clientEvents:\001*\332A\023parent,client_event' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_EVENTSERVICE) - -DESCRIPTOR.services_by_name["EventService"] = _EVENTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/event_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/event_service_pb2_grpc.py deleted file mode 100644 index 542f4851718c..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/event_service_pb2_grpc.py +++ /dev/null @@ -1,58 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - event_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - event_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__service__pb2, -) - - -class EventServiceStub(object): - """A service handles client event report. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateClientEvent = channel.unary_unary( - "/google.cloud.talent.v4beta1.EventService/CreateClientEvent", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__service__pb2.CreateClientEventRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2.ClientEvent.FromString, - ) - - -class EventServiceServicer(object): - """A service handles client event report. - """ - - def CreateClientEvent(self, request, context): - """Report events issued when end user interacts with customer's application - that uses Cloud Talent Solution. You may inspect the created events in - [self service - tools](https://console.cloud.google.com/talent-solution/overview). - [Learn - more](https://cloud.google.com/talent-solution/docs/management-tools) - about self service tools. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_EventServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateClientEvent": grpc.unary_unary_rpc_method_handler( - servicer.CreateClientEvent, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__service__pb2.CreateClientEventRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_event__pb2.ClientEvent.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.EventService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/filters.proto b/talent/google/cloud/talent_v4beta1/proto/filters.proto deleted file mode 100644 index 46b26795100b..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/filters.proto +++ /dev/null @@ -1,781 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/latlng.proto"; -import "google/type/timeofday.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "FiltersProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// The query required to perform a search query. -message JobQuery { - // The query string that matches against the job title, description, and - // location fields. - // - // The maximum number of allowed characters is 255. - string query = 1; - - // The language code of [query][google.cloud.talent.v4beta1.JobQuery.query]. For example, "en-US". This field helps to - // better interpret the query. - // - // If a value isn't specified, the query language code is automatically - // detected, which may not be accurate. - // - // Language code should be in BCP-47 format, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - string query_language_code = 14; - - // This filter specifies the company entities to search against. - // - // If a value isn't specified, jobs are searched for against all - // companies. - // - // If multiple values are specified, jobs are searched against the - // companies specified. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For - // example, "projects/foo/tenants/bar/companies/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/companies/bar". - // - // At most 20 company filters are allowed. - repeated string companies = 2; - - // The location filter specifies geo-regions containing the jobs to - // search against. See [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] for more information. - // - // If a location value isn't specified, jobs fitting the other search - // criteria are retrieved regardless of where they're located. - // - // If multiple values are specified, jobs are retrieved from any of the - // specified locations. If different values are specified for the - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] parameter, the maximum provided - // distance is used for all locations. - // - // At most 5 location filters are allowed. - repeated LocationFilter location_filters = 3; - - // The category filter specifies the categories of jobs to search against. - // See [JobCategory][google.cloud.talent.v4beta1.JobCategory] for more information. - // - // If a value isn't specified, jobs from any category are searched against. - // - // If multiple values are specified, jobs from any of the specified - // categories are searched against. - repeated JobCategory job_categories = 4; - - // Allows filtering jobs by commute time with different travel methods (for - // example, driving or public transit). - // - // Note: This only works when you specify a [CommuteMethod][google.cloud.talent.v4beta1.CommuteMethod]. In this case, - // [location_filters][google.cloud.talent.v4beta1.JobQuery.location_filters] is ignored. - // - // Currently we don't support sorting by commute time. - CommuteFilter commute_filter = 5; - - // This filter specifies the exact company [Company.display_name][google.cloud.talent.v4beta1.Company.display_name] - // of the jobs to search against. - // - // If a value isn't specified, jobs within the search results are - // associated with any company. - // - // If multiple values are specified, jobs within the search results may be - // associated with any of the specified companies. - // - // At most 20 company display name filters are allowed. - repeated string company_display_names = 6; - - // This search filter is applied only to - // [Job.compensation_info][google.cloud.talent.v4beta1.Job.compensation_info]. For example, if the filter is specified - // as "Hourly job with per-hour compensation > $15", only jobs meeting - // these criteria are searched. If a filter isn't defined, all open jobs - // are searched. - CompensationFilter compensation_filter = 7; - - // This filter specifies a structured syntax to match against the - // [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] marked as `filterable`. - // - // The syntax for this expression is a subset of SQL syntax. - // - // Supported operators are: `=`, `!=`, `<`, `<=`, `>`, and `>=` where the - // left of the operator is a custom field key and the right of the operator - // is a number or a quoted string. You must escape backslash (\\) and - // quote (\") characters. - // - // Supported functions are `LOWER([field_name])` to - // perform a case insensitive match and `EMPTY([field_name])` to filter on the - // existence of a key. - // - // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of - // nesting (for example, "((A AND B AND C) OR NOT D) AND E"), a maximum of 100 - // comparisons or functions are allowed in the expression. The expression - // must be < 6000 bytes in length. - // - // Sample Query: - // `(LOWER(driving_license)="class \"a\"" OR EMPTY(driving_license)) AND - // driving_years > 10` - string custom_attribute_filter = 8; - - // This flag controls the spell-check feature. If false, the - // service attempts to correct a misspelled query, - // for example, "enginee" is corrected to "engineer". - // - // Defaults to false: a spell check is performed. - bool disable_spell_check = 9; - - // The employment type filter specifies the employment type of jobs to - // search against, such as [EmploymentType.FULL_TIME][google.cloud.talent.v4beta1.EmploymentType.FULL_TIME]. - // - // If a value isn't specified, jobs in the search results includes any - // employment type. - // - // If multiple values are specified, jobs in the search results include - // any of the specified employment types. - repeated EmploymentType employment_types = 10; - - // This filter specifies the locale of jobs to search against, - // for example, "en-US". - // - // If a value isn't specified, the search results can contain jobs in any - // locale. - // - // - // Language codes should be in BCP-47 format, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47). - // - // At most 10 language code filters are allowed. - repeated string language_codes = 11; - - // Jobs published within a range specified by this filter are searched - // against. - TimestampRange publish_time_range = 12; - - // This filter specifies a list of job names to be excluded during search. - // - // At most 400 excluded job names are allowed. - repeated string excluded_jobs = 13; -} - -// Filters to apply when performing the search query. -message ProfileQuery { - // Keywords to match any text fields of profiles. - // - // For example, "software engineer in Palo Alto". - string query = 1; - - // The location filter specifies geo-regions containing the profiles to - // search against. - // - // One of [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address] or [LocationFilter.lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] must be - // provided or an error is thrown. If both [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address] and - // [LocationFilter.lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are provided, an error is thrown. - // - // The following logic is used to determine which locations in - // the profile to filter against: - // - // 1. All of the profile's geocoded [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] where - // [Address.usage][google.cloud.talent.v4beta1.Address.usage] is PERSONAL and [Address.current][google.cloud.talent.v4beta1.Address.current] is true. - // - // 2. If the above set of locations is empty, all of the profile's geocoded - // [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] where [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - // CONTACT_INFO_USAGE_UNSPECIFIED and [Address.current][google.cloud.talent.v4beta1.Address.current] is true. - // - // 3. If the above set of locations is empty, all of the profile's geocoded - // [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] where [Address.usage][google.cloud.talent.v4beta1.Address.usage] is PERSONAL or - // CONTACT_INFO_USAGE_UNSPECIFIED and [Address.current][google.cloud.talent.v4beta1.Address.current] is not set. - // - // This means that any profiles without any [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] that match - // any of the above criteria will not be included in a search with location - // filter. Furthermore, any [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] where [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - // WORK or SCHOOL or where [Address.current][google.cloud.talent.v4beta1.Address.current] is false are not considered for - // location filter. - // - // If a location filter isn't specified, profiles fitting the other search - // criteria are retrieved regardless of where they're located. - // - // If [LocationFilter.negated][google.cloud.talent.v4beta1.LocationFilter.negated] is specified, the result doesn't contain - // profiles from that location. - // - // If [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address] is provided, the - // [LocationType][google.cloud.talent.v4beta1.Location.LocationType], center - // point (latitude and longitude), and radius are automatically detected by - // the Google Maps Geocoding API and included as well. If - // [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address] cannot be geocoded, the filter - // falls back to keyword search. - // - // If the detected - // [LocationType][google.cloud.talent.v4beta1.Location.LocationType] is - // [LocationType.SUB_ADMINISTRATIVE_AREA][google.cloud.talent.v4beta1.Location.LocationType.SUB_ADMINISTRATIVE_AREA], - // [LocationType.ADMINISTRATIVE_AREA][google.cloud.talent.v4beta1.Location.LocationType.ADMINISTRATIVE_AREA], - // or - // [LocationType.COUNTRY][google.cloud.talent.v4beta1.Location.LocationType.COUNTRY], - // the filter is performed against the detected location name (using exact - // text matching). Otherwise, the filter is performed against the detected - // center point and a radius of detected location radius + - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles]. - // - // If [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address] is provided, - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is the additional radius on top of the - // radius of the location geocoded from [LocationFilter.address][google.cloud.talent.v4beta1.LocationFilter.address]. If - // [LocationFilter.lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] is provided, - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is the only radius that is used. - // - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is 10 by default. Note that the value - // of [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is 0 if it is unset, so the server - // does not differentiate [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] that is - // explicitly set to 0 and [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] that is not - // set. Which means that if [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is explicitly - // set to 0, the server will use the default value of - // [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] which is 10. To work around this and - // effectively set [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] to 0, we recommend - // setting [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] to a very small decimal number - // (such as 0.00001). - // - // If [LocationFilter.distance_in_miles][google.cloud.talent.v4beta1.LocationFilter.distance_in_miles] is negative, an error is thrown. - repeated LocationFilter location_filters = 2; - - // Job title filter specifies job titles of profiles to match on. - // - // If a job title isn't specified, profiles with any titles are retrieved. - // - // If multiple values are specified, profiles are retrieved with any of the - // specified job titles. - // - // If [JobTitleFilter.negated][google.cloud.talent.v4beta1.JobTitleFilter.negated] is specified, the result won't contain - // profiles with the job titles. - // - // For example, search for profiles with a job title "Product Manager". - repeated JobTitleFilter job_title_filters = 3; - - // Employer filter specifies employers of profiles to match on. - // - // If an employer filter isn't specified, profiles with any employers are - // retrieved. - // - // If multiple employer filters are specified, profiles with any matching - // employers are retrieved. - // - // If [EmployerFilter.negated][google.cloud.talent.v4beta1.EmployerFilter.negated] is specified, the result won't contain - // profiles that match the employers. - // - // For example, search for profiles that have working experience at "Google - // LLC". - repeated EmployerFilter employer_filters = 4; - - // Education filter specifies education of profiles to match on. - // - // If an education filter isn't specified, profiles with any education are - // retrieved. - // - // If multiple education filters are specified, profiles that match any - // education filters are retrieved. - // - // If [EducationFilter.negated][google.cloud.talent.v4beta1.EducationFilter.negated] is specified, the result won't contain - // profiles that match the educations. - // - // For example, search for profiles with a master degree. - repeated EducationFilter education_filters = 5; - - // Skill filter specifies skill of profiles to match on. - // - // If a skill filter isn't specified, profiles with any skills are retrieved. - // - // If multiple skill filters are specified, profiles that match any skill - // filters are retrieved. - // - // If [SkillFilter.negated][google.cloud.talent.v4beta1.SkillFilter.negated] is specified, the result won't contain profiles - // that match the skills. - // - // For example, search for profiles that have "Java" and "Python" in skill - // list. - repeated SkillFilter skill_filters = 6; - - // Work experience filter specifies the total working experience of profiles - // to match on. - // - // If a work experience filter isn't specified, profiles with any - // professional experience are retrieved. - // - // If multiple work experience filters are specified, profiles that match any - // work experience filters are retrieved. - // - // For example, search for profiles with 10 years of work experience. - repeated WorkExperienceFilter work_experience_filter = 7; - - // Time filter specifies the create/update timestamp of the profiles to match - // on. - // - // For example, search for profiles created since "2018-1-1". - repeated TimeFilter time_filters = 8; - - // The hirable filter specifies the profile's hirable status to match on. - google.protobuf.BoolValue hirable_filter = 9; - - // The application date filters specify application date ranges to match on. - repeated ApplicationDateFilter application_date_filters = 10; - - // The application outcome notes filters specify the notes for the outcome of - // the job application. - repeated ApplicationOutcomeNotesFilter application_outcome_notes_filters = 11; - - // The application job filters specify the job applied for in the application. - repeated ApplicationJobFilter application_job_filters = 13; - - // This filter specifies a structured syntax to match against the - // [Profile.custom_attributes][google.cloud.talent.v4beta1.Profile.custom_attributes] that are marked as `filterable`. - // - // The syntax for this expression is a subset of Google SQL syntax. - // - // String custom attributes: supported operators are =, != where the left of - // the operator is a custom field key and the right of the operator is a - // string (surrounded by quotes) value. - // - // Numeric custom attributes: Supported operators are '>', '<' or '=' - // operators where the left of the operator is a custom field key and the - // right of the operator is a numeric value. - // - // Supported functions are LOWER() to - // perform case insensitive match and EMPTY() to filter on the - // existence of a key. - // - // Boolean expressions (AND/OR/NOT) are supported up to 3 levels of - // nesting (for example "((A AND B AND C) OR NOT D) AND E"), and there can be - // a maximum of 50 comparisons/functions in the expression. The expression - // must be < 2000 characters in length. - // - // Sample Query: - // (key1 = "TEST" OR LOWER(key1)="test" OR NOT EMPTY(key1)) - string custom_attribute_filter = 15; - - // Deprecated. Use availability_filters instead. - // - // The candidate availability filter which filters based on availability - // signals. - // - // Signal 1: Number of days since most recent job application. See - // [Availability.JobApplicationAvailabilitySignal][google.cloud.talent.v4beta1.Availability.JobApplicationAvailabilitySignal] for the details of this - // signal. - // - // Signal 2: Number of days since last profile update. See - // [Availability.ProfileUpdateAvailabilitySignal][google.cloud.talent.v4beta1.Availability.ProfileUpdateAvailabilitySignal] - // for the details of this signal. - // - // The candidate availability filter helps a recruiter understand if a - // specific candidate is likely to be actively seeking new job opportunities - // based on an aggregated set of signals. Specifically, the intent is NOT to - // indicate the candidate's potential qualification / interest / close ability - // for a specific job. - CandidateAvailabilityFilter candidate_availability_filter = 16 [deprecated = true]; - - // The availability filter which filters based on - // [Profile.availability_signals][google.cloud.talent.v4beta1.Profile.availability_signals]. - // - // The availability filter helps a recruiter understand if a - // specific candidate is likely to be actively seeking new job opportunities - // based on an aggregated set of signals. Specifically, the intent is NOT to - // indicate the candidate's potential qualification / interest / close ability - // for a specific job. - // - // There can be at most one [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter] per - // [signal_type][google.cloud.talent.v4beta1.AvailabilityFilter.signal_type]. If there are multiple - // [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter] for a [signal_type][google.cloud.talent.v4beta1.AvailabilityFilter.signal_type], - // an error is thrown. - repeated AvailabilityFilter availability_filters = 18; - - // Person name filter specifies person name of profiles to match on. - // - // If multiple person name filters are specified, profiles that match any - // person name filters are retrieved. - // - // For example, search for profiles of candidates with name "John Smith". - repeated PersonNameFilter person_name_filters = 17; -} - -// Geographic region of the search. -message LocationFilter { - // Specify whether to include telecommute jobs. - enum TelecommutePreference { - // Default value if the telecommute preference isn't specified. - TELECOMMUTE_PREFERENCE_UNSPECIFIED = 0; - - // Exclude telecommute jobs. - TELECOMMUTE_EXCLUDED = 1; - - // Allow telecommute jobs. - TELECOMMUTE_ALLOWED = 2; - } - - // The address name, such as "Mountain View" or "Bay Area". - string address = 1; - - // CLDR region code of the country/region of the address. This is used - // to address ambiguity of the user-input location, for example, "Liverpool" - // against "Liverpool, NY, US" or "Liverpool, UK". - // - // Set this field to bias location resolution toward a specific country - // or territory. If this field is not set, application behavior is biased - // toward the United States by default. - // - // See https://cldr.unicode.org/ and - // https://www.unicode.org/cldr/charts/30/supplemental/territory_information.html - // for details. Example: "CH" for Switzerland. - // Note that this filter is not applicable for Profile Search related queries. - string region_code = 2; - - // The latitude and longitude of the geographic center to search from. This - // field is ignored if `address` is provided. - google.type.LatLng lat_lng = 3; - - // The distance_in_miles is applied when the location being searched for is - // identified as a city or smaller. This field is ignored if the location - // being searched for is a state or larger. - double distance_in_miles = 4; - - // Allows the client to return jobs without a - // set location, specifically, telecommuting jobs (telecommuting is considered - // by the service as a special location. - // [Job.posting_region][google.cloud.talent.v4beta1.Job.posting_region] indicates if a job permits telecommuting. - // If this field is set to [TelecommutePreference.TELECOMMUTE_ALLOWED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_ALLOWED], - // telecommuting jobs are searched, and [address][google.cloud.talent.v4beta1.LocationFilter.address] and [lat_lng][google.cloud.talent.v4beta1.LocationFilter.lat_lng] are - // ignored. If not set or set to - // [TelecommutePreference.TELECOMMUTE_EXCLUDED][google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference.TELECOMMUTE_EXCLUDED], telecommute job are not - // searched. - // - // This filter can be used by itself to search exclusively for telecommuting - // jobs, or it can be combined with another location - // filter to search for a combination of job locations, - // such as "Mountain View" or "telecommuting" jobs. However, when used in - // combination with other location filters, telecommuting jobs can be - // treated as less relevant than other jobs in the search response. - // - // This field is only used for job search requests. - TelecommutePreference telecommute_preference = 5; - - // Whether to apply negation to the filter so profiles matching the filter - // are excluded. - // - // Currently only supported in profile search. - bool negated = 6; -} - -// Filter on job compensation type and amount. -message CompensationFilter { - // Specify the type of filtering. - enum FilterType { - // Filter type unspecified. Position holder, INVALID, should never be used. - FILTER_TYPE_UNSPECIFIED = 0; - - // Filter by `base compensation entry's` unit. A job is a match if and - // only if the job contains a base CompensationEntry and the base - // CompensationEntry's unit matches provided [units][google.cloud.talent.v4beta1.CompensationFilter.units]. - // Populate one or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. - // - // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for definition of - // base compensation entry. - UNIT_ONLY = 1; - - // Filter by `base compensation entry's` unit and amount / range. A job - // is a match if and only if the job contains a base CompensationEntry, and - // the base entry's unit matches provided - // [CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit] and - // amount or range overlaps with provided - // [CompensationRange][google.cloud.talent.v4beta1.CompensationInfo.CompensationRange]. - // - // See [CompensationInfo.CompensationEntry][google.cloud.talent.v4beta1.CompensationInfo.CompensationEntry] for definition of - // base compensation entry. - // - // Set exactly one [units][google.cloud.talent.v4beta1.CompensationFilter.units] and populate [range][google.cloud.talent.v4beta1.CompensationFilter.range]. - UNIT_AND_AMOUNT = 2; - - // Filter by annualized base compensation amount and `base compensation - // entry's` unit. Populate [range][google.cloud.talent.v4beta1.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. - ANNUALIZED_BASE_AMOUNT = 3; - - // Filter by annualized total compensation amount and `base compensation - // entry's` unit . Populate [range][google.cloud.talent.v4beta1.CompensationFilter.range] and zero or more [units][google.cloud.talent.v4beta1.CompensationFilter.units]. - ANNUALIZED_TOTAL_AMOUNT = 4; - } - - // Required. Type of filter. - FilterType type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specify desired `base compensation entry's` - // [CompensationInfo.CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit]. - repeated CompensationInfo.CompensationUnit units = 2 [(google.api.field_behavior) = REQUIRED]; - - // Compensation range. - CompensationInfo.CompensationRange range = 3; - - // If set to true, jobs with unspecified compensation range fields are - // included. - bool include_jobs_with_unspecified_compensation_range = 4; -} - -// Parameters needed for commute search. -message CommuteFilter { - // The traffic density to use when calculating commute time. - enum RoadTraffic { - // Road traffic situation isn't specified. - ROAD_TRAFFIC_UNSPECIFIED = 0; - - // Optimal commute time without considering any traffic impact. - TRAFFIC_FREE = 1; - - // Commute time calculation takes in account the peak traffic impact. - BUSY_HOUR = 2; - } - - // Required. The method of transportation to calculate the commute time for. - CommuteMethod commute_method = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The latitude and longitude of the location to calculate the - // commute time from. - google.type.LatLng start_coordinates = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The maximum travel time in seconds. The maximum allowed value is `3600s` - // (one hour). Format is `123s`. - google.protobuf.Duration travel_duration = 3 [(google.api.field_behavior) = REQUIRED]; - - // If `true`, jobs without street level addresses may also be returned. - // For city level addresses, the city center is used. For state and coarser - // level addresses, text matching is used. - // If this field is set to `false` or isn't specified, only jobs that include - // street level addresses will be returned by commute search. - bool allow_imprecise_addresses = 4; - - // Traffic factor to take into account while searching by commute. - oneof traffic_option { - // Specifies the traffic density to use when calculating commute time. - RoadTraffic road_traffic = 5; - - // The departure time used to calculate traffic impact, represented as - // [google.type.TimeOfDay][google.type.TimeOfDay] in local time zone. - // - // Currently traffic model is restricted to hour level resolution. - google.type.TimeOfDay departure_time = 6; - } -} - -// Job title of the search. -message JobTitleFilter { - // Required. The job title. For example, "Software engineer", or "Product manager". - string job_title = 1 [(google.api.field_behavior) = REQUIRED]; - - // Whether to apply negation to the filter so profiles matching the filter - // are excluded. - bool negated = 2; -} - -// Skill filter of the search. -message SkillFilter { - // Required. The skill name. For example, "java", "j2ee", and so on. - string skill = 1 [(google.api.field_behavior) = REQUIRED]; - - // Whether to apply negation to the filter so profiles matching the filter - // are excluded. - bool negated = 2; -} - -// Employer filter of the search. -message EmployerFilter { - // Enum indicating which set of [Profile.employment_records][google.cloud.talent.v4beta1.Profile.employment_records] to search - // against. - enum EmployerFilterMode { - // Default value. - EMPLOYER_FILTER_MODE_UNSPECIFIED = 0; - - // Apply to all employers in [Profile.employment_records][google.cloud.talent.v4beta1.Profile.employment_records]. - ALL_EMPLOYMENT_RECORDS = 1; - - // Apply only to current employer in [Profile.employment_records][google.cloud.talent.v4beta1.Profile.employment_records]. - CURRENT_EMPLOYMENT_RECORDS_ONLY = 2; - - // Apply only to past (not current) employers in - // [Profile.employment_records][google.cloud.talent.v4beta1.Profile.employment_records]. - PAST_EMPLOYMENT_RECORDS_ONLY = 3; - } - - // Required. The name of the employer, for example "Google", "Alphabet". - string employer = 1 [(google.api.field_behavior) = REQUIRED]; - - // Define set of [EmploymentRecord][google.cloud.talent.v4beta1.EmploymentRecord]s to search against. - // - // Defaults to [EmployerFilterMode.ALL_EMPLOYMENT_RECORDS][google.cloud.talent.v4beta1.EmployerFilter.EmployerFilterMode.ALL_EMPLOYMENT_RECORDS]. - EmployerFilterMode mode = 2; - - // Whether to apply negation to the filter so profiles matching the filter - // is excluded. - bool negated = 3; -} - -// Education filter of the search. -message EducationFilter { - // The school name. For example "MIT", "University of California, Berkeley". - string school = 1; - - // The field of study. This is to search against value provided in - // [Degree.fields_of_study][google.cloud.talent.v4beta1.Degree.fields_of_study]. - // For example "Computer Science", "Mathematics". - string field_of_study = 2; - - // Education degree in ISCED code. Each value in degree covers a specific - // level of education, without any expansion to upper nor lower levels of - // education degree. - DegreeType degree_type = 3; - - // Whether to apply negation to the filter so profiles matching the filter - // is excluded. - bool negated = 6; -} - -// Work experience filter. -// -// This filter is used to search for profiles with working experience length -// between [min_experience][google.cloud.talent.v4beta1.WorkExperienceFilter.min_experience] and [max_experience][google.cloud.talent.v4beta1.WorkExperienceFilter.max_experience]. -message WorkExperienceFilter { - // The minimum duration of the work experience (inclusive). - google.protobuf.Duration min_experience = 1; - - // The maximum duration of the work experience (exclusive). - google.protobuf.Duration max_experience = 2; -} - -// Application Date Range Filter. -// -// The API matches profiles with [Application.application_date][google.cloud.talent.v4beta1.Application.application_date] between -// start date and end date (both boundaries are inclusive). The filter is -// ignored if both [start_date][google.cloud.talent.v4beta1.ApplicationDateFilter.start_date] and [end_date][google.cloud.talent.v4beta1.ApplicationDateFilter.end_date] are missing. -message ApplicationDateFilter { - // Start date. If it's missing, The API matches profiles with application date - // not after the end date. - google.type.Date start_date = 1; - - // End date. If it's missing, The API matches profiles with application date - // not before the start date. - google.type.Date end_date = 2; -} - -// Outcome Notes Filter. -message ApplicationOutcomeNotesFilter { - // Required. User entered or selected outcome reason. The API does an exact match on the - // [Application.outcome_notes][google.cloud.talent.v4beta1.Application.outcome_notes] in profiles. - string outcome_notes = 1 [(google.api.field_behavior) = REQUIRED]; - - // If true, The API excludes all candidates with any - // [Application.outcome_notes][google.cloud.talent.v4beta1.Application.outcome_notes] matching the outcome reason specified in - // the filter. - bool negated = 2; -} - -// Filter on the job information of Application. -message ApplicationJobFilter { - // The job requisition id in the application. The API does an exact match on - // the [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] of [Application.job][google.cloud.talent.v4beta1.Application.job] in profiles. - string job_requisition_id = 2; - - // The job title in the application. The API does an exact match on the - // [Job.title][google.cloud.talent.v4beta1.Job.title] of [Application.job][google.cloud.talent.v4beta1.Application.job] in profiles. - string job_title = 3; - - // If true, the API excludes all profiles with any [Application.job][google.cloud.talent.v4beta1.Application.job] - // matching the filters. - bool negated = 4; -} - -// Filter on create timestamp or update timestamp of profiles. -message TimeFilter { - // Time fields can be used in TimeFilter. - enum TimeField { - // Default value. - TIME_FIELD_UNSPECIFIED = 0; - - // Earliest profile create time. - CREATE_TIME = 1; - - // Latest profile update time. - UPDATE_TIME = 2; - } - - // Start timestamp, matching profiles with the start time. If this field - // missing, The API matches profiles with create / update timestamp before the - // end timestamp. - google.protobuf.Timestamp start_time = 1; - - // End timestamp, matching profiles with the end time. If this field - // missing, The API matches profiles with create / update timestamp after the - // start timestamp. - google.protobuf.Timestamp end_time = 2; - - // Specifies which time field to filter profiles. - // - // Defaults to [TimeField.CREATE_TIME][google.cloud.talent.v4beta1.TimeFilter.TimeField.CREATE_TIME]. - TimeField time_field = 3; -} - -// Deprecated. Use AvailabilityFilter instead. -// -// Filter on availability signals. -message CandidateAvailabilityFilter { - option deprecated = true; - - // It is false by default. If true, API excludes all the potential available - // profiles. - bool negated = 1; -} - -// Filter on availability signals. -message AvailabilityFilter { - // Required. Type of signal to apply filter on. - AvailabilitySignalType signal_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Range of times to filter candidate signals by. - TimestampRange range = 2 [(google.api.field_behavior) = REQUIRED]; - - // If multiple [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter] are provided, the default - // behavior is to OR all filters, but if this field is set to true, this - // particular [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter] will be AND'ed against other - // [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter]. - bool required = 3; -} - -// Filter on person name. -message PersonNameFilter { - // Required. The person name. For example, "John Smith". - // - // Can be any combination of [PersonName.structured_name.given_name][], - // [PersonName.structured_name.middle_initial][], - // [PersonName.structured_name.family_name][], and - // [PersonName.formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name]. - string person_name = 1 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/filters_pb2.py b/talent/google/cloud/talent_v4beta1/proto/filters_pb2.py deleted file mode 100644 index 7626ecbf682a..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/filters_pb2.py +++ /dev/null @@ -1,2897 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/filters.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 -from google.type import timeofday_pb2 as google_dot_type_dot_timeofday__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/filters.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\014FiltersProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n/google/cloud/talent_v4beta1/proto/filters.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a\x18google/type/latlng.proto\x1a\x1bgoogle/type/timeofday.proto\x1a\x1cgoogle/api/annotations.proto"\x80\x05\n\x08JobQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x1b\n\x13query_language_code\x18\x0e \x01(\t\x12\x11\n\tcompanies\x18\x02 \x03(\t\x12\x45\n\x10location_filters\x18\x03 \x03(\x0b\x32+.google.cloud.talent.v4beta1.LocationFilter\x12@\n\x0ejob_categories\x18\x04 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x12\x42\n\x0e\x63ommute_filter\x18\x05 \x01(\x0b\x32*.google.cloud.talent.v4beta1.CommuteFilter\x12\x1d\n\x15\x63ompany_display_names\x18\x06 \x03(\t\x12L\n\x13\x63ompensation_filter\x18\x07 \x01(\x0b\x32/.google.cloud.talent.v4beta1.CompensationFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x08 \x01(\t\x12\x1b\n\x13\x64isable_spell_check\x18\t \x01(\x08\x12\x45\n\x10\x65mployment_types\x18\n \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x16\n\x0elanguage_codes\x18\x0b \x03(\t\x12G\n\x12publish_time_range\x18\x0c \x01(\x0b\x32+.google.cloud.talent.v4beta1.TimestampRange\x12\x15\n\rexcluded_jobs\x18\r \x03(\t"\xf5\x08\n\x0cProfileQuery\x12\r\n\x05query\x18\x01 \x01(\t\x12\x45\n\x10location_filters\x18\x02 \x03(\x0b\x32+.google.cloud.talent.v4beta1.LocationFilter\x12\x46\n\x11job_title_filters\x18\x03 \x03(\x0b\x32+.google.cloud.talent.v4beta1.JobTitleFilter\x12\x45\n\x10\x65mployer_filters\x18\x04 \x03(\x0b\x32+.google.cloud.talent.v4beta1.EmployerFilter\x12G\n\x11\x65\x64ucation_filters\x18\x05 \x03(\x0b\x32,.google.cloud.talent.v4beta1.EducationFilter\x12?\n\rskill_filters\x18\x06 \x03(\x0b\x32(.google.cloud.talent.v4beta1.SkillFilter\x12Q\n\x16work_experience_filter\x18\x07 \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.WorkExperienceFilter\x12=\n\x0ctime_filters\x18\x08 \x03(\x0b\x32\'.google.cloud.talent.v4beta1.TimeFilter\x12\x32\n\x0ehirable_filter\x18\t \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12T\n\x18\x61pplication_date_filters\x18\n \x03(\x0b\x32\x32.google.cloud.talent.v4beta1.ApplicationDateFilter\x12\x65\n!application_outcome_notes_filters\x18\x0b \x03(\x0b\x32:.google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter\x12R\n\x17\x61pplication_job_filters\x18\r \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.ApplicationJobFilter\x12\x1f\n\x17\x63ustom_attribute_filter\x18\x0f \x01(\t\x12\x63\n\x1d\x63\x61ndidate_availability_filter\x18\x10 \x01(\x0b\x32\x38.google.cloud.talent.v4beta1.CandidateAvailabilityFilterB\x02\x18\x01\x12M\n\x14\x61vailability_filters\x18\x12 \x03(\x0b\x32/.google.cloud.talent.v4beta1.AvailabilityFilter\x12J\n\x13person_name_filters\x18\x11 \x03(\x0b\x32-.google.cloud.talent.v4beta1.PersonNameFilter"\xdf\x02\n\x0eLocationFilter\x12\x0f\n\x07\x61\x64\x64ress\x18\x01 \x01(\t\x12\x13\n\x0bregion_code\x18\x02 \x01(\t\x12$\n\x07lat_lng\x18\x03 \x01(\x0b\x32\x13.google.type.LatLng\x12\x19\n\x11\x64istance_in_miles\x18\x04 \x01(\x01\x12\x61\n\x16telecommute_preference\x18\x05 \x01(\x0e\x32\x41.google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference\x12\x0f\n\x07negated\x18\x06 \x01(\x08"r\n\x15TelecommutePreference\x12&\n"TELECOMMUTE_PREFERENCE_UNSPECIFIED\x10\x00\x12\x18\n\x14TELECOMMUTE_EXCLUDED\x10\x01\x12\x17\n\x13TELECOMMUTE_ALLOWED\x10\x02"\xca\x03\n\x12\x43ompensationFilter\x12M\n\x04type\x18\x01 \x01(\x0e\x32:.google.cloud.talent.v4beta1.CompensationFilter.FilterTypeB\x03\xe0\x41\x02\x12R\n\x05units\x18\x02 \x03(\x0e\x32>.google.cloud.talent.v4beta1.CompensationInfo.CompensationUnitB\x03\xe0\x41\x02\x12N\n\x05range\x18\x03 \x01(\x0b\x32?.google.cloud.talent.v4beta1.CompensationInfo.CompensationRange\x12\x38\n0include_jobs_with_unspecified_compensation_range\x18\x04 \x01(\x08"\x86\x01\n\nFilterType\x12\x1b\n\x17\x46ILTER_TYPE_UNSPECIFIED\x10\x00\x12\r\n\tUNIT_ONLY\x10\x01\x12\x13\n\x0fUNIT_AND_AMOUNT\x10\x02\x12\x1a\n\x16\x41NNUALIZED_BASE_AMOUNT\x10\x03\x12\x1b\n\x17\x41NNUALIZED_TOTAL_AMOUNT\x10\x04"\xcb\x03\n\rCommuteFilter\x12G\n\x0e\x63ommute_method\x18\x01 \x01(\x0e\x32*.google.cloud.talent.v4beta1.CommuteMethodB\x03\xe0\x41\x02\x12\x33\n\x11start_coordinates\x18\x02 \x01(\x0b\x32\x13.google.type.LatLngB\x03\xe0\x41\x02\x12\x37\n\x0ftravel_duration\x18\x03 \x01(\x0b\x32\x19.google.protobuf.DurationB\x03\xe0\x41\x02\x12!\n\x19\x61llow_imprecise_addresses\x18\x04 \x01(\x08\x12N\n\x0croad_traffic\x18\x05 \x01(\x0e\x32\x36.google.cloud.talent.v4beta1.CommuteFilter.RoadTrafficH\x00\x12\x30\n\x0e\x64\x65parture_time\x18\x06 \x01(\x0b\x32\x16.google.type.TimeOfDayH\x00"L\n\x0bRoadTraffic\x12\x1c\n\x18ROAD_TRAFFIC_UNSPECIFIED\x10\x00\x12\x10\n\x0cTRAFFIC_FREE\x10\x01\x12\r\n\tBUSY_HOUR\x10\x02\x42\x10\n\x0etraffic_option"9\n\x0eJobTitleFilter\x12\x16\n\tjob_title\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07negated\x18\x02 \x01(\x08"2\n\x0bSkillFilter\x12\x12\n\x05skill\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07negated\x18\x02 \x01(\x08"\xa6\x02\n\x0e\x45mployerFilter\x12\x15\n\x08\x65mployer\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x04mode\x18\x02 \x01(\x0e\x32>.google.cloud.talent.v4beta1.EmployerFilter.EmployerFilterMode\x12\x0f\n\x07negated\x18\x03 \x01(\x08"\x9d\x01\n\x12\x45mployerFilterMode\x12$\n EMPLOYER_FILTER_MODE_UNSPECIFIED\x10\x00\x12\x1a\n\x16\x41LL_EMPLOYMENT_RECORDS\x10\x01\x12#\n\x1f\x43URRENT_EMPLOYMENT_RECORDS_ONLY\x10\x02\x12 \n\x1cPAST_EMPLOYMENT_RECORDS_ONLY\x10\x03"\x88\x01\n\x0f\x45\x64ucationFilter\x12\x0e\n\x06school\x18\x01 \x01(\t\x12\x16\n\x0e\x66ield_of_study\x18\x02 \x01(\t\x12<\n\x0b\x64\x65gree_type\x18\x03 \x01(\x0e\x32\'.google.cloud.talent.v4beta1.DegreeType\x12\x0f\n\x07negated\x18\x06 \x01(\x08"|\n\x14WorkExperienceFilter\x12\x31\n\x0emin_experience\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x31\n\x0emax_experience\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"c\n\x15\x41pplicationDateFilter\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date"L\n\x1d\x41pplicationOutcomeNotesFilter\x12\x1a\n\routcome_notes\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0f\n\x07negated\x18\x02 \x01(\x08"V\n\x14\x41pplicationJobFilter\x12\x1a\n\x12job_requisition_id\x18\x02 \x01(\t\x12\x11\n\tjob_title\x18\x03 \x01(\t\x12\x0f\n\x07negated\x18\x04 \x01(\x08"\xfc\x01\n\nTimeFilter\x12.\n\nstart_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x45\n\ntime_field\x18\x03 \x01(\x0e\x32\x31.google.cloud.talent.v4beta1.TimeFilter.TimeField"I\n\tTimeField\x12\x1a\n\x16TIME_FIELD_UNSPECIFIED\x10\x00\x12\x0f\n\x0b\x43REATE_TIME\x10\x01\x12\x0f\n\x0bUPDATE_TIME\x10\x02"2\n\x1b\x43\x61ndidateAvailabilityFilter\x12\x0f\n\x07negated\x18\x01 \x01(\x08:\x02\x18\x01"\xb6\x01\n\x12\x41vailabilityFilter\x12M\n\x0bsignal_type\x18\x01 \x01(\x0e\x32\x33.google.cloud.talent.v4beta1.AvailabilitySignalTypeB\x03\xe0\x41\x02\x12?\n\x05range\x18\x02 \x01(\x0b\x32+.google.cloud.talent.v4beta1.TimestampRangeB\x03\xe0\x41\x02\x12\x10\n\x08required\x18\x03 \x01(\x08",\n\x10PersonNameFilter\x12\x18\n\x0bperson_name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x42z\n\x1f\x63om.google.cloud.talent.v4beta1B\x0c\x46iltersProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, - google_dot_type_dot_date__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - google_dot_type_dot_timeofday__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_LOCATIONFILTER_TELECOMMUTEPREFERENCE = _descriptor.EnumDescriptor( - name="TelecommutePreference", - full_name="google.cloud.talent.v4beta1.LocationFilter.TelecommutePreference", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TELECOMMUTE_PREFERENCE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TELECOMMUTE_EXCLUDED", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TELECOMMUTE_ALLOWED", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2426, - serialized_end=2540, -) -_sym_db.RegisterEnumDescriptor(_LOCATIONFILTER_TELECOMMUTEPREFERENCE) - -_COMPENSATIONFILTER_FILTERTYPE = _descriptor.EnumDescriptor( - name="FilterType", - full_name="google.cloud.talent.v4beta1.CompensationFilter.FilterType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FILTER_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="UNIT_ONLY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNIT_AND_AMOUNT", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ANNUALIZED_BASE_AMOUNT", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ANNUALIZED_TOTAL_AMOUNT", - index=4, - number=4, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2867, - serialized_end=3001, -) -_sym_db.RegisterEnumDescriptor(_COMPENSATIONFILTER_FILTERTYPE) - -_COMMUTEFILTER_ROADTRAFFIC = _descriptor.EnumDescriptor( - name="RoadTraffic", - full_name="google.cloud.talent.v4beta1.CommuteFilter.RoadTraffic", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="ROAD_TRAFFIC_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TRAFFIC_FREE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BUSY_HOUR", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3369, - serialized_end=3445, -) -_sym_db.RegisterEnumDescriptor(_COMMUTEFILTER_ROADTRAFFIC) - -_EMPLOYERFILTER_EMPLOYERFILTERMODE = _descriptor.EnumDescriptor( - name="EmployerFilterMode", - full_name="google.cloud.talent.v4beta1.EmployerFilter.EmployerFilterMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="EMPLOYER_FILTER_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="ALL_EMPLOYMENT_RECORDS", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CURRENT_EMPLOYMENT_RECORDS_ONLY", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PAST_EMPLOYMENT_RECORDS_ONLY", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3714, - serialized_end=3871, -) -_sym_db.RegisterEnumDescriptor(_EMPLOYERFILTER_EMPLOYERFILTERMODE) - -_TIMEFILTER_TIMEFIELD = _descriptor.EnumDescriptor( - name="TimeField", - full_name="google.cloud.talent.v4beta1.TimeFilter.TimeField", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TIME_FIELD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATE_TIME", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPDATE_TIME", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4585, - serialized_end=4658, -) -_sym_db.RegisterEnumDescriptor(_TIMEFILTER_TIMEFIELD) - - -_JOBQUERY = _descriptor.Descriptor( - name="JobQuery", - full_name="google.cloud.talent.v4beta1.JobQuery", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="query", - full_name="google.cloud.talent.v4beta1.JobQuery.query", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="query_language_code", - full_name="google.cloud.talent.v4beta1.JobQuery.query_language_code", - index=1, - number=14, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="companies", - full_name="google.cloud.talent.v4beta1.JobQuery.companies", - index=2, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_filters", - full_name="google.cloud.talent.v4beta1.JobQuery.location_filters", - index=3, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_categories", - full_name="google.cloud.talent.v4beta1.JobQuery.job_categories", - index=4, - number=4, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="commute_filter", - full_name="google.cloud.talent.v4beta1.JobQuery.commute_filter", - index=5, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company_display_names", - full_name="google.cloud.talent.v4beta1.JobQuery.company_display_names", - index=6, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="compensation_filter", - full_name="google.cloud.talent.v4beta1.JobQuery.compensation_filter", - index=7, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_attribute_filter", - full_name="google.cloud.talent.v4beta1.JobQuery.custom_attribute_filter", - index=8, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disable_spell_check", - full_name="google.cloud.talent.v4beta1.JobQuery.disable_spell_check", - index=9, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employment_types", - full_name="google.cloud.talent.v4beta1.JobQuery.employment_types", - index=10, - number=10, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_codes", - full_name="google.cloud.talent.v4beta1.JobQuery.language_codes", - index=11, - number=11, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publish_time_range", - full_name="google.cloud.talent.v4beta1.JobQuery.publish_time_range", - index=12, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="excluded_jobs", - full_name="google.cloud.talent.v4beta1.JobQuery.excluded_jobs", - index=13, - number=13, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=402, - serialized_end=1042, -) - - -_PROFILEQUERY = _descriptor.Descriptor( - name="ProfileQuery", - full_name="google.cloud.talent.v4beta1.ProfileQuery", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="query", - full_name="google.cloud.talent.v4beta1.ProfileQuery.query", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.location_filters", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.job_title_filters", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employer_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.employer_filters", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="education_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.education_filters", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skill_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.skill_filters", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="work_experience_filter", - full_name="google.cloud.talent.v4beta1.ProfileQuery.work_experience_filter", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.time_filters", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="hirable_filter", - full_name="google.cloud.talent.v4beta1.ProfileQuery.hirable_filter", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application_date_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.application_date_filters", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application_outcome_notes_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.application_outcome_notes_filters", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application_job_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.application_job_filters", - index=11, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_attribute_filter", - full_name="google.cloud.talent.v4beta1.ProfileQuery.custom_attribute_filter", - index=12, - number=15, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="candidate_availability_filter", - full_name="google.cloud.talent.v4beta1.ProfileQuery.candidate_availability_filter", - index=13, - number=16, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="availability_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.availability_filters", - index=14, - number=18, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="person_name_filters", - full_name="google.cloud.talent.v4beta1.ProfileQuery.person_name_filters", - index=15, - number=17, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1045, - serialized_end=2186, -) - - -_LOCATIONFILTER = _descriptor.Descriptor( - name="LocationFilter", - full_name="google.cloud.talent.v4beta1.LocationFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="address", - full_name="google.cloud.talent.v4beta1.LocationFilter.address", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="region_code", - full_name="google.cloud.talent.v4beta1.LocationFilter.region_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.talent.v4beta1.LocationFilter.lat_lng", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="distance_in_miles", - full_name="google.cloud.talent.v4beta1.LocationFilter.distance_in_miles", - index=3, - number=4, - type=1, - cpp_type=5, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="telecommute_preference", - full_name="google.cloud.talent.v4beta1.LocationFilter.telecommute_preference", - index=4, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.LocationFilter.negated", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LOCATIONFILTER_TELECOMMUTEPREFERENCE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2189, - serialized_end=2540, -) - - -_COMPENSATIONFILTER = _descriptor.Descriptor( - name="CompensationFilter", - full_name="google.cloud.talent.v4beta1.CompensationFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.CompensationFilter.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="units", - full_name="google.cloud.talent.v4beta1.CompensationFilter.units", - index=1, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="range", - full_name="google.cloud.talent.v4beta1.CompensationFilter.range", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_jobs_with_unspecified_compensation_range", - full_name="google.cloud.talent.v4beta1.CompensationFilter.include_jobs_with_unspecified_compensation_range", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_COMPENSATIONFILTER_FILTERTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2543, - serialized_end=3001, -) - - -_COMMUTEFILTER = _descriptor.Descriptor( - name="CommuteFilter", - full_name="google.cloud.talent.v4beta1.CommuteFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="commute_method", - full_name="google.cloud.talent.v4beta1.CommuteFilter.commute_method", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_coordinates", - full_name="google.cloud.talent.v4beta1.CommuteFilter.start_coordinates", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="travel_duration", - full_name="google.cloud.talent.v4beta1.CommuteFilter.travel_duration", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="allow_imprecise_addresses", - full_name="google.cloud.talent.v4beta1.CommuteFilter.allow_imprecise_addresses", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="road_traffic", - full_name="google.cloud.talent.v4beta1.CommuteFilter.road_traffic", - index=4, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="departure_time", - full_name="google.cloud.talent.v4beta1.CommuteFilter.departure_time", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_COMMUTEFILTER_ROADTRAFFIC], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="traffic_option", - full_name="google.cloud.talent.v4beta1.CommuteFilter.traffic_option", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3004, - serialized_end=3463, -) - - -_JOBTITLEFILTER = _descriptor.Descriptor( - name="JobTitleFilter", - full_name="google.cloud.talent.v4beta1.JobTitleFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job_title", - full_name="google.cloud.talent.v4beta1.JobTitleFilter.job_title", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.JobTitleFilter.negated", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3465, - serialized_end=3522, -) - - -_SKILLFILTER = _descriptor.Descriptor( - name="SkillFilter", - full_name="google.cloud.talent.v4beta1.SkillFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="skill", - full_name="google.cloud.talent.v4beta1.SkillFilter.skill", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.SkillFilter.negated", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3524, - serialized_end=3574, -) - - -_EMPLOYERFILTER = _descriptor.Descriptor( - name="EmployerFilter", - full_name="google.cloud.talent.v4beta1.EmployerFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="employer", - full_name="google.cloud.talent.v4beta1.EmployerFilter.employer", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mode", - full_name="google.cloud.talent.v4beta1.EmployerFilter.mode", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.EmployerFilter.negated", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_EMPLOYERFILTER_EMPLOYERFILTERMODE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3577, - serialized_end=3871, -) - - -_EDUCATIONFILTER = _descriptor.Descriptor( - name="EducationFilter", - full_name="google.cloud.talent.v4beta1.EducationFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="school", - full_name="google.cloud.talent.v4beta1.EducationFilter.school", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="field_of_study", - full_name="google.cloud.talent.v4beta1.EducationFilter.field_of_study", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="degree_type", - full_name="google.cloud.talent.v4beta1.EducationFilter.degree_type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.EducationFilter.negated", - index=3, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3874, - serialized_end=4010, -) - - -_WORKEXPERIENCEFILTER = _descriptor.Descriptor( - name="WorkExperienceFilter", - full_name="google.cloud.talent.v4beta1.WorkExperienceFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min_experience", - full_name="google.cloud.talent.v4beta1.WorkExperienceFilter.min_experience", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_experience", - full_name="google.cloud.talent.v4beta1.WorkExperienceFilter.max_experience", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4012, - serialized_end=4136, -) - - -_APPLICATIONDATEFILTER = _descriptor.Descriptor( - name="ApplicationDateFilter", - full_name="google.cloud.talent.v4beta1.ApplicationDateFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_date", - full_name="google.cloud.talent.v4beta1.ApplicationDateFilter.start_date", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_date", - full_name="google.cloud.talent.v4beta1.ApplicationDateFilter.end_date", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4138, - serialized_end=4237, -) - - -_APPLICATIONOUTCOMENOTESFILTER = _descriptor.Descriptor( - name="ApplicationOutcomeNotesFilter", - full_name="google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="outcome_notes", - full_name="google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter.outcome_notes", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter.negated", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4239, - serialized_end=4315, -) - - -_APPLICATIONJOBFILTER = _descriptor.Descriptor( - name="ApplicationJobFilter", - full_name="google.cloud.talent.v4beta1.ApplicationJobFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job_requisition_id", - full_name="google.cloud.talent.v4beta1.ApplicationJobFilter.job_requisition_id", - index=0, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title", - full_name="google.cloud.talent.v4beta1.ApplicationJobFilter.job_title", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.ApplicationJobFilter.negated", - index=2, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4317, - serialized_end=4403, -) - - -_TIMEFILTER = _descriptor.Descriptor( - name="TimeFilter", - full_name="google.cloud.talent.v4beta1.TimeFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.talent.v4beta1.TimeFilter.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.talent.v4beta1.TimeFilter.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_field", - full_name="google.cloud.talent.v4beta1.TimeFilter.time_field", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TIMEFILTER_TIMEFIELD], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4406, - serialized_end=4658, -) - - -_CANDIDATEAVAILABILITYFILTER = _descriptor.Descriptor( - name="CandidateAvailabilityFilter", - full_name="google.cloud.talent.v4beta1.CandidateAvailabilityFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="negated", - full_name="google.cloud.talent.v4beta1.CandidateAvailabilityFilter.negated", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("\030\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4660, - serialized_end=4710, -) - - -_AVAILABILITYFILTER = _descriptor.Descriptor( - name="AvailabilityFilter", - full_name="google.cloud.talent.v4beta1.AvailabilityFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="signal_type", - full_name="google.cloud.talent.v4beta1.AvailabilityFilter.signal_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="range", - full_name="google.cloud.talent.v4beta1.AvailabilityFilter.range", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="required", - full_name="google.cloud.talent.v4beta1.AvailabilityFilter.required", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4713, - serialized_end=4895, -) - - -_PERSONNAMEFILTER = _descriptor.Descriptor( - name="PersonNameFilter", - full_name="google.cloud.talent.v4beta1.PersonNameFilter", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="person_name", - full_name="google.cloud.talent.v4beta1.PersonNameFilter.person_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4897, - serialized_end=4941, -) - -_JOBQUERY.fields_by_name["location_filters"].message_type = _LOCATIONFILTER -_JOBQUERY.fields_by_name[ - "job_categories" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._JOBCATEGORY -) -_JOBQUERY.fields_by_name["commute_filter"].message_type = _COMMUTEFILTER -_JOBQUERY.fields_by_name["compensation_filter"].message_type = _COMPENSATIONFILTER -_JOBQUERY.fields_by_name[ - "employment_types" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._EMPLOYMENTTYPE -) -_JOBQUERY.fields_by_name[ - "publish_time_range" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._TIMESTAMPRANGE -) -_PROFILEQUERY.fields_by_name["location_filters"].message_type = _LOCATIONFILTER -_PROFILEQUERY.fields_by_name["job_title_filters"].message_type = _JOBTITLEFILTER -_PROFILEQUERY.fields_by_name["employer_filters"].message_type = _EMPLOYERFILTER -_PROFILEQUERY.fields_by_name["education_filters"].message_type = _EDUCATIONFILTER -_PROFILEQUERY.fields_by_name["skill_filters"].message_type = _SKILLFILTER -_PROFILEQUERY.fields_by_name[ - "work_experience_filter" -].message_type = _WORKEXPERIENCEFILTER -_PROFILEQUERY.fields_by_name["time_filters"].message_type = _TIMEFILTER -_PROFILEQUERY.fields_by_name[ - "hirable_filter" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_PROFILEQUERY.fields_by_name[ - "application_date_filters" -].message_type = _APPLICATIONDATEFILTER -_PROFILEQUERY.fields_by_name[ - "application_outcome_notes_filters" -].message_type = _APPLICATIONOUTCOMENOTESFILTER -_PROFILEQUERY.fields_by_name[ - "application_job_filters" -].message_type = _APPLICATIONJOBFILTER -_PROFILEQUERY.fields_by_name[ - "candidate_availability_filter" -].message_type = _CANDIDATEAVAILABILITYFILTER -_PROFILEQUERY.fields_by_name["availability_filters"].message_type = _AVAILABILITYFILTER -_PROFILEQUERY.fields_by_name["person_name_filters"].message_type = _PERSONNAMEFILTER -_LOCATIONFILTER.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LOCATIONFILTER.fields_by_name[ - "telecommute_preference" -].enum_type = _LOCATIONFILTER_TELECOMMUTEPREFERENCE -_LOCATIONFILTER_TELECOMMUTEPREFERENCE.containing_type = _LOCATIONFILTER -_COMPENSATIONFILTER.fields_by_name["type"].enum_type = _COMPENSATIONFILTER_FILTERTYPE -_COMPENSATIONFILTER.fields_by_name[ - "units" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._COMPENSATIONINFO_COMPENSATIONUNIT -) -_COMPENSATIONFILTER.fields_by_name[ - "range" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._COMPENSATIONINFO_COMPENSATIONRANGE -) -_COMPENSATIONFILTER_FILTERTYPE.containing_type = _COMPENSATIONFILTER -_COMMUTEFILTER.fields_by_name[ - "commute_method" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._COMMUTEMETHOD -) -_COMMUTEFILTER.fields_by_name[ - "start_coordinates" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_COMMUTEFILTER.fields_by_name[ - "travel_duration" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_COMMUTEFILTER.fields_by_name["road_traffic"].enum_type = _COMMUTEFILTER_ROADTRAFFIC -_COMMUTEFILTER.fields_by_name[ - "departure_time" -].message_type = google_dot_type_dot_timeofday__pb2._TIMEOFDAY -_COMMUTEFILTER_ROADTRAFFIC.containing_type = _COMMUTEFILTER -_COMMUTEFILTER.oneofs_by_name["traffic_option"].fields.append( - _COMMUTEFILTER.fields_by_name["road_traffic"] -) -_COMMUTEFILTER.fields_by_name[ - "road_traffic" -].containing_oneof = _COMMUTEFILTER.oneofs_by_name["traffic_option"] -_COMMUTEFILTER.oneofs_by_name["traffic_option"].fields.append( - _COMMUTEFILTER.fields_by_name["departure_time"] -) -_COMMUTEFILTER.fields_by_name[ - "departure_time" -].containing_oneof = _COMMUTEFILTER.oneofs_by_name["traffic_option"] -_EMPLOYERFILTER.fields_by_name["mode"].enum_type = _EMPLOYERFILTER_EMPLOYERFILTERMODE -_EMPLOYERFILTER_EMPLOYERFILTERMODE.containing_type = _EMPLOYERFILTER -_EDUCATIONFILTER.fields_by_name[ - "degree_type" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._DEGREETYPE -_WORKEXPERIENCEFILTER.fields_by_name[ - "min_experience" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_WORKEXPERIENCEFILTER.fields_by_name[ - "max_experience" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_APPLICATIONDATEFILTER.fields_by_name[ - "start_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_APPLICATIONDATEFILTER.fields_by_name[ - "end_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_TIMEFILTER.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TIMEFILTER.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TIMEFILTER.fields_by_name["time_field"].enum_type = _TIMEFILTER_TIMEFIELD -_TIMEFILTER_TIMEFIELD.containing_type = _TIMEFILTER -_AVAILABILITYFILTER.fields_by_name[ - "signal_type" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._AVAILABILITYSIGNALTYPE -) -_AVAILABILITYFILTER.fields_by_name[ - "range" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._TIMESTAMPRANGE -) -DESCRIPTOR.message_types_by_name["JobQuery"] = _JOBQUERY -DESCRIPTOR.message_types_by_name["ProfileQuery"] = _PROFILEQUERY -DESCRIPTOR.message_types_by_name["LocationFilter"] = _LOCATIONFILTER -DESCRIPTOR.message_types_by_name["CompensationFilter"] = _COMPENSATIONFILTER -DESCRIPTOR.message_types_by_name["CommuteFilter"] = _COMMUTEFILTER -DESCRIPTOR.message_types_by_name["JobTitleFilter"] = _JOBTITLEFILTER -DESCRIPTOR.message_types_by_name["SkillFilter"] = _SKILLFILTER -DESCRIPTOR.message_types_by_name["EmployerFilter"] = _EMPLOYERFILTER -DESCRIPTOR.message_types_by_name["EducationFilter"] = _EDUCATIONFILTER -DESCRIPTOR.message_types_by_name["WorkExperienceFilter"] = _WORKEXPERIENCEFILTER -DESCRIPTOR.message_types_by_name["ApplicationDateFilter"] = _APPLICATIONDATEFILTER -DESCRIPTOR.message_types_by_name[ - "ApplicationOutcomeNotesFilter" -] = _APPLICATIONOUTCOMENOTESFILTER -DESCRIPTOR.message_types_by_name["ApplicationJobFilter"] = _APPLICATIONJOBFILTER -DESCRIPTOR.message_types_by_name["TimeFilter"] = _TIMEFILTER -DESCRIPTOR.message_types_by_name[ - "CandidateAvailabilityFilter" -] = _CANDIDATEAVAILABILITYFILTER -DESCRIPTOR.message_types_by_name["AvailabilityFilter"] = _AVAILABILITYFILTER -DESCRIPTOR.message_types_by_name["PersonNameFilter"] = _PERSONNAMEFILTER -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -JobQuery = _reflection.GeneratedProtocolMessageType( - "JobQuery", - (_message.Message,), - dict( - DESCRIPTOR=_JOBQUERY, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""The query required to perform a search query. - - - Attributes: - query: - The query string that matches against the job title, - description, and location fields. The maximum number of - allowed characters is 255. - query_language_code: - The language code of - [query][google.cloud.talent.v4beta1.JobQuery.query]. For - example, "en-US". This field helps to better interpret the - query. If a value isn't specified, the query language code is - automatically detected, which may not be accurate. Language - code should be in BCP-47 format, such as "en-US" or "sr-Latn". - For more information, see `Tags for Identifying Languages - `__. - companies: - This filter specifies the company entities to search against. - If a value isn't specified, jobs are searched for against all - companies. If multiple values are specified, jobs are - searched against the companies specified. The format is "proj - ects/{project\_id}/tenants/{tenant\_id}/companies/{company\_id - }". For example, "projects/foo/tenants/bar/companies/baz". If - tenant id is unspecified, the default tenant is used. For - example, "projects/foo/companies/bar". At most 20 company - filters are allowed. - location_filters: - The location filter specifies geo-regions containing the jobs - to search against. See - [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] - for more information. If a location value isn't specified, - jobs fitting the other search criteria are retrieved - regardless of where they're located. If multiple values are - specified, jobs are retrieved from any of the specified - locations. If different values are specified for the [Location - Filter.distance\_in\_miles][google.cloud.talent.v4beta1.Locati - onFilter.distance\_in\_miles] parameter, the maximum provided - distance is used for all locations. At most 5 location - filters are allowed. - job_categories: - The category filter specifies the categories of jobs to search - against. See - [JobCategory][google.cloud.talent.v4beta1.JobCategory] for - more information. If a value isn't specified, jobs from any - category are searched against. If multiple values are - specified, jobs from any of the specified categories are - searched against. - commute_filter: - Allows filtering jobs by commute time with different travel - methods (for example, driving or public transit). Note: This - only works when you specify a - [CommuteMethod][google.cloud.talent.v4beta1.CommuteMethod]. In - this case, [location\_filters][google.cloud.talent.v4beta1.Job - Query.location\_filters] is ignored. Currently we don't - support sorting by commute time. - company_display_names: - This filter specifies the exact company [Company.display\_name - ][google.cloud.talent.v4beta1.Company.display\_name] of the - jobs to search against. If a value isn't specified, jobs - within the search results are associated with any company. If - multiple values are specified, jobs within the search results - may be associated with any of the specified companies. At - most 20 company display name filters are allowed. - compensation_filter: - This search filter is applied only to [Job.compensation\_info] - [google.cloud.talent.v4beta1.Job.compensation\_info]. For - example, if the filter is specified as "Hourly job with per- - hour compensation > $15", only jobs meeting these criteria are - searched. If a filter isn't defined, all open jobs are - searched. - custom_attribute_filter: - This filter specifies a structured syntax to match against the - [Job.custom\_attributes][google.cloud.talent.v4beta1.Job.custo - m\_attributes] marked as ``filterable``. The syntax for this - expression is a subset of SQL syntax. Supported operators - are: ``=``, ``!=``, ``<``, ``<=``, ``>``, and ``>=`` where the - left of the operator is a custom field key and the right of - the operator is a number or a quoted string. You must escape - backslash (\\) and quote (") characters. Supported functions - are ``LOWER([field_name])`` to perform a case insensitive - match and ``EMPTY([field_name])`` to filter on the existence - of a key. Boolean expressions (AND/OR/NOT) are supported up - to 3 levels of nesting (for example, "((A AND B AND C) OR NOT - D) AND E"), a maximum of 100 comparisons or functions are - allowed in the expression. The expression must be < 6000 bytes - in length. Sample Query: ``(LOWER(driving_license)="class - \"a\"" OR EMPTY(driving_license)) AND driving_years > 10`` - disable_spell_check: - This flag controls the spell-check feature. If false, the - service attempts to correct a misspelled query, for example, - "enginee" is corrected to "engineer". Defaults to false: a - spell check is performed. - employment_types: - The employment type filter specifies the employment type of - jobs to search against, such as [EmploymentType.FULL\_TIME][go - ogle.cloud.talent.v4beta1.EmploymentType.FULL\_TIME]. If a - value isn't specified, jobs in the search results includes any - employment type. If multiple values are specified, jobs in - the search results include any of the specified employment - types. - language_codes: - This filter specifies the locale of jobs to search against, - for example, "en-US". If a value isn't specified, the search - results can contain jobs in any locale. Language codes should - be in BCP-47 format, such as "en-US" or "sr-Latn". For more - information, see `Tags for Identifying Languages - `__. At most 10 language - code filters are allowed. - publish_time_range: - Jobs published within a range specified by this filter are - searched against. - excluded_jobs: - This filter specifies a list of job names to be excluded - during search. At most 400 excluded job names are allowed. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.JobQuery) - ), -) -_sym_db.RegisterMessage(JobQuery) - -ProfileQuery = _reflection.GeneratedProtocolMessageType( - "ProfileQuery", - (_message.Message,), - dict( - DESCRIPTOR=_PROFILEQUERY, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filters to apply when performing the search query. - - - Attributes: - query: - Keywords to match any text fields of profiles. For example, - "software engineer in Palo Alto". - location_filters: - The location filter specifies geo-regions containing the - profiles to search against. One of [LocationFilter.address][g - oogle.cloud.talent.v4beta1.LocationFilter.address] or [Locatio - nFilter.lat\_lng][google.cloud.talent.v4beta1.LocationFilter.l - at\_lng] must be provided or an error is thrown. If both [Loca - tionFilter.address][google.cloud.talent.v4beta1.LocationFilter - .address] and [LocationFilter.lat\_lng][google.cloud.talent.v4 - beta1.LocationFilter.lat\_lng] are provided, an error is - thrown. The following logic is used to determine which - locations in the profile to filter against: 1. All of the - profile's geocoded [Profile.addresses][google.cloud.talent. - v4beta1.Profile.addresses] where - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - PERSONAL and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is true. 2. If the above set of locations is empty, all of - the profile's geocoded [Profile.addresses][google.cloud.tal - ent.v4beta1.Profile.addresses] where - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - CONTACT\_INFO\_USAGE\_UNSPECIFIED and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is true. 3. If the above set of locations is empty, all of - the profile's geocoded [Profile.addresses][google.cloud.tal - ent.v4beta1.Profile.addresses] where - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - PERSONAL or CONTACT\_INFO\_USAGE\_UNSPECIFIED and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is not set. This means that any profiles without any [Prof - ile.addresses][google.cloud.talent.v4beta1.Profile.addresses] - that match any of the above criteria will not be included in a - search with location filter. Furthermore, any [Profile.address - es][google.cloud.talent.v4beta1.Profile.addresses] where - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - WORK or SCHOOL or where - [Address.current][google.cloud.talent.v4beta1.Address.current] - is false are not considered for location filter. If a - location filter isn't specified, profiles fitting the other - search criteria are retrieved regardless of where they're - located. If [LocationFilter.negated][google.cloud.talent.v4be - ta1.LocationFilter.negated] is specified, the result doesn't - contain profiles from that location. If [LocationFilter.addre - ss][google.cloud.talent.v4beta1.LocationFilter.address] is - provided, the [LocationType][google.cloud.talent.v4beta1.Locat - ion.LocationType], center point (latitude and longitude), and - radius are automatically detected by the Google Maps Geocoding - API and included as well. If [LocationFilter.address][google.c - loud.talent.v4beta1.LocationFilter.address] cannot be - geocoded, the filter falls back to keyword search. If the - detected [LocationType][google.cloud.talent.v4beta1.Location.L - ocationType] is [LocationType.SUB\_ADMINISTRATIVE\_AREA][googl - e.cloud.talent.v4beta1.Location.LocationType.SUB\_ADMINISTRATI - VE\_AREA], [LocationType.ADMINISTRATIVE\_AREA][google.cloud.ta - lent.v4beta1.Location.LocationType.ADMINISTRATIVE\_AREA], or [ - LocationType.COUNTRY][google.cloud.talent.v4beta1.Location.Loc - ationType.COUNTRY], the filter is performed against the - detected location name (using exact text matching). Otherwise, - the filter is performed against the detected center point and - a radius of detected location radius + [LocationFilter.distanc - e\_in\_miles][google.cloud.talent.v4beta1.LocationFilter.dista - nce\_in\_miles]. If [LocationFilter.address][google.cloud.tal - ent.v4beta1.LocationFilter.address] is provided, [LocationFilt - er.distance\_in\_miles][google.cloud.talent.v4beta1.LocationFi - lter.distance\_in\_miles] is the additional radius on top of - the radius of the location geocoded from [LocationFilter.addre - ss][google.cloud.talent.v4beta1.LocationFilter.address]. If [L - ocationFilter.lat\_lng][google.cloud.talent.v4beta1.LocationFi - lter.lat\_lng] is provided, [LocationFilter.distance\_in\_mile - s][google.cloud.talent.v4beta1.LocationFilter.distance\_in\_mi - les] is the only radius that is used. [LocationFilter.distanc - e\_in\_miles][google.cloud.talent.v4beta1.LocationFilter.dista - nce\_in\_miles] is 10 by default. Note that the value of [Loca - tionFilter.distance\_in\_miles][google.cloud.talent.v4beta1.Lo - cationFilter.distance\_in\_miles] is 0 if it is unset, so the - server does not differentiate [LocationFilter.distance\_in\_mi - les][google.cloud.talent.v4beta1.LocationFilter.distance\_in\_ - miles] that is explicitly set to 0 and [LocationFilter.distanc - e\_in\_miles][google.cloud.talent.v4beta1.LocationFilter.dista - nce\_in\_miles] that is not set. Which means that if [Location - Filter.distance\_in\_miles][google.cloud.talent.v4beta1.Locati - onFilter.distance\_in\_miles] is explicitly set to 0, the - server will use the default value of [LocationFilter.distance\ - _in\_miles][google.cloud.talent.v4beta1.LocationFilter.distanc - e\_in\_miles] which is 10. To work around this and effectively - set [LocationFilter.distance\_in\_miles][google.cloud.talent.v - 4beta1.LocationFilter.distance\_in\_miles] to 0, we recommend - setting [LocationFilter.distance\_in\_miles][google.cloud.tale - nt.v4beta1.LocationFilter.distance\_in\_miles] to a very small - decimal number (such as 0.00001). If [LocationFilter.distance - \_in\_miles][google.cloud.talent.v4beta1.LocationFilter.distan - ce\_in\_miles] is negative, an error is thrown. - job_title_filters: - Job title filter specifies job titles of profiles to match on. - If a job title isn't specified, profiles with any titles are - retrieved. If multiple values are specified, profiles are - retrieved with any of the specified job titles. If [JobTitleF - ilter.negated][google.cloud.talent.v4beta1.JobTitleFilter.nega - ted] is specified, the result won't contain profiles with the - job titles. For example, search for profiles with a job title - "Product Manager". - employer_filters: - Employer filter specifies employers of profiles to match on. - If an employer filter isn't specified, profiles with any - employers are retrieved. If multiple employer filters are - specified, profiles with any matching employers are retrieved. - If [EmployerFilter.negated][google.cloud.talent.v4beta1.Employ - erFilter.negated] is specified, the result won't contain - profiles that match the employers. For example, search for - profiles that have working experience at "Google LLC". - education_filters: - Education filter specifies education of profiles to match on. - If an education filter isn't specified, profiles with any - education are retrieved. If multiple education filters are - specified, profiles that match any education filters are - retrieved. If [EducationFilter.negated][google.cloud.talent.v - 4beta1.EducationFilter.negated] is specified, the result won't - contain profiles that match the educations. For example, - search for profiles with a master degree. - skill_filters: - Skill filter specifies skill of profiles to match on. If a - skill filter isn't specified, profiles with any skills are - retrieved. If multiple skill filters are specified, profiles - that match any skill filters are retrieved. If [SkillFilter.n - egated][google.cloud.talent.v4beta1.SkillFilter.negated] is - specified, the result won't contain profiles that match the - skills. For example, search for profiles that have "Java" and - "Python" in skill list. - work_experience_filter: - Work experience filter specifies the total working experience - of profiles to match on. If a work experience filter isn't - specified, profiles with any professional experience are - retrieved. If multiple work experience filters are specified, - profiles that match any work experience filters are retrieved. - For example, search for profiles with 10 years of work - experience. - time_filters: - Time filter specifies the create/update timestamp of the - profiles to match on. For example, search for profiles - created since "2018-1-1". - hirable_filter: - The hirable filter specifies the profile's hirable status to - match on. - application_date_filters: - The application date filters specify application date ranges - to match on. - application_outcome_notes_filters: - The application outcome notes filters specify the notes for - the outcome of the job application. - application_job_filters: - The application job filters specify the job applied for in the - application. - custom_attribute_filter: - This filter specifies a structured syntax to match against the - [Profile.custom\_attributes][google.cloud.talent.v4beta1.Profi - le.custom\_attributes] that are marked as ``filterable``. The - syntax for this expression is a subset of Google SQL syntax. - String custom attributes: supported operators are =, != where - the left of the operator is a custom field key and the right - of the operator is a string (surrounded by quotes) value. - Numeric custom attributes: Supported operators are '>', '<' or - '=' operators where the left of the operator is a custom field - key and the right of the operator is a numeric value. - Supported functions are LOWER() to perform case insensitive - match and EMPTY() to filter on the existence of a key. - Boolean expressions (AND/OR/NOT) are supported up to 3 levels - of nesting (for example "((A AND B AND C) OR NOT D) AND E"), - and there can be a maximum of 50 comparisons/functions in the - expression. The expression must be < 2000 characters in - length. Sample Query: (key1 = "TEST" OR LOWER(key1)="test" OR - NOT EMPTY(key1)) - candidate_availability_filter: - Deprecated. Use availability\_filters instead. The candidate - availability filter which filters based on availability - signals. Signal 1: Number of days since most recent job - application. See [Availability.JobApplicationAvailabilitySigna - l][google.cloud.talent.v4beta1.Availability.JobApplicationAvai - labilitySignal] for the details of this signal. Signal 2: - Number of days since last profile update. See [Availability.Pr - ofileUpdateAvailabilitySignal][google.cloud.talent.v4beta1.Ava - ilability.ProfileUpdateAvailabilitySignal] for the details of - this signal. The candidate availability filter helps a - recruiter understand if a specific candidate is likely to be - actively seeking new job opportunities based on an aggregated - set of signals. Specifically, the intent is NOT to indicate - the candidate's potential qualification / interest / close - ability for a specific job. - availability_filters: - The availability filter which filters based on [Profile.availa - bility\_signals][google.cloud.talent.v4beta1.Profile.availabil - ity\_signals]. The availability filter helps a recruiter - understand if a specific candidate is likely to be actively - seeking new job opportunities based on an aggregated set of - signals. Specifically, the intent is NOT to indicate the - candidate's potential qualification / interest / close ability - for a specific job. There can be at most one [AvailabilityFil - ter][google.cloud.talent.v4beta1.AvailabilityFilter] per [sign - al\_type][google.cloud.talent.v4beta1.AvailabilityFilter.signa - l\_type]. If there are multiple [AvailabilityFilter][google.cl - oud.talent.v4beta1.AvailabilityFilter] for a [signal\_type][go - ogle.cloud.talent.v4beta1.AvailabilityFilter.signal\_type], an - error is thrown. - person_name_filters: - Person name filter specifies person name of profiles to match - on. If multiple person name filters are specified, profiles - that match any person name filters are retrieved. For - example, search for profiles of candidates with name "John - Smith". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ProfileQuery) - ), -) -_sym_db.RegisterMessage(ProfileQuery) - -LocationFilter = _reflection.GeneratedProtocolMessageType( - "LocationFilter", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Geographic region of the search. - - - Attributes: - address: - The address name, such as "Mountain View" or "Bay Area". - region_code: - CLDR region code of the country/region of the address. This is - used to address ambiguity of the user-input location, for - example, "Liverpool" against "Liverpool, NY, US" or - "Liverpool, UK". Set this field to bias location resolution - toward a specific country or territory. If this field is not - set, application behavior is biased toward the United States - by default. See https://cldr.unicode.org/ and https://www.uni - code.org/cldr/charts/30/supplemental/territory\_information.ht - ml for details. Example: "CH" for Switzerland. Note that this - filter is not applicable for Profile Search related queries. - lat_lng: - The latitude and longitude of the geographic center to search - from. This field is ignored if ``address`` is provided. - distance_in_miles: - The distance\_in\_miles is applied when the location being - searched for is identified as a city or smaller. This field is - ignored if the location being searched for is a state or - larger. - telecommute_preference: - Allows the client to return jobs without a set location, - specifically, telecommuting jobs (telecommuting is considered - by the service as a special location. [Job.posting\_region][go - ogle.cloud.talent.v4beta1.Job.posting\_region] indicates if a - job permits telecommuting. If this field is set to [Telecommut - ePreference.TELECOMMUTE\_ALLOWED][google.cloud.talent.v4beta1. - LocationFilter.TelecommutePreference.TELECOMMUTE\_ALLOWED], - telecommuting jobs are searched, and - [address][google.cloud.talent.v4beta1.LocationFilter.address] - and [lat\_lng][google.cloud.talent.v4beta1.LocationFilter.lat\ - _lng] are ignored. If not set or set to [TelecommutePreference - .TELECOMMUTE\_EXCLUDED][google.cloud.talent.v4beta1.LocationFi - lter.TelecommutePreference.TELECOMMUTE\_EXCLUDED], telecommute - job are not searched. This filter can be used by itself to - search exclusively for telecommuting jobs, or it can be - combined with another location filter to search for a - combination of job locations, such as "Mountain View" or - "telecommuting" jobs. However, when used in combination with - other location filters, telecommuting jobs can be treated as - less relevant than other jobs in the search response. This - field is only used for job search requests. - negated: - Whether to apply negation to the filter so profiles matching - the filter are excluded. Currently only supported in profile - search. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.LocationFilter) - ), -) -_sym_db.RegisterMessage(LocationFilter) - -CompensationFilter = _reflection.GeneratedProtocolMessageType( - "CompensationFilter", - (_message.Message,), - dict( - DESCRIPTOR=_COMPENSATIONFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filter on job compensation type and amount. - - - Attributes: - type: - Required. Type of filter. - units: - Required. Specify desired ``base compensation entry's`` [Compe - nsationInfo.CompensationUnit][google.cloud.talent.v4beta1.Comp - ensationInfo.CompensationUnit]. - range: - Compensation range. - include_jobs_with_unspecified_compensation_range: - If set to true, jobs with unspecified compensation range - fields are included. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CompensationFilter) - ), -) -_sym_db.RegisterMessage(CompensationFilter) - -CommuteFilter = _reflection.GeneratedProtocolMessageType( - "CommuteFilter", - (_message.Message,), - dict( - DESCRIPTOR=_COMMUTEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Parameters needed for commute search. - - - Attributes: - commute_method: - Required. The method of transportation to calculate the - commute time for. - start_coordinates: - Required. The latitude and longitude of the location to - calculate the commute time from. - travel_duration: - Required. The maximum travel time in seconds. The maximum - allowed value is ``3600s`` (one hour). Format is ``123s``. - allow_imprecise_addresses: - If ``true``, jobs without street level addresses may also be - returned. For city level addresses, the city center is used. - For state and coarser level addresses, text matching is used. - If this field is set to ``false`` or isn't specified, only - jobs that include street level addresses will be returned by - commute search. - traffic_option: - Traffic factor to take into account while searching by - commute. - road_traffic: - Specifies the traffic density to use when calculating commute - time. - departure_time: - The departure time used to calculate traffic impact, - represented as [google.type.TimeOfDay][google.type.TimeOfDay] - in local time zone. Currently traffic model is restricted to - hour level resolution. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CommuteFilter) - ), -) -_sym_db.RegisterMessage(CommuteFilter) - -JobTitleFilter = _reflection.GeneratedProtocolMessageType( - "JobTitleFilter", - (_message.Message,), - dict( - DESCRIPTOR=_JOBTITLEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Job title of the search. - - - Attributes: - job_title: - Required. The job title. For example, "Software engineer", or - "Product manager". - negated: - Whether to apply negation to the filter so profiles matching - the filter are excluded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.JobTitleFilter) - ), -) -_sym_db.RegisterMessage(JobTitleFilter) - -SkillFilter = _reflection.GeneratedProtocolMessageType( - "SkillFilter", - (_message.Message,), - dict( - DESCRIPTOR=_SKILLFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Skill filter of the search. - - - Attributes: - skill: - Required. The skill name. For example, "java", "j2ee", and so - on. - negated: - Whether to apply negation to the filter so profiles matching - the filter are excluded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SkillFilter) - ), -) -_sym_db.RegisterMessage(SkillFilter) - -EmployerFilter = _reflection.GeneratedProtocolMessageType( - "EmployerFilter", - (_message.Message,), - dict( - DESCRIPTOR=_EMPLOYERFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Employer filter of the search. - - - Attributes: - employer: - Required. The name of the employer, for example "Google", - "Alphabet". - mode: - Define set of [EmploymentRecord][google.cloud.talent.v4beta1.E - mploymentRecord]s to search against. Defaults to [EmployerFil - terMode.ALL\_EMPLOYMENT\_RECORDS][google.cloud.talent.v4beta1. - EmployerFilter.EmployerFilterMode.ALL\_EMPLOYMENT\_RECORDS]. - negated: - Whether to apply negation to the filter so profiles matching - the filter is excluded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.EmployerFilter) - ), -) -_sym_db.RegisterMessage(EmployerFilter) - -EducationFilter = _reflection.GeneratedProtocolMessageType( - "EducationFilter", - (_message.Message,), - dict( - DESCRIPTOR=_EDUCATIONFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Education filter of the search. - - - Attributes: - school: - The school name. For example "MIT", "University of California, - Berkeley". - field_of_study: - The field of study. This is to search against value provided - in [Degree.fields\_of\_study][google.cloud.talent.v4beta1.Degr - ee.fields\_of\_study]. For example "Computer Science", - "Mathematics". - degree_type: - Education degree in ISCED code. Each value in degree covers a - specific level of education, without any expansion to upper - nor lower levels of education degree. - negated: - Whether to apply negation to the filter so profiles matching - the filter is excluded. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.EducationFilter) - ), -) -_sym_db.RegisterMessage(EducationFilter) - -WorkExperienceFilter = _reflection.GeneratedProtocolMessageType( - "WorkExperienceFilter", - (_message.Message,), - dict( - DESCRIPTOR=_WORKEXPERIENCEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Work experience filter. - - This filter is used to search for profiles with working experience - length between - [min\_experience][google.cloud.talent.v4beta1.WorkExperienceFilter.min\_experience] - and - [max\_experience][google.cloud.talent.v4beta1.WorkExperienceFilter.max\_experience]. - - - Attributes: - min_experience: - The minimum duration of the work experience (inclusive). - max_experience: - The maximum duration of the work experience (exclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.WorkExperienceFilter) - ), -) -_sym_db.RegisterMessage(WorkExperienceFilter) - -ApplicationDateFilter = _reflection.GeneratedProtocolMessageType( - "ApplicationDateFilter", - (_message.Message,), - dict( - DESCRIPTOR=_APPLICATIONDATEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Application Date Range Filter. - - The API matches profiles with - [Application.application\_date][google.cloud.talent.v4beta1.Application.application\_date] - between start date and end date (both boundaries are inclusive). The - filter is ignored if both - [start\_date][google.cloud.talent.v4beta1.ApplicationDateFilter.start\_date] - and - [end\_date][google.cloud.talent.v4beta1.ApplicationDateFilter.end\_date] - are missing. - - - Attributes: - start_date: - Start date. If it's missing, The API matches profiles with - application date not after the end date. - end_date: - End date. If it's missing, The API matches profiles with - application date not before the start date. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ApplicationDateFilter) - ), -) -_sym_db.RegisterMessage(ApplicationDateFilter) - -ApplicationOutcomeNotesFilter = _reflection.GeneratedProtocolMessageType( - "ApplicationOutcomeNotesFilter", - (_message.Message,), - dict( - DESCRIPTOR=_APPLICATIONOUTCOMENOTESFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Outcome Notes Filter. - - - Attributes: - outcome_notes: - Required. User entered or selected outcome reason. The API - does an exact match on the [Application.outcome\_notes][google - .cloud.talent.v4beta1.Application.outcome\_notes] in profiles. - negated: - If true, The API excludes all candidates with any [Application - .outcome\_notes][google.cloud.talent.v4beta1.Application.outco - me\_notes] matching the outcome reason specified in the - filter. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter) - ), -) -_sym_db.RegisterMessage(ApplicationOutcomeNotesFilter) - -ApplicationJobFilter = _reflection.GeneratedProtocolMessageType( - "ApplicationJobFilter", - (_message.Message,), - dict( - DESCRIPTOR=_APPLICATIONJOBFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filter on the job information of Application. - - - Attributes: - job_requisition_id: - The job requisition id in the application. The API does an - exact match on the [Job.requisition\_id][google.cloud.talent.v - 4beta1.Job.requisition\_id] of - [Application.job][google.cloud.talent.v4beta1.Application.job] - in profiles. - job_title: - The job title in the application. The API does an exact match - on the [Job.title][google.cloud.talent.v4beta1.Job.title] of - [Application.job][google.cloud.talent.v4beta1.Application.job] - in profiles. - negated: - If true, the API excludes all profiles with any - [Application.job][google.cloud.talent.v4beta1.Application.job] - matching the filters. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ApplicationJobFilter) - ), -) -_sym_db.RegisterMessage(ApplicationJobFilter) - -TimeFilter = _reflection.GeneratedProtocolMessageType( - "TimeFilter", - (_message.Message,), - dict( - DESCRIPTOR=_TIMEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filter on create timestamp or update timestamp of - profiles. - - - Attributes: - start_time: - Start timestamp, matching profiles with the start time. If - this field missing, The API matches profiles with create / - update timestamp before the end timestamp. - end_time: - End timestamp, matching profiles with the end time. If this - field missing, The API matches profiles with create / update - timestamp after the start timestamp. - time_field: - Specifies which time field to filter profiles. Defaults to [T - imeField.CREATE\_TIME][google.cloud.talent.v4beta1.TimeFilter. - TimeField.CREATE\_TIME]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.TimeFilter) - ), -) -_sym_db.RegisterMessage(TimeFilter) - -CandidateAvailabilityFilter = _reflection.GeneratedProtocolMessageType( - "CandidateAvailabilityFilter", - (_message.Message,), - dict( - DESCRIPTOR=_CANDIDATEAVAILABILITYFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Deprecated. Use AvailabilityFilter instead. - - Filter on availability signals. - - - Attributes: - negated: - It is false by default. If true, API excludes all the - potential available profiles. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CandidateAvailabilityFilter) - ), -) -_sym_db.RegisterMessage(CandidateAvailabilityFilter) - -AvailabilityFilter = _reflection.GeneratedProtocolMessageType( - "AvailabilityFilter", - (_message.Message,), - dict( - DESCRIPTOR=_AVAILABILITYFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filter on availability signals. - - - Attributes: - signal_type: - Required. Type of signal to apply filter on. - range: - Required. Range of times to filter candidate signals by. - required: - If multiple [AvailabilityFilter][google.cloud.talent.v4beta1.A - vailabilityFilter] are provided, the default behavior is to OR - all filters, but if this field is set to true, this particular - [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityF - ilter] will be AND'ed against other [AvailabilityFilter][googl - e.cloud.talent.v4beta1.AvailabilityFilter]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.AvailabilityFilter) - ), -) -_sym_db.RegisterMessage(AvailabilityFilter) - -PersonNameFilter = _reflection.GeneratedProtocolMessageType( - "PersonNameFilter", - (_message.Message,), - dict( - DESCRIPTOR=_PERSONNAMEFILTER, - __module__="google.cloud.talent_v4beta1.proto.filters_pb2", - __doc__="""Filter on person name. - - - Attributes: - person_name: - Required. The person name. For example, "John Smith". Can be - any combination of - [PersonName.structured\_name.given\_name][], - [PersonName.structured\_name.middle\_initial][], - [PersonName.structured\_name.family\_name][], and [PersonName. - formatted\_name][google.cloud.talent.v4beta1.PersonName.format - ted\_name]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.PersonNameFilter) - ), -) -_sym_db.RegisterMessage(PersonNameFilter) - - -DESCRIPTOR._options = None -_PROFILEQUERY.fields_by_name["candidate_availability_filter"]._options = None -_COMPENSATIONFILTER.fields_by_name["type"]._options = None -_COMPENSATIONFILTER.fields_by_name["units"]._options = None -_COMMUTEFILTER.fields_by_name["commute_method"]._options = None -_COMMUTEFILTER.fields_by_name["start_coordinates"]._options = None -_COMMUTEFILTER.fields_by_name["travel_duration"]._options = None -_JOBTITLEFILTER.fields_by_name["job_title"]._options = None -_SKILLFILTER.fields_by_name["skill"]._options = None -_EMPLOYERFILTER.fields_by_name["employer"]._options = None -_APPLICATIONOUTCOMENOTESFILTER.fields_by_name["outcome_notes"]._options = None -_CANDIDATEAVAILABILITYFILTER._options = None -_AVAILABILITYFILTER.fields_by_name["signal_type"]._options = None -_AVAILABILITYFILTER.fields_by_name["range"]._options = None -_PERSONNAMEFILTER.fields_by_name["person_name"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/filters_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/filters_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/filters_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/histogram.proto b/talent/google/cloud/talent_v4beta1/proto/histogram.proto deleted file mode 100644 index 467f83452127..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/histogram.proto +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "HistogramProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// The histogram request. -message HistogramQuery { - // An expression specifies a histogram request against matching resources - // (for example, jobs, profiles) for searches. - // - // See [SearchJobsRequest.histogram_queries][google.cloud.talent.v4beta1.SearchJobsRequest.histogram_queries] and - // [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries] for details about syntax. - string histogram_query = 1; -} - -// Histogram result that matches [HistogramQuery][google.cloud.talent.v4beta1.HistogramQuery] specified in searches. -message HistogramQueryResult { - // Requested histogram expression. - string histogram_query = 1; - - // A map from the values of the facet associated with distinct values to the - // number of matching entries with corresponding value. - // - // The key format is: - // - // * (for string histogram) string values stored in the field. - // * (for named numeric bucket) name specified in `bucket()` function, like - // for `bucket(0, MAX, "non-negative")`, the key will be `non-negative`. - // * (for anonymous numeric bucket) range formatted as `-`, for - // example, `0-1000`, `MIN-0`, and `0-MAX`. - map histogram = 2; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/histogram_pb2.py b/talent/google/cloud/talent_v4beta1/proto/histogram_pb2.py deleted file mode 100644 index bf7d13858599..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/histogram_pb2.py +++ /dev/null @@ -1,260 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/histogram.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/histogram.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\016HistogramProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n1google/cloud/talent_v4beta1/proto/histogram.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto")\n\x0eHistogramQuery\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t"\xb6\x01\n\x14HistogramQueryResult\x12\x17\n\x0fhistogram_query\x18\x01 \x01(\t\x12S\n\thistogram\x18\x02 \x03(\x0b\x32@.google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry\x1a\x30\n\x0eHistogramEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\x03:\x02\x38\x01\x42|\n\x1f\x63om.google.cloud.talent.v4beta1B\x0eHistogramProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_HISTOGRAMQUERY = _descriptor.Descriptor( - name="HistogramQuery", - full_name="google.cloud.talent.v4beta1.HistogramQuery", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="histogram_query", - full_name="google.cloud.talent.v4beta1.HistogramQuery.histogram_query", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=112, - serialized_end=153, -) - - -_HISTOGRAMQUERYRESULT_HISTOGRAMENTRY = _descriptor.Descriptor( - name="HistogramEntry", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry.value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=290, - serialized_end=338, -) - -_HISTOGRAMQUERYRESULT = _descriptor.Descriptor( - name="HistogramQueryResult", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="histogram_query", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult.histogram_query", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram", - full_name="google.cloud.talent.v4beta1.HistogramQueryResult.histogram", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_HISTOGRAMQUERYRESULT_HISTOGRAMENTRY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=156, - serialized_end=338, -) - -_HISTOGRAMQUERYRESULT_HISTOGRAMENTRY.containing_type = _HISTOGRAMQUERYRESULT -_HISTOGRAMQUERYRESULT.fields_by_name[ - "histogram" -].message_type = _HISTOGRAMQUERYRESULT_HISTOGRAMENTRY -DESCRIPTOR.message_types_by_name["HistogramQuery"] = _HISTOGRAMQUERY -DESCRIPTOR.message_types_by_name["HistogramQueryResult"] = _HISTOGRAMQUERYRESULT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -HistogramQuery = _reflection.GeneratedProtocolMessageType( - "HistogramQuery", - (_message.Message,), - dict( - DESCRIPTOR=_HISTOGRAMQUERY, - __module__="google.cloud.talent_v4beta1.proto.histogram_pb2", - __doc__="""The histogram request. - - - Attributes: - histogram_query: - An expression specifies a histogram request against matching - resources (for example, jobs, profiles) for searches. See [Se - archJobsRequest.histogram\_queries][google.cloud.talent.v4beta - 1.SearchJobsRequest.histogram\_queries] and [SearchProfilesReq - uest.histogram\_queries][google.cloud.talent.v4beta1.SearchPro - filesRequest.histogram\_queries] for details about syntax. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.HistogramQuery) - ), -) -_sym_db.RegisterMessage(HistogramQuery) - -HistogramQueryResult = _reflection.GeneratedProtocolMessageType( - "HistogramQueryResult", - (_message.Message,), - dict( - HistogramEntry=_reflection.GeneratedProtocolMessageType( - "HistogramEntry", - (_message.Message,), - dict( - DESCRIPTOR=_HISTOGRAMQUERYRESULT_HISTOGRAMENTRY, - __module__="google.cloud.talent_v4beta1.proto.histogram_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.HistogramQueryResult.HistogramEntry) - ), - ), - DESCRIPTOR=_HISTOGRAMQUERYRESULT, - __module__="google.cloud.talent_v4beta1.proto.histogram_pb2", - __doc__="""Histogram result that matches - [HistogramQuery][google.cloud.talent.v4beta1.HistogramQuery] specified - in searches. - - - Attributes: - histogram_query: - Requested histogram expression. - histogram: - A map from the values of the facet associated with distinct - values to the number of matching entries with corresponding - value. The key format is: - (for string histogram) string - values stored in the field. - (for named numeric bucket) name - specified in ``bucket()`` function, like for ``bucket(0, - MAX, "non-negative")``, the key will be ``non-negative``. - - (for anonymous numeric bucket) range formatted as - ``-``, for example, ``0-1000``, ``MIN-0``, and - ``0-MAX``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.HistogramQueryResult) - ), -) -_sym_db.RegisterMessage(HistogramQueryResult) -_sym_db.RegisterMessage(HistogramQueryResult.HistogramEntry) - - -DESCRIPTOR._options = None -_HISTOGRAMQUERYRESULT_HISTOGRAMENTRY._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/histogram_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/histogram_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/histogram_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/job.proto b/talent/google/cloud/talent_v4beta1/proto/job.proto deleted file mode 100644 index 3746fa866ed7..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job.proto +++ /dev/null @@ -1,351 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/postal_address.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "JobResourceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A Job resource represents a job posting (also referred to as a "job listing" -// or "job requisition"). A job belongs to a [Company][google.cloud.talent.v4beta1.Company], which is the hiring -// entity responsible for the job. -message Job { - option (google.api.resource) = { - type: "jobs.googleapis.com/Job" - pattern: "projects/{project}/jobs/{job}" - pattern: "projects/{project}/tenants/{tenant}/jobs/{job}" - }; - - // Application related details of a job posting. - message ApplicationInfo { - // Use this field to specify email address(es) to which resumes or - // applications can be sent. - // - // The maximum number of allowed characters for each entry is 255. - repeated string emails = 1; - - // Use this field to provide instructions, such as "Mail your application - // to ...", that a candidate can follow to apply for the job. - // - // This field accepts and sanitizes HTML input, and also accepts - // bold, italic, ordered list, and unordered list markup tags. - // - // The maximum number of allowed characters is 3,000. - string instruction = 2; - - // Use this URI field to direct an applicant to a website, for example to - // link to an online application form. - // - // The maximum number of allowed characters for each entry is 2,000. - repeated string uris = 3; - } - - // Derived details about the job posting. - message DerivedInfo { - // Structured locations of the job, resolved from [Job.addresses][google.cloud.talent.v4beta1.Job.addresses]. - // - // [locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations] are exactly matched to [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] in the same - // order. - repeated Location locations = 1; - - // Job categories derived from [Job.title][google.cloud.talent.v4beta1.Job.title] and [Job.description][google.cloud.talent.v4beta1.Job.description]. - repeated JobCategory job_categories = 3; - } - - // Options for job processing. - message ProcessingOptions { - // If set to `true`, the service does not attempt to resolve a - // more precise address for the job. - bool disable_street_address_resolution = 1; - - // Option for job HTML content sanitization. Applied fields are: - // - // * description - // * applicationInfo.instruction - // * incentives - // * qualifications - // * responsibilities - // - // HTML tags in these fields may be stripped if sanitiazation isn't - // disabled. - // - // Defaults to [HtmlSanitization.SIMPLE_FORMATTING_ONLY][google.cloud.talent.v4beta1.HtmlSanitization.SIMPLE_FORMATTING_ONLY]. - HtmlSanitization html_sanitization = 2; - } - - // Required during job update. - // - // The resource name for the job. This is generated by the service when a - // job is created. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For - // example, "projects/foo/tenants/bar/jobs/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/jobs/bar". - // - // Use of this field in job queries and API calls is preferred over the use of - // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] since this value is unique. - string name = 1; - - // Required. The resource name of the company listing the job. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/companies/{company_id}". For - // example, "projects/foo/tenants/bar/companies/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/companies/bar". - string company = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Company" - } - ]; - - // Required. The requisition ID, also referred to as the posting ID, is assigned by the - // client to identify a job. This field is intended to be used by clients - // for client identification and tracking of postings. A job isn't allowed - // to be created if there is another job with the same [company][google.cloud.talent.v4beta1.Job.name], - // [language_code][google.cloud.talent.v4beta1.Job.language_code] and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]. - // - // The maximum number of allowed characters is 255. - string requisition_id = 3 [(google.api.field_behavior) = REQUIRED]; - - // Required. The title of the job, such as "Software Engineer" - // - // The maximum number of allowed characters is 500. - string title = 4 [(google.api.field_behavior) = REQUIRED]; - - // Required. The description of the job, which typically includes a multi-paragraph - // description of the company and related information. Separate fields are - // provided on the job object for [responsibilities][google.cloud.talent.v4beta1.Job.responsibilities], - // [qualifications][google.cloud.talent.v4beta1.Job.qualifications], and other job characteristics. Use of - // these separate job fields is recommended. - // - // This field accepts and sanitizes HTML input, and also accepts - // bold, italic, ordered list, and unordered list markup tags. - // - // The maximum number of allowed characters is 100,000. - string description = 5 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. - // - // Location(s) where the employer is looking to hire for this job posting. - // - // Specifying the full street address(es) of the hiring location enables - // better API results, especially job searches by commute time. - // - // At most 50 locations are allowed for best search performance. If a job has - // more locations, it is suggested to split it into multiple jobs with unique - // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]s (e.g. 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as - // multiple jobs with the same [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] and - // [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] are not allowed. If the original [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id] must - // be preserved, a custom field should be used for storage. It is also - // suggested to group the locations that close to each other in the same job - // for better search experience. - // - // The maximum number of allowed characters is 500. - repeated string addresses = 6; - - // Job application information. - ApplicationInfo application_info = 7; - - // The benefits included with the job. - repeated JobBenefit job_benefits = 8; - - // Job compensation information (a.k.a. "pay rate") i.e., the compensation - // that will paid to the employee. - CompensationInfo compensation_info = 9; - - // A map of fields to hold both filterable and non-filterable custom job - // attributes that are not covered by the provided structured fields. - // - // The keys of the map are strings up to 64 bytes and must match the - // pattern: [a-zA-Z][a-zA-Z0-9_]*. For example, key0LikeThis or - // KEY_1_LIKE_THIS. - // - // At most 100 filterable and at most 100 unfilterable keys are supported. - // For filterable `string_values`, across all keys at most 200 values are - // allowed, with each string no more than 255 characters. For unfilterable - // `string_values`, the maximum total size of `string_values` across all keys - // is 50KB. - map custom_attributes = 10; - - // The desired education degrees for the job, such as Bachelors, Masters. - repeated DegreeType degree_types = 11; - - // The department or functional area within the company with the open - // position. - // - // The maximum number of allowed characters is 255. - string department = 12; - - // The employment type(s) of a job, for example, - // [full time][google.cloud.talent.v4beta1.EmploymentType.FULL_TIME] or - // [part time][google.cloud.talent.v4beta1.EmploymentType.PART_TIME]. - repeated EmploymentType employment_types = 13; - - // A description of bonus, commission, and other compensation - // incentives associated with the job not including salary or pay. - // - // The maximum number of allowed characters is 10,000. - string incentives = 14; - - // The language of the posting. This field is distinct from - // any requirements for fluency that are associated with the job. - // - // Language codes must be in BCP-47 format, such as "en-US" or "sr-Latn". - // For more information, see - // [Tags for Identifying Languages](https://tools.ietf.org/html/bcp47){: - // class="external" target="_blank" }. - // - // If this field is unspecified and [Job.description][google.cloud.talent.v4beta1.Job.description] is present, detected - // language code based on [Job.description][google.cloud.talent.v4beta1.Job.description] is assigned, otherwise - // defaults to 'en_US'. - string language_code = 15; - - // The experience level associated with the job, such as "Entry Level". - JobLevel job_level = 16; - - // A promotion value of the job, as determined by the client. - // The value determines the sort order of the jobs returned when searching for - // jobs using the featured jobs search call, with higher promotional values - // being returned first and ties being resolved by relevance sort. Only the - // jobs with a promotionValue >0 are returned in a FEATURED_JOB_SEARCH. - // - // Default value is 0, and negative values are treated as 0. - int32 promotion_value = 17; - - // A description of the qualifications required to perform the - // job. The use of this field is recommended - // as an alternative to using the more general [description][google.cloud.talent.v4beta1.Job.description] field. - // - // This field accepts and sanitizes HTML input, and also accepts - // bold, italic, ordered list, and unordered list markup tags. - // - // The maximum number of allowed characters is 10,000. - string qualifications = 18; - - // A description of job responsibilities. The use of this field is - // recommended as an alternative to using the more general [description][google.cloud.talent.v4beta1.Job.description] - // field. - // - // This field accepts and sanitizes HTML input, and also accepts - // bold, italic, ordered list, and unordered list markup tags. - // - // The maximum number of allowed characters is 10,000. - string responsibilities = 19; - - // The job [PostingRegion][google.cloud.talent.v4beta1.PostingRegion] (for example, state, country) throughout - // which the job is available. If this field is set, a [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] - // in a search query within the job region finds this job posting if an - // exact location match isn't specified. If this field is set to - // [PostingRegion.NATION][google.cloud.talent.v4beta1.PostingRegion.NATION] or [PostingRegion.ADMINISTRATIVE_AREA][google.cloud.talent.v4beta1.PostingRegion.ADMINISTRATIVE_AREA], - // setting job [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] to the same location level as this field - // is strongly recommended. - PostingRegion posting_region = 20; - - // Deprecated. The job is only visible to the owner. - // - // The visibility of the job. - // - // Defaults to [Visibility.ACCOUNT_ONLY][google.cloud.talent.v4beta1.Visibility.ACCOUNT_ONLY] if not specified. - Visibility visibility = 21 [deprecated = true]; - - // The start timestamp of the job in UTC time zone. Typically this field - // is used for contracting engagements. Invalid timestamps are ignored. - google.protobuf.Timestamp job_start_time = 22; - - // The end timestamp of the job. Typically this field is used for contracting - // engagements. Invalid timestamps are ignored. - google.protobuf.Timestamp job_end_time = 23; - - // The timestamp this job posting was most recently published. The default - // value is the time the request arrives at the server. Invalid timestamps are - // ignored. - google.protobuf.Timestamp posting_publish_time = 24; - - // Strongly recommended for the best service experience. - // - // The expiration timestamp of the job. After this timestamp, the - // job is marked as expired, and it no longer appears in search results. The - // expired job can't be listed by the [ListJobs][google.cloud.talent.v4beta1.JobService.ListJobs] API, - // but it can be retrieved with the [GetJob][google.cloud.talent.v4beta1.JobService.GetJob] API or - // updated with the [UpdateJob][google.cloud.talent.v4beta1.JobService.UpdateJob] API or deleted with - // the [DeleteJob][google.cloud.talent.v4beta1.JobService.DeleteJob] API. An expired job can - // be updated and opened again by using a future expiration timestamp. - // Updating an expired job fails if there is another existing open job with - // same [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id]. - // - // The expired jobs are retained in our system for 90 days. However, the - // overall expired job count cannot exceed 3 times the maximum number of - // open jobs over previous 7 days. If this threshold is exceeded, - // expired jobs are cleaned out in order of earliest expire time. - // Expired jobs are no longer accessible after they are cleaned - // out. - // - // Invalid timestamps are ignored, and treated as expire time not provided. - // - // If the timestamp is before the instant request is made, the job - // is treated as expired immediately on creation. This kind of job can - // not be updated. And when creating a job with past timestamp, the - // [posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] must be set before - // [posting_expire_time][google.cloud.talent.v4beta1.Job.posting_expire_time]. The purpose of this feature is - // to allow other objects, such as [Application][google.cloud.talent.v4beta1.Application], to refer a job - // that didn't exist in the system prior to becoming expired. If you - // want to modify a job that was expired on creation, - // delete it and create a new one. - // - // If this value isn't provided at the time of job creation or is invalid, - // the job posting expires after 30 days from the job's creation time. For - // example, if the job was created on 2017/01/01 13:00AM UTC with an - // unspecified expiration date, the job expires after 2017/01/31 13:00AM UTC. - // - // If this value isn't provided on job update, it depends on the field masks - // set by [UpdateJobRequest.update_mask][google.cloud.talent.v4beta1.UpdateJobRequest.update_mask]. If the field masks include - // [job_end_time][google.cloud.talent.v4beta1.Job.job_end_time], or the masks are empty meaning that every field is - // updated, the job posting expires after 30 days from the job's last - // update time. Otherwise the expiration date isn't updated. - google.protobuf.Timestamp posting_expire_time = 25; - - // Output only. The timestamp when this job posting was created. - google.protobuf.Timestamp posting_create_time = 26 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The timestamp when this job posting was last updated. - google.protobuf.Timestamp posting_update_time = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Display name of the company listing the job. - string company_display_name = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Derived details about the job posting. - DerivedInfo derived_info = 29 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Options for job processing. - ProcessingOptions processing_options = 30; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/job_pb2.py b/talent/google/cloud/talent_v4beta1/proto/job_pb2.py deleted file mode 100644 index 5c06289e1d78..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job_pb2.py +++ /dev/null @@ -1,1282 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/job.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.type import postal_address_pb2 as google_dot_type_dot_postal__address__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/job.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\020JobResourceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - "\n+google/cloud/talent_v4beta1/proto/job.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a google/type/postal_address.proto\x1a\x1cgoogle/api/annotations.proto\"\xe0\x0f\n\x03Job\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x34\n\x07\x63ompany\x18\x02 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Company\x12\x1b\n\x0erequisition_id\x18\x03 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\x05title\x18\x04 \x01(\tB\x03\xe0\x41\x02\x12\x18\n\x0b\x64\x65scription\x18\x05 \x01(\tB\x03\xe0\x41\x02\x12\x11\n\taddresses\x18\x06 \x03(\t\x12J\n\x10\x61pplication_info\x18\x07 \x01(\x0b\x32\x30.google.cloud.talent.v4beta1.Job.ApplicationInfo\x12=\n\x0cjob_benefits\x18\x08 \x03(\x0e\x32'.google.cloud.talent.v4beta1.JobBenefit\x12H\n\x11\x63ompensation_info\x18\t \x01(\x0b\x32-.google.cloud.talent.v4beta1.CompensationInfo\x12Q\n\x11\x63ustom_attributes\x18\n \x03(\x0b\x32\x36.google.cloud.talent.v4beta1.Job.CustomAttributesEntry\x12=\n\x0c\x64\x65gree_types\x18\x0b \x03(\x0e\x32'.google.cloud.talent.v4beta1.DegreeType\x12\x12\n\ndepartment\x18\x0c \x01(\t\x12\x45\n\x10\x65mployment_types\x18\r \x03(\x0e\x32+.google.cloud.talent.v4beta1.EmploymentType\x12\x12\n\nincentives\x18\x0e \x01(\t\x12\x15\n\rlanguage_code\x18\x0f \x01(\t\x12\x38\n\tjob_level\x18\x10 \x01(\x0e\x32%.google.cloud.talent.v4beta1.JobLevel\x12\x17\n\x0fpromotion_value\x18\x11 \x01(\x05\x12\x16\n\x0equalifications\x18\x12 \x01(\t\x12\x18\n\x10responsibilities\x18\x13 \x01(\t\x12\x42\n\x0eposting_region\x18\x14 \x01(\x0e\x32*.google.cloud.talent.v4beta1.PostingRegion\x12?\n\nvisibility\x18\x15 \x01(\x0e\x32'.google.cloud.talent.v4beta1.VisibilityB\x02\x18\x01\x12\x32\n\x0ejob_start_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x30\n\x0cjob_end_time\x18\x17 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14posting_publish_time\x18\x18 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x37\n\x13posting_expire_time\x18\x19 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12<\n\x13posting_create_time\x18\x1a \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12<\n\x13posting_update_time\x18\x1b \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12!\n\x14\x63ompany_display_name\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12G\n\x0c\x64\x65rived_info\x18\x1d \x01(\x0b\x32,.google.cloud.talent.v4beta1.Job.DerivedInfoB\x03\xe0\x41\x03\x12N\n\x12processing_options\x18\x1e \x01(\x0b\x32\x32.google.cloud.talent.v4beta1.Job.ProcessingOptions\x1a\x44\n\x0f\x41pplicationInfo\x12\x0e\n\x06\x65mails\x18\x01 \x03(\t\x12\x13\n\x0binstruction\x18\x02 \x01(\t\x12\x0c\n\x04uris\x18\x03 \x03(\t\x1a\x89\x01\n\x0b\x44\x65rivedInfo\x12\x38\n\tlocations\x18\x01 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12@\n\x0ejob_categories\x18\x03 \x03(\x0e\x32(.google.cloud.talent.v4beta1.JobCategory\x1a\x88\x01\n\x11ProcessingOptions\x12)\n!disable_street_address_resolution\x18\x01 \x01(\x08\x12H\n\x11html_sanitization\x18\x02 \x01(\x0e\x32-.google.cloud.talent.v4beta1.HtmlSanitization\x1a\x65\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.talent.v4beta1.CustomAttribute:\x02\x38\x01:k\xea\x41h\n\x17jobs.googleapis.com/Job\x12\x1dprojects/{project}/jobs/{job}\x12.projects/{project}/tenants/{tenant}/jobs/{job}B~\n\x1f\x63om.google.cloud.talent.v4beta1B\x10JobResourceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3" - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_type_dot_postal__address__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_JOB_APPLICATIONINFO = _descriptor.Descriptor( - name="ApplicationInfo", - full_name="google.cloud.talent.v4beta1.Job.ApplicationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="emails", - full_name="google.cloud.talent.v4beta1.Job.ApplicationInfo.emails", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="instruction", - full_name="google.cloud.talent.v4beta1.Job.ApplicationInfo.instruction", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uris", - full_name="google.cloud.talent.v4beta1.Job.ApplicationInfo.uris", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1739, - serialized_end=1807, -) - -_JOB_DERIVEDINFO = _descriptor.Descriptor( - name="DerivedInfo", - full_name="google.cloud.talent.v4beta1.Job.DerivedInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="locations", - full_name="google.cloud.talent.v4beta1.Job.DerivedInfo.locations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_categories", - full_name="google.cloud.talent.v4beta1.Job.DerivedInfo.job_categories", - index=1, - number=3, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1810, - serialized_end=1947, -) - -_JOB_PROCESSINGOPTIONS = _descriptor.Descriptor( - name="ProcessingOptions", - full_name="google.cloud.talent.v4beta1.Job.ProcessingOptions", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="disable_street_address_resolution", - full_name="google.cloud.talent.v4beta1.Job.ProcessingOptions.disable_street_address_resolution", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="html_sanitization", - full_name="google.cloud.talent.v4beta1.Job.ProcessingOptions.html_sanitization", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1950, - serialized_end=2086, -) - -_JOB_CUSTOMATTRIBUTESENTRY = _descriptor.Descriptor( - name="CustomAttributesEntry", - full_name="google.cloud.talent.v4beta1.Job.CustomAttributesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.talent.v4beta1.Job.CustomAttributesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.talent.v4beta1.Job.CustomAttributesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2088, - serialized_end=2189, -) - -_JOB = _descriptor.Descriptor( - name="Job", - full_name="google.cloud.talent.v4beta1.Job", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.Job.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company", - full_name="google.cloud.talent.v4beta1.Job.company", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Company" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="requisition_id", - full_name="google.cloud.talent.v4beta1.Job.requisition_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="title", - full_name="google.cloud.talent.v4beta1.Job.title", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.Job.description", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="addresses", - full_name="google.cloud.talent.v4beta1.Job.addresses", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="application_info", - full_name="google.cloud.talent.v4beta1.Job.application_info", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_benefits", - full_name="google.cloud.talent.v4beta1.Job.job_benefits", - index=7, - number=8, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="compensation_info", - full_name="google.cloud.talent.v4beta1.Job.compensation_info", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_attributes", - full_name="google.cloud.talent.v4beta1.Job.custom_attributes", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="degree_types", - full_name="google.cloud.talent.v4beta1.Job.degree_types", - index=10, - number=11, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="department", - full_name="google.cloud.talent.v4beta1.Job.department", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employment_types", - full_name="google.cloud.talent.v4beta1.Job.employment_types", - index=12, - number=13, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="incentives", - full_name="google.cloud.talent.v4beta1.Job.incentives", - index=13, - number=14, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.talent.v4beta1.Job.language_code", - index=14, - number=15, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_level", - full_name="google.cloud.talent.v4beta1.Job.job_level", - index=15, - number=16, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="promotion_value", - full_name="google.cloud.talent.v4beta1.Job.promotion_value", - index=16, - number=17, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="qualifications", - full_name="google.cloud.talent.v4beta1.Job.qualifications", - index=17, - number=18, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="responsibilities", - full_name="google.cloud.talent.v4beta1.Job.responsibilities", - index=18, - number=19, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posting_region", - full_name="google.cloud.talent.v4beta1.Job.posting_region", - index=19, - number=20, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visibility", - full_name="google.cloud.talent.v4beta1.Job.visibility", - index=20, - number=21, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_start_time", - full_name="google.cloud.talent.v4beta1.Job.job_start_time", - index=21, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_end_time", - full_name="google.cloud.talent.v4beta1.Job.job_end_time", - index=22, - number=23, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posting_publish_time", - full_name="google.cloud.talent.v4beta1.Job.posting_publish_time", - index=23, - number=24, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posting_expire_time", - full_name="google.cloud.talent.v4beta1.Job.posting_expire_time", - index=24, - number=25, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posting_create_time", - full_name="google.cloud.talent.v4beta1.Job.posting_create_time", - index=25, - number=26, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="posting_update_time", - full_name="google.cloud.talent.v4beta1.Job.posting_update_time", - index=26, - number=27, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="company_display_name", - full_name="google.cloud.talent.v4beta1.Job.company_display_name", - index=27, - number=28, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="derived_info", - full_name="google.cloud.talent.v4beta1.Job.derived_info", - index=28, - number=29, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="processing_options", - full_name="google.cloud.talent.v4beta1.Job.processing_options", - index=29, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _JOB_APPLICATIONINFO, - _JOB_DERIVEDINFO, - _JOB_PROCESSINGOPTIONS, - _JOB_CUSTOMATTRIBUTESENTRY, - ], - enum_types=[], - serialized_options=_b( - "\352Ah\n\027jobs.googleapis.com/Job\022\035projects/{project}/jobs/{job}\022.projects/{project}/tenants/{tenant}/jobs/{job}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=282, - serialized_end=2298, -) - -_JOB_APPLICATIONINFO.containing_type = _JOB -_JOB_DERIVEDINFO.fields_by_name[ - "locations" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._LOCATION -) -_JOB_DERIVEDINFO.fields_by_name[ - "job_categories" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._JOBCATEGORY -) -_JOB_DERIVEDINFO.containing_type = _JOB -_JOB_PROCESSINGOPTIONS.fields_by_name[ - "html_sanitization" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._HTMLSANITIZATION -) -_JOB_PROCESSINGOPTIONS.containing_type = _JOB -_JOB_CUSTOMATTRIBUTESENTRY.fields_by_name[ - "value" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CUSTOMATTRIBUTE -) -_JOB_CUSTOMATTRIBUTESENTRY.containing_type = _JOB -_JOB.fields_by_name["application_info"].message_type = _JOB_APPLICATIONINFO -_JOB.fields_by_name[ - "job_benefits" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._JOBBENEFIT -_JOB.fields_by_name[ - "compensation_info" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._COMPENSATIONINFO -) -_JOB.fields_by_name["custom_attributes"].message_type = _JOB_CUSTOMATTRIBUTESENTRY -_JOB.fields_by_name[ - "degree_types" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._DEGREETYPE -_JOB.fields_by_name[ - "employment_types" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._EMPLOYMENTTYPE -) -_JOB.fields_by_name[ - "job_level" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._JOBLEVEL -_JOB.fields_by_name[ - "posting_region" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._POSTINGREGION -) -_JOB.fields_by_name[ - "visibility" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._VISIBILITY -_JOB.fields_by_name[ - "job_start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name[ - "job_end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name[ - "posting_publish_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name[ - "posting_expire_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name[ - "posting_create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name[ - "posting_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_JOB.fields_by_name["derived_info"].message_type = _JOB_DERIVEDINFO -_JOB.fields_by_name["processing_options"].message_type = _JOB_PROCESSINGOPTIONS -DESCRIPTOR.message_types_by_name["Job"] = _JOB -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Job = _reflection.GeneratedProtocolMessageType( - "Job", - (_message.Message,), - dict( - ApplicationInfo=_reflection.GeneratedProtocolMessageType( - "ApplicationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_JOB_APPLICATIONINFO, - __module__="google.cloud.talent_v4beta1.proto.job_pb2", - __doc__="""Application related details of a job posting. - - - Attributes: - emails: - Use this field to specify email address(es) to which resumes - or applications can be sent. The maximum number of allowed - characters for each entry is 255. - instruction: - Use this field to provide instructions, such as "Mail your - application to ...", that a candidate can follow to apply for - the job. This field accepts and sanitizes HTML input, and - also accepts bold, italic, ordered list, and unordered list - markup tags. The maximum number of allowed characters is - 3,000. - uris: - Use this URI field to direct an applicant to a website, for - example to link to an online application form. The maximum - number of allowed characters for each entry is 2,000. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Job.ApplicationInfo) - ), - ), - DerivedInfo=_reflection.GeneratedProtocolMessageType( - "DerivedInfo", - (_message.Message,), - dict( - DESCRIPTOR=_JOB_DERIVEDINFO, - __module__="google.cloud.talent_v4beta1.proto.job_pb2", - __doc__="""Derived details about the job posting. - - - Attributes: - locations: - Structured locations of the job, resolved from - [Job.addresses][google.cloud.talent.v4beta1.Job.addresses]. [ - locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locatio - ns] are exactly matched to - [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] in - the same order. - job_categories: - Job categories derived from - [Job.title][google.cloud.talent.v4beta1.Job.title] and [Job.de - scription][google.cloud.talent.v4beta1.Job.description]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Job.DerivedInfo) - ), - ), - ProcessingOptions=_reflection.GeneratedProtocolMessageType( - "ProcessingOptions", - (_message.Message,), - dict( - DESCRIPTOR=_JOB_PROCESSINGOPTIONS, - __module__="google.cloud.talent_v4beta1.proto.job_pb2", - __doc__="""Options for job processing. - - - Attributes: - disable_street_address_resolution: - If set to ``true``, the service does not attempt to resolve a - more precise address for the job. - html_sanitization: - Option for job HTML content sanitization. Applied fields are: - - description - applicationInfo.instruction - incentives - - qualifications - responsibilities HTML tags in these fields - may be stripped if sanitiazation isn't disabled. Defaults to - [HtmlSanitization.SIMPLE\_FORMATTING\_ONLY][google.cloud.talen - t.v4beta1.HtmlSanitization.SIMPLE\_FORMATTING\_ONLY]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Job.ProcessingOptions) - ), - ), - CustomAttributesEntry=_reflection.GeneratedProtocolMessageType( - "CustomAttributesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_JOB_CUSTOMATTRIBUTESENTRY, - __module__="google.cloud.talent_v4beta1.proto.job_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Job.CustomAttributesEntry) - ), - ), - DESCRIPTOR=_JOB, - __module__="google.cloud.talent_v4beta1.proto.job_pb2", - __doc__="""A Job resource represents a job posting (also referred to - as a "job listing" or "job requisition"). A job belongs to a - [Company][google.cloud.talent.v4beta1.Company], which is the hiring - entity responsible for the job. - - - Attributes: - name: - Required during job update. The resource name for the job. - This is generated by the service when a job is created. The - format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". - For example, "projects/foo/tenants/bar/jobs/baz". If tenant - id is unspecified, the default tenant is used. For example, - "projects/foo/jobs/bar". Use of this field in job queries and - API calls is preferred over the use of [requisition\_id][googl - e.cloud.talent.v4beta1.Job.requisition\_id] since this value - is unique. - company: - Required. The resource name of the company listing the job. - The format is "projects/{project\_id}/tenants/{tenant\_id}/com - panies/{company\_id}". For example, - "projects/foo/tenants/bar/companies/baz". If tenant id is - unspecified, the default tenant is used. For example, - "projects/foo/companies/bar". - requisition_id: - Required. The requisition ID, also referred to as the posting - ID, is assigned by the client to identify a job. This field is - intended to be used by clients for client identification and - tracking of postings. A job isn't allowed to be created if - there is another job with the same - [company][google.cloud.talent.v4beta1.Job.name], [language\_co - de][google.cloud.talent.v4beta1.Job.language\_code] and [requi - sition\_id][google.cloud.talent.v4beta1.Job.requisition\_id]. - The maximum number of allowed characters is 255. - title: - Required. The title of the job, such as "Software Engineer" - The maximum number of allowed characters is 500. - description: - Required. The description of the job, which typically includes - a multi-paragraph description of the company and related - information. Separate fields are provided on the job object - for [responsibilities][google.cloud.talent.v4beta1.Job.respons - ibilities], [qualifications][google.cloud.talent.v4beta1.Job.q - ualifications], and other job characteristics. Use of these - separate job fields is recommended. This field accepts and - sanitizes HTML input, and also accepts bold, italic, ordered - list, and unordered list markup tags. The maximum number of - allowed characters is 100,000. - addresses: - Strongly recommended for the best service experience. - Location(s) where the employer is looking to hire for this job - posting. Specifying the full street address(es) of the hiring - location enables better API results, especially job searches - by commute time. At most 50 locations are allowed for best - search performance. If a job has more locations, it is - suggested to split it into multiple jobs with unique [requisit - ion\_id][google.cloud.talent.v4beta1.Job.requisition\_id]s - (e.g. 'ReqA' becomes 'ReqA-1', 'ReqA-2', and so on.) as - multiple jobs with the same - [company][google.cloud.talent.v4beta1.Job.company], [language\ - _code][google.cloud.talent.v4beta1.Job.language\_code] and [re - quisition\_id][google.cloud.talent.v4beta1.Job.requisition\_id - ] are not allowed. If the original [requisition\_id][google.cl - oud.talent.v4beta1.Job.requisition\_id] must be preserved, a - custom field should be used for storage. It is also suggested - to group the locations that close to each other in the same - job for better search experience. The maximum number of - allowed characters is 500. - application_info: - Job application information. - job_benefits: - The benefits included with the job. - compensation_info: - Job compensation information (a.k.a. "pay rate") i.e., the - compensation that will paid to the employee. - custom_attributes: - A map of fields to hold both filterable and non-filterable - custom job attributes that are not covered by the provided - structured fields. The keys of the map are strings up to 64 - bytes and must match the pattern: [a-zA-Z][a-zA-Z0-9\_]\*. For - example, key0LikeThis or KEY\_1\_LIKE\_THIS. At most 100 - filterable and at most 100 unfilterable keys are supported. - For filterable ``string_values``, across all keys at most 200 - values are allowed, with each string no more than 255 - characters. For unfilterable ``string_values``, the maximum - total size of ``string_values`` across all keys is 50KB. - degree_types: - The desired education degrees for the job, such as Bachelors, - Masters. - department: - The department or functional area within the company with the - open position. The maximum number of allowed characters is - 255. - employment_types: - The employment type(s) of a job, for example, [full - time][google.cloud.talent.v4beta1.EmploymentType.FULL\_TIME] - or [part - time][google.cloud.talent.v4beta1.EmploymentType.PART\_TIME]. - incentives: - A description of bonus, commission, and other compensation - incentives associated with the job not including salary or - pay. The maximum number of allowed characters is 10,000. - language_code: - The language of the posting. This field is distinct from any - requirements for fluency that are associated with the job. - Language codes must be in BCP-47 format, such as "en-US" or - "sr-Latn". For more information, see `Tags for Identifying - Languages `__\ {: - class="external" target="\_blank" }. If this field is - unspecified and - [Job.description][google.cloud.talent.v4beta1.Job.description] - is present, detected language code based on - [Job.description][google.cloud.talent.v4beta1.Job.description] - is assigned, otherwise defaults to 'en\_US'. - job_level: - The experience level associated with the job, such as "Entry - Level". - promotion_value: - A promotion value of the job, as determined by the client. The - value determines the sort order of the jobs returned when - searching for jobs using the featured jobs search call, with - higher promotional values being returned first and ties being - resolved by relevance sort. Only the jobs with a - promotionValue >0 are returned in a FEATURED\_JOB\_SEARCH. - Default value is 0, and negative values are treated as 0. - qualifications: - A description of the qualifications required to perform the - job. The use of this field is recommended as an alternative to - using the more general - [description][google.cloud.talent.v4beta1.Job.description] - field. This field accepts and sanitizes HTML input, and also - accepts bold, italic, ordered list, and unordered list markup - tags. The maximum number of allowed characters is 10,000. - responsibilities: - A description of job responsibilities. The use of this field - is recommended as an alternative to using the more general - [description][google.cloud.talent.v4beta1.Job.description] - field. This field accepts and sanitizes HTML input, and also - accepts bold, italic, ordered list, and unordered list markup - tags. The maximum number of allowed characters is 10,000. - posting_region: - The job - [PostingRegion][google.cloud.talent.v4beta1.PostingRegion] - (for example, state, country) throughout which the job is - available. If this field is set, a - [LocationFilter][google.cloud.talent.v4beta1.LocationFilter] - in a search query within the job region finds this job posting - if an exact location match isn't specified. If this field is - set to [PostingRegion.NATION][google.cloud.talent.v4beta1.Post - ingRegion.NATION] or [PostingRegion.ADMINISTRATIVE\_AREA][goog - le.cloud.talent.v4beta1.PostingRegion.ADMINISTRATIVE\_AREA], - setting job - [Job.addresses][google.cloud.talent.v4beta1.Job.addresses] to - the same location level as this field is strongly recommended. - visibility: - Deprecated. The job is only visible to the owner. The - visibility of the job. Defaults to [Visibility.ACCOUNT\_ONLY] - [google.cloud.talent.v4beta1.Visibility.ACCOUNT\_ONLY] if not - specified. - job_start_time: - The start timestamp of the job in UTC time zone. Typically - this field is used for contracting engagements. Invalid - timestamps are ignored. - job_end_time: - The end timestamp of the job. Typically this field is used for - contracting engagements. Invalid timestamps are ignored. - posting_publish_time: - The timestamp this job posting was most recently published. - The default value is the time the request arrives at the - server. Invalid timestamps are ignored. - posting_expire_time: - Strongly recommended for the best service experience. The - expiration timestamp of the job. After this timestamp, the job - is marked as expired, and it no longer appears in search - results. The expired job can't be listed by the - [ListJobs][google.cloud.talent.v4beta1.JobService.ListJobs] - API, but it can be retrieved with the - [GetJob][google.cloud.talent.v4beta1.JobService.GetJob] API or - updated with the - [UpdateJob][google.cloud.talent.v4beta1.JobService.UpdateJob] - API or deleted with the - [DeleteJob][google.cloud.talent.v4beta1.JobService.DeleteJob] - API. An expired job can be updated and opened again by using a - future expiration timestamp. Updating an expired job fails if - there is another existing open job with same - [company][google.cloud.talent.v4beta1.Job.company], [language\ - _code][google.cloud.talent.v4beta1.Job.language\_code] and [re - quisition\_id][google.cloud.talent.v4beta1.Job.requisition\_id - ]. The expired jobs are retained in our system for 90 days. - However, the overall expired job count cannot exceed 3 times - the maximum number of open jobs over previous 7 days. If this - threshold is exceeded, expired jobs are cleaned out in order - of earliest expire time. Expired jobs are no longer accessible - after they are cleaned out. Invalid timestamps are ignored, - and treated as expire time not provided. If the timestamp is - before the instant request is made, the job is treated as - expired immediately on creation. This kind of job can not be - updated. And when creating a job with past timestamp, the [pos - ting\_publish\_time][google.cloud.talent.v4beta1.Job.posting\_ - publish\_time] must be set before [posting\_expire\_time][goog - le.cloud.talent.v4beta1.Job.posting\_expire\_time]. The - purpose of this feature is to allow other objects, such as - [Application][google.cloud.talent.v4beta1.Application], to - refer a job that didn't exist in the system prior to becoming - expired. If you want to modify a job that was expired on - creation, delete it and create a new one. If this value isn't - provided at the time of job creation or is invalid, the job - posting expires after 30 days from the job's creation time. - For example, if the job was created on 2017/01/01 13:00AM UTC - with an unspecified expiration date, the job expires after - 2017/01/31 13:00AM UTC. If this value isn't provided on job - update, it depends on the field masks set by [UpdateJobRequest - .update\_mask][google.cloud.talent.v4beta1.UpdateJobRequest.up - date\_mask]. If the field masks include [job\_end\_time][googl - e.cloud.talent.v4beta1.Job.job\_end\_time], or the masks are - empty meaning that every field is updated, the job posting - expires after 30 days from the job's last update time. - Otherwise the expiration date isn't updated. - posting_create_time: - Output only. The timestamp when this job posting was created. - posting_update_time: - Output only. The timestamp when this job posting was last - updated. - company_display_name: - Output only. Display name of the company listing the job. - derived_info: - Output only. Derived details about the job posting. - processing_options: - Options for job processing. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Job) - ), -) -_sym_db.RegisterMessage(Job) -_sym_db.RegisterMessage(Job.ApplicationInfo) -_sym_db.RegisterMessage(Job.DerivedInfo) -_sym_db.RegisterMessage(Job.ProcessingOptions) -_sym_db.RegisterMessage(Job.CustomAttributesEntry) - - -DESCRIPTOR._options = None -_JOB_CUSTOMATTRIBUTESENTRY._options = None -_JOB.fields_by_name["company"]._options = None -_JOB.fields_by_name["requisition_id"]._options = None -_JOB.fields_by_name["title"]._options = None -_JOB.fields_by_name["description"]._options = None -_JOB.fields_by_name["visibility"]._options = None -_JOB.fields_by_name["posting_create_time"]._options = None -_JOB.fields_by_name["posting_update_time"]._options = None -_JOB.fields_by_name["company_display_name"]._options = None -_JOB.fields_by_name["derived_info"]._options = None -_JOB._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/job_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/job_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/job_service.proto b/talent/google/cloud/talent_v4beta1/proto/job_service.proto deleted file mode 100644 index e2216aa6535f..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job_service.proto +++ /dev/null @@ -1,913 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/cloud/talent/v4beta1/filters.proto"; -import "google/cloud/talent/v4beta1/histogram.proto"; -import "google/cloud/talent/v4beta1/job.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "JobServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service handles job management, including job CRUD, enumeration and search. -service JobService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Creates a new job. - // - // Typically, the job becomes searchable within 10 seconds, but it may take - // up to 5 minutes. - rpc CreateJob(CreateJobRequest) returns (Job) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs" - body: "*" - } - }; - option (google.api.method_signature) = "parent,job"; - } - - // Begins executing a batch create jobs operation. - rpc BatchCreateJobs(BatchCreateJobsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs:batchCreate" - body: "*" - } - }; - option (google.api.method_signature) = "parent,jobs"; - option (google.longrunning.operation_info) = { - response_type: "JobOperationResult" - metadata_type: "BatchOperationMetadata" - }; - } - - // Retrieves the specified job, whose status is OPEN or recently EXPIRED - // within the last 90 days. - rpc GetJob(GetJobRequest) returns (Job) { - option (google.api.http) = { - get: "/v4beta1/{name=projects/*/tenants/*/jobs/*}" - additional_bindings { - get: "/v4beta1/{name=projects/*/jobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Updates specified job. - // - // Typically, updated contents become visible in search results within 10 - // seconds, but it may take up to 5 minutes. - rpc UpdateJob(UpdateJobRequest) returns (Job) { - option (google.api.http) = { - patch: "/v4beta1/{job.name=projects/*/tenants/*/jobs/*}" - body: "*" - additional_bindings { - patch: "/v4beta1/{job.name=projects/*/jobs/*}" - body: "*" - } - }; - option (google.api.method_signature) = "job"; - } - - // Begins executing a batch update jobs operation. - rpc BatchUpdateJobs(BatchUpdateJobsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs:batchUpdate" - body: "*" - } - }; - option (google.api.method_signature) = "parent,jobs"; - option (google.longrunning.operation_info) = { - response_type: "JobOperationResult" - metadata_type: "BatchOperationMetadata" - }; - } - - // Deletes the specified job. - // - // Typically, the job becomes unsearchable within 10 seconds, but it may take - // up to 5 minutes. - rpc DeleteJob(DeleteJobRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v4beta1/{name=projects/*/tenants/*/jobs/*}" - additional_bindings { - delete: "/v4beta1/{name=projects/*/jobs/*}" - } - }; - option (google.api.method_signature) = "name"; - } - - // Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. - rpc BatchDeleteJobs(BatchDeleteJobsRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs:batchDelete" - } - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Lists jobs by filter. - rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*/tenants/*}/jobs" - additional_bindings { - get: "/v4beta1/{parent=projects/*}/jobs" - } - }; - option (google.api.method_signature) = "parent,filter"; - } - - // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - // - // This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs - // present in the database, and only returns jobs that the caller has - // permission to search against. - rpc SearchJobs(SearchJobsRequest) returns (SearchJobsResponse) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:search" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs:search" - body: "*" - } - }; - } - - // Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - // - // This API call is intended for the use case of targeting passive job - // seekers (for example, job seekers who have signed up to receive email - // alerts about potential job opportunities), and has different algorithmic - // adjustments that are targeted to passive job seekers. - // - // This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs - // present in the database, and only returns jobs the caller has - // permission to search against. - rpc SearchJobsForAlert(SearchJobsRequest) returns (SearchJobsResponse) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert" - body: "*" - additional_bindings { - post: "/v4beta1/{parent=projects/*}/jobs:searchForAlert" - body: "*" - } - }; - } -} - -// Create job request. -message CreateJobRequest { - // Required. The resource name of the tenant under which the job is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Required. The Job to be created. - Job job = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Get job request. -message GetJobRequest { - // Required. The resource name of the job to retrieve. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For - // example, "projects/foo/tenants/bar/jobs/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/jobs/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Job" - } - ]; -} - -// Update job request. -message UpdateJobRequest { - // Required. The Job to be updated. - Job job = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. - // - // If [update_mask][google.cloud.talent.v4beta1.UpdateJobRequest.update_mask] is provided, only the specified fields in - // [job][google.cloud.talent.v4beta1.UpdateJobRequest.job] are updated. Otherwise all the fields are updated. - // - // A field mask to restrict the fields that are updated. Only - // top level fields of [Job][google.cloud.talent.v4beta1.Job] are supported. - google.protobuf.FieldMask update_mask = 2; -} - -// Delete job request. -message DeleteJobRequest { - // Required. The resource name of the job to be deleted. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/jobs/{job_id}". For - // example, "projects/foo/tenants/bar/jobs/baz". - // - // If tenant id is unspecified, the default tenant is used. For - // example, "projects/foo/jobs/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Job" - } - ]; -} - -// Batch delete jobs request. -message BatchDeleteJobsRequest { - // Required. The resource name of the tenant under which the job is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Required. The filter string specifies the jobs to be deleted. - // - // Supported operator: =, AND - // - // The fields eligible for filtering are: - // - // * `companyName` (Required) - // * `requisitionId` (Required) - // - // Sample Query: companyName = "projects/foo/companies/bar" AND - // requisitionId = "req-1" - string filter = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// List jobs request. -message ListJobsRequest { - // Required. The resource name of the tenant under which the job is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Required. The filter string specifies the jobs to be enumerated. - // - // Supported operator: =, AND - // - // The fields eligible for filtering are: - // - // * `companyName` (Required) - // * `requisitionId` - // * `status` Available values: OPEN, EXPIRED, ALL. Defaults to - // OPEN if no value is specified. - // - // Sample Query: - // - // * companyName = "projects/foo/tenants/bar/companies/baz" - // * companyName = "projects/foo/tenants/bar/companies/baz" AND - // requisitionId = "req-1" - // * companyName = "projects/foo/tenants/bar/companies/baz" AND - // status = "EXPIRED" - string filter = 2 [(google.api.field_behavior) = REQUIRED]; - - // The starting point of a query result. - string page_token = 3; - - // The maximum number of jobs to be returned per page of results. - // - // If [job_view][google.cloud.talent.v4beta1.ListJobsRequest.job_view] is set to [JobView.JOB_VIEW_ID_ONLY][google.cloud.talent.v4beta1.JobView.JOB_VIEW_ID_ONLY], the maximum allowed - // page size is 1000. Otherwise, the maximum allowed page size is 100. - // - // Default is 100 if empty or a number < 1 is specified. - int32 page_size = 4; - - // The desired job attributes returned for jobs in the - // search response. Defaults to [JobView.JOB_VIEW_FULL][google.cloud.talent.v4beta1.JobView.JOB_VIEW_FULL] if no value is - // specified. - JobView job_view = 5; -} - -// An enum that specifies the job attributes that are returned in the -// [MatchingJob.job][google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job] or -// [ListJobsResponse.jobs][google.cloud.talent.v4beta1.ListJobsResponse.jobs] fields. -enum JobView { - // Default value. - JOB_VIEW_UNSPECIFIED = 0; - - // A ID only view of job, with following attributes: - // [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.language_code][google.cloud.talent.v4beta1.Job.language_code]. - JOB_VIEW_ID_ONLY = 1; - - // A minimal view of the job, with the following attributes: - // [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.title][google.cloud.talent.v4beta1.Job.title], - // [Job.company][google.cloud.talent.v4beta1.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations], [Job.language_code][google.cloud.talent.v4beta1.Job.language_code]. - JOB_VIEW_MINIMAL = 2; - - // A small view of the job, with the following attributes in the search - // results: [Job.name][google.cloud.talent.v4beta1.Job.name], [Job.requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], [Job.title][google.cloud.talent.v4beta1.Job.title], - // [Job.company][google.cloud.talent.v4beta1.Job.company], [Job.DerivedInfo.locations][google.cloud.talent.v4beta1.Job.DerivedInfo.locations], [Job.visibility][google.cloud.talent.v4beta1.Job.visibility], - // [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], [Job.description][google.cloud.talent.v4beta1.Job.description]. - JOB_VIEW_SMALL = 3; - - // All available attributes are included in the search results. - JOB_VIEW_FULL = 4; -} - -// List jobs response. -message ListJobsResponse { - // The Jobs for a given company. - // - // The maximum number of items returned is based on the limit field - // provided in the request. - repeated Job jobs = 1; - - // A token to retrieve the next page of results. - string next_page_token = 2; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 3; -} - -// The Request body of the `SearchJobs` call. -message SearchJobsRequest { - // Custom ranking information for [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - message CustomRankingInfo { - // The importance level for [CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression]. - enum ImportanceLevel { - // Default value if the importance level isn't specified. - IMPORTANCE_LEVEL_UNSPECIFIED = 0; - - // The given ranking expression is of None importance, existing relevance - // score (determined by API algorithm) dominates job's final ranking - // position. - NONE = 1; - - // The given ranking expression is of Low importance in terms of job's - // final ranking position compared to existing relevance - // score (determined by API algorithm). - LOW = 2; - - // The given ranking expression is of Mild importance in terms of job's - // final ranking position compared to existing relevance - // score (determined by API algorithm). - MILD = 3; - - // The given ranking expression is of Medium importance in terms of job's - // final ranking position compared to existing relevance - // score (determined by API algorithm). - MEDIUM = 4; - - // The given ranking expression is of High importance in terms of job's - // final ranking position compared to existing relevance - // score (determined by API algorithm). - HIGH = 5; - - // The given ranking expression is of Extreme importance, and dominates - // job's final ranking position with existing relevance - // score (determined by API algorithm) ignored. - EXTREME = 6; - } - - // Required. Controls over how important the score of - // [CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression] gets applied to job's final - // ranking position. - // - // An error is thrown if not specified. - ImportanceLevel importance_level = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Controls over how job documents get ranked on top of existing - // relevance score (determined by API algorithm). A combination of the - // ranking expression and relevance score is used to determine job's final - // ranking position. - // - // The syntax for this expression is a subset of Google SQL syntax. - // - // Supported operators are: +, -, *, /, where the left and right side of - // the operator is either a numeric [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes] key, - // integer/double value or an expression that can be evaluated to a number. - // - // Parenthesis are supported to adjust calculation precedence. The - // expression must be < 100 characters in length. - // - // The expression is considered invalid for a job if the expression - // references custom attributes that are not populated on the job or if the - // expression results in a divide by zero. If an expression is invalid for a - // job, that job is demoted to the end of the results. - // - // Sample ranking expression - // (year + 25) * 0.25 - (freshness / 0.5) - string ranking_expression = 2 [(google.api.field_behavior) = REQUIRED]; - } - - // A string-represented enumeration of the job search mode. The service - // operate differently for different modes of service. - enum SearchMode { - // The mode of the search method isn't specified. The default search - // behavior is identical to JOB_SEARCH search behavior. - SEARCH_MODE_UNSPECIFIED = 0; - - // The job search matches against all jobs, and featured jobs - // (jobs with promotionValue > 0) are not specially handled. - JOB_SEARCH = 1; - - // The job search matches only against featured jobs (jobs with a - // promotionValue > 0). This method doesn't return any jobs having a - // promotionValue <= 0. The search results order is determined by the - // promotionValue (jobs with a higher promotionValue are returned higher up - // in the search results), with relevance being used as a tiebreaker. - FEATURED_JOB_SEARCH = 2; - } - - // Controls whether highly similar jobs are returned next to each other in - // the search results. Jobs are identified as highly similar based on - // their titles, job categories, and locations. Highly similar results are - // clustered so that only one representative job of the cluster is - // displayed to the job seeker higher up in the results, with the other jobs - // being displayed lower down in the results. - enum DiversificationLevel { - // The diversification level isn't specified. - DIVERSIFICATION_LEVEL_UNSPECIFIED = 0; - - // Disables diversification. Jobs that would normally be pushed to the last - // page would not have their positions altered. This may result in highly - // similar jobs appearing in sequence in the search results. - DISABLED = 1; - - // Default diversifying behavior. The result list is ordered so that - // highly similar results are pushed to the end of the last page of search - // results. If you are using pageToken to page through the result set, - // latency might be lower but we can't guarantee that all results are - // returned. If you are using page offset, latency might be higher but all - // results are returned. - SIMPLE = 2; - } - - // Required. The resource name of the tenant to search within. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Mode of a search. - // - // Defaults to [SearchMode.JOB_SEARCH][google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB_SEARCH]. - SearchMode search_mode = 2; - - // Required. The meta information collected about the job searcher, used to improve the - // search quality of the service. The identifiers (such as `user_id`) are - // provided by users, and must be unique and consistent. - RequestMetadata request_metadata = 3 [(google.api.field_behavior) = REQUIRED]; - - // Query used to search against jobs, such as keyword, location filters, etc. - JobQuery job_query = 4; - - // Controls whether to broaden the search when it produces sparse results. - // Broadened queries append results to the end of the matching results - // list. - // - // Defaults to false. - bool enable_broadening = 5; - - // Controls if the search job request requires the return of a precise - // count of the first 300 results. Setting this to `true` ensures - // consistency in the number of results per page. Best practice is to set this - // value to true if a client allows users to jump directly to a - // non-sequential search results page. - // - // Enabling this flag may adversely impact performance. - // - // Defaults to false. - bool require_precise_result_size = 6; - - // An expression specifies a histogram request against matching jobs. - // - // Expression syntax is an aggregation function call with histogram facets and - // other options. - // - // Available aggregation function calls are: - // * `count(string_histogram_facet)`: Count the number of matching entities, - // for each distinct attribute value. - // * `count(numeric_histogram_facet, list of buckets)`: Count the number of - // matching entities within each bucket. - // - // Data types: - // - // * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+. - // * String: string like "any string with backslash escape for quote(\")." - // * Number: whole number and floating point number like 10, -1 and -0.01. - // * List: list of elements with comma(,) separator surrounded by square - // brackets, for example, [1, 2, 3] and ["one", "two", "three"]. - // - // Built-in constants: - // - // * MIN (minimum number similar to java Double.MIN_VALUE) - // * MAX (maximum number similar to java Double.MAX_VALUE) - // - // Built-in functions: - // - // * bucket(start, end[, label]): bucket built-in function creates a bucket - // with range of [start, end). Note that the end is exclusive, for example, - // bucket(1, MAX, "positive number") or bucket(1, 10). - // - // Job histogram facets: - // - // * company_display_name: histogram by [Job.company_display_name][google.cloud.talent.v4beta1.Job.company_display_name]. - // * employment_type: histogram by [Job.employment_types][google.cloud.talent.v4beta1.Job.employment_types], for example, - // "FULL_TIME", "PART_TIME". - // * company_size: histogram by [CompanySize][google.cloud.talent.v4beta1.CompanySize], for example, "SMALL", - // "MEDIUM", "BIG". - // * publish_time_in_month: histogram by the [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] - // in months. - // Must specify list of numeric buckets in spec. - // * publish_time_in_year: histogram by the [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] - // in years. - // Must specify list of numeric buckets in spec. - // * degree_types: histogram by the [Job.degree_types][google.cloud.talent.v4beta1.Job.degree_types], for example, - // "Bachelors", "Masters". - // * job_level: histogram by the [Job.job_level][google.cloud.talent.v4beta1.Job.job_level], for example, "Entry - // Level". - // * country: histogram by the country code of jobs, for example, "US", "FR". - // * admin1: histogram by the admin1 code of jobs, which is a global - // placeholder referring to the state, province, or the particular term a - // country uses to define the geographic structure below the country level, - // for example, "CA", "IL". - // * city: histogram by a combination of the "city name, admin1 code". For - // example, "Mountain View, CA", "New York, NY". - // * admin1_country: histogram by a combination of the "admin1 code, country", - // for example, "CA, US", "IL, US". - // * city_coordinate: histogram by the city center's GPS coordinates (latitude - // and longitude), for example, 37.4038522,-122.0987765. Since the - // coordinates of a city center can change, customers may need to refresh - // them periodically. - // * locale: histogram by the [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], for example, "en-US", - // "fr-FR". - // * language: histogram by the language subtag of the [Job.language_code][google.cloud.talent.v4beta1.Job.language_code], - // for example, "en", "fr". - // * category: histogram by the [JobCategory][google.cloud.talent.v4beta1.JobCategory], for example, - // "COMPUTER_AND_IT", "HEALTHCARE". - // * base_compensation_unit: histogram by the - // [CompensationInfo.CompensationUnit][google.cloud.talent.v4beta1.CompensationInfo.CompensationUnit] of base - // salary, for example, "WEEKLY", "MONTHLY". - // * base_compensation: histogram by the base salary. Must specify list of - // numeric buckets to group results by. - // * annualized_base_compensation: histogram by the base annualized salary. - // Must specify list of numeric buckets to group results by. - // * annualized_total_compensation: histogram by the total annualized salary. - // Must specify list of numeric buckets to group results by. - // * string_custom_attribute: histogram by string [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes]. - // Values can be accessed via square bracket notations like - // string_custom_attribute["key1"]. - // * numeric_custom_attribute: histogram by numeric [Job.custom_attributes][google.cloud.talent.v4beta1.Job.custom_attributes]. - // Values can be accessed via square bracket notations like - // numeric_custom_attribute["key1"]. Must specify list of numeric buckets to - // group results by. - // - // Example expressions: - // - // * `count(admin1)` - // * `count(base_compensation, [bucket(1000, 10000), bucket(10000, 100000), - // bucket(100000, MAX)])` - // * `count(string_custom_attribute["some-string-custom-attribute"])` - // * `count(numeric_custom_attribute["some-numeric-custom-attribute"], - // [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative"])` - repeated HistogramQuery histogram_queries = 7; - - // The desired job attributes returned for jobs in the search response. - // Defaults to [JobView.JOB_VIEW_SMALL][google.cloud.talent.v4beta1.JobView.JOB_VIEW_SMALL] if no value is specified. - JobView job_view = 8; - - // An integer that specifies the current offset (that is, starting result - // location, amongst the jobs deemed by the API as relevant) in search - // results. This field is only considered if [page_token][google.cloud.talent.v4beta1.SearchJobsRequest.page_token] is unset. - // - // The maximum allowed value is 5000. Otherwise an error is thrown. - // - // The maximum allowed value is 5000. Otherwise an error is thrown. - // - // For example, 0 means to return results starting from the first matching - // job, and 10 means to return from the 11th job. This can be used for - // pagination, (for example, pageSize = 10 and offset = 10 means to return - // from the second page). - int32 offset = 9; - - // A limit on the number of jobs returned in the search results. - // Increasing this value above the default value of 10 can increase search - // response time. The value can be between 1 and 100. - int32 page_size = 10; - - // The token specifying the current offset within - // search results. See [SearchJobsResponse.next_page_token][google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token] for - // an explanation of how to obtain the next set of query results. - string page_token = 11; - - // The criteria determining how search results are sorted. Default is - // `"relevance desc"`. - // - // Supported options are: - // - // * `"relevance desc"`: By relevance descending, as determined by the API - // algorithms. Relevance thresholding of query results is only available - // with this ordering. - // * `"posting_publish_time desc"`: By [Job.posting_publish_time][google.cloud.talent.v4beta1.Job.posting_publish_time] - // descending. - // * `"posting_update_time desc"`: By [Job.posting_update_time][google.cloud.talent.v4beta1.Job.posting_update_time] - // descending. - // * `"title"`: By [Job.title][google.cloud.talent.v4beta1.Job.title] ascending. - // * `"title desc"`: By [Job.title][google.cloud.talent.v4beta1.Job.title] descending. - // * `"annualized_base_compensation"`: By job's - // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range] ascending. Jobs - // whose annualized base compensation is unspecified are put at the end of - // search results. - // * `"annualized_base_compensation desc"`: By job's - // [CompensationInfo.annualized_base_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_base_compensation_range] descending. Jobs - // whose annualized base compensation is unspecified are put at the end of - // search results. - // * `"annualized_total_compensation"`: By job's - // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range] ascending. Jobs - // whose annualized base compensation is unspecified are put at the end of - // search results. - // * `"annualized_total_compensation desc"`: By job's - // [CompensationInfo.annualized_total_compensation_range][google.cloud.talent.v4beta1.CompensationInfo.annualized_total_compensation_range] descending. Jobs - // whose annualized base compensation is unspecified are put at the end of - // search results. - // * `"custom_ranking desc"`: By the relevance score adjusted to the - // [SearchJobsRequest.CustomRankingInfo.ranking_expression][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression] with weight - // factor assigned by - // [SearchJobsRequest.CustomRankingInfo.importance_level][google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level] in descending - // order. - // * Location sorting: Use the special syntax to order jobs by distance:
- // `"distance_from('Hawaii')"`: Order by distance from Hawaii.
- // `"distance_from(19.89, 155.5)"`: Order by distance from a coordinate.
- // `"distance_from('Hawaii'), distance_from('Puerto Rico')"`: Order by - // multiple locations. See details below.
- // `"distance_from('Hawaii'), distance_from(19.89, 155.5)"`: Order by - // multiple locations. See details below.
- // The string can have a maximum of 256 characters. When multiple distance - // centers are provided, a job that is close to any of the distance centers - // would have a high rank. When a job has multiple locations, the job - // location closest to one of the distance centers will be used. Jobs that - // don't have locations will be ranked at the bottom. Distance is calculated - // with a precision of 11.3 meters (37.4 feet). Diversification strategy is - // still applied unless explicitly disabled in - // [diversification_level][google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level]. - string order_by = 12; - - // Controls whether highly similar jobs are returned next to each other in - // the search results. Jobs are identified as highly similar based on - // their titles, job categories, and locations. Highly similar results are - // clustered so that only one representative job of the cluster is - // displayed to the job seeker higher up in the results, with the other jobs - // being displayed lower down in the results. - // - // Defaults to [DiversificationLevel.SIMPLE][google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel.SIMPLE] if no value - // is specified. - DiversificationLevel diversification_level = 13; - - // Controls over how job documents get ranked on top of existing relevance - // score (determined by API algorithm). - CustomRankingInfo custom_ranking_info = 14; - - // Controls whether to disable exact keyword match on [Job.title][google.cloud.talent.v4beta1.Job.title], - // [Job.description][google.cloud.talent.v4beta1.Job.description], [Job.company_display_name][google.cloud.talent.v4beta1.Job.company_display_name], [Job.addresses][google.cloud.talent.v4beta1.Job.addresses], - // [Job.qualifications][google.cloud.talent.v4beta1.Job.qualifications]. When disable keyword match is turned off, a - // keyword match returns jobs that do not match given category filters when - // there are matching keywords. For example, for the query "program manager," - // a result is returned even if the job posting has the title "software - // developer," which doesn't fall into "program manager" ontology, but does - // have "program manager" appearing in its description. - // - // For queries like "cloud" that don't contain title or - // location specific ontology, jobs with "cloud" keyword matches are returned - // regardless of this flag's value. - // - // Use [Company.keyword_searchable_job_custom_attributes][google.cloud.talent.v4beta1.Company.keyword_searchable_job_custom_attributes] if - // company-specific globally matched custom field/attribute string values are - // needed. Enabling keyword match improves recall of subsequent search - // requests. - // - // Defaults to false. - bool disable_keyword_match = 16; -} - -// Response for SearchJob method. -message SearchJobsResponse { - // Job entry with metadata inside [SearchJobsResponse][google.cloud.talent.v4beta1.SearchJobsResponse]. - message MatchingJob { - // Job resource that matches the specified [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - Job job = 1; - - // A summary of the job with core information that's displayed on the search - // results listing page. - string job_summary = 2; - - // Contains snippets of text from the [Job.title][google.cloud.talent.v4beta1.Job.title] field most - // closely matching a search query's keywords, if available. The matching - // query keywords are enclosed in HTML bold tags. - string job_title_snippet = 3; - - // Contains snippets of text from the [Job.description][google.cloud.talent.v4beta1.Job.description] and similar - // fields that most closely match a search query's keywords, if available. - // All HTML tags in the original fields are stripped when returned in this - // field, and matching query keywords are enclosed in HTML bold tags. - string search_text_snippet = 4; - - // Commute information which is generated based on specified - // [CommuteFilter][google.cloud.talent.v4beta1.CommuteFilter]. - CommuteInfo commute_info = 5; - } - - // Commute details related to this job. - message CommuteInfo { - // Location used as the destination in the commute calculation. - Location job_location = 1; - - // The number of seconds required to travel to the job location from the - // query location. A duration of 0 seconds indicates that the job isn't - // reachable within the requested duration, but was returned as part of an - // expanded query. - google.protobuf.Duration travel_duration = 2; - } - - // The Job entities that match the specified [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - repeated MatchingJob matching_jobs = 1; - - // The histogram results that match with specified - // [SearchJobsRequest.histogram_queries][google.cloud.talent.v4beta1.SearchJobsRequest.histogram_queries]. - repeated HistogramQueryResult histogram_query_results = 2; - - // The token that specifies the starting position of the next page of results. - // This field is empty if there are no more results. - string next_page_token = 3; - - // The location filters that the service applied to the specified query. If - // any filters are lat-lng based, the [Location.location_type][google.cloud.talent.v4beta1.Location.location_type] is - // [Location.LocationType.LOCATION_TYPE_UNSPECIFIED][google.cloud.talent.v4beta1.Location.LocationType.LOCATION_TYPE_UNSPECIFIED]. - repeated Location location_filters = 4; - - // An estimation of the number of jobs that match the specified query. - // - // This number isn't guaranteed to be accurate. For accurate results, - // see [SearchJobsRequest.require_precise_result_size][google.cloud.talent.v4beta1.SearchJobsRequest.require_precise_result_size]. - int32 estimated_total_size = 5; - - // The precise result count, which is available only if the client set - // [SearchJobsRequest.require_precise_result_size][google.cloud.talent.v4beta1.SearchJobsRequest.require_precise_result_size] to `true`, or if the - // response is the last page of results. Otherwise, the value is `-1`. - int32 total_size = 6; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 7; - - // If query broadening is enabled, we may append additional results from the - // broadened query. This number indicates how many of the jobs returned in the - // jobs field are from the broadened query. These results are always at the - // end of the jobs list. In particular, a value of 0, or if the field isn't - // set, all the jobs in the jobs list are from the original - // (without broadening) query. If this field is non-zero, subsequent requests - // with offset after this result set should contain all broadened results. - int32 broadened_query_jobs_count = 8; - - // The spell checking result, and correction. - SpellingCorrection spell_correction = 9; -} - -// Request to create a batch of jobs. -message BatchCreateJobsRequest { - // Required. The resource name of the tenant under which the job is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Required. The jobs to be created. - repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request to update a batch of jobs. -message BatchUpdateJobsRequest { - // Required. The resource name of the tenant under which the job is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenant/bar". If tenant id is unspecified, a default tenant - // is created. For example, "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "jobs.googleapis.com/Job" - } - ]; - - // Required. The jobs to be updated. - repeated Job jobs = 2 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. Be aware that it will - // also increase latency when checking the status of a batch operation. - // - // If [update_mask][google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask] is provided, only the specified fields in - // [Job][google.cloud.talent.v4beta1.Job] are updated. Otherwise all the fields are updated. - // - // A field mask to restrict the fields that are updated. Only - // top level fields of [Job][google.cloud.talent.v4beta1.Job] are supported. - // - // If [update_mask][google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask] is provided, The [Job][google.cloud.talent.v4beta1.Job] inside - // [JobResult][google.cloud.talent.v4beta1.JobOperationResult.JobResult] - // will only contains fields that is updated, plus the Id of the Job. - // Otherwise, [Job][google.cloud.talent.v4beta1.Job] will include all fields, which can yield a very - // large response. - google.protobuf.FieldMask update_mask = 3; -} - -// The result of [JobService.BatchCreateJobs][google.cloud.talent.v4beta1.JobService.BatchCreateJobs] or -// [JobService.BatchUpdateJobs][google.cloud.talent.v4beta1.JobService.BatchUpdateJobs] APIs. It's used to -// replace [google.longrunning.Operation.response][google.longrunning.Operation.response] in case of success. -message JobOperationResult { - // Mutation result of a job. - message JobResult { - // Here [Job][google.cloud.talent.v4beta1.Job] only contains basic information including [name][google.cloud.talent.v4beta1.Job.name], - // [company][google.cloud.talent.v4beta1.Job.company], [language_code][google.cloud.talent.v4beta1.Job.language_code] - // and [requisition_id][google.cloud.talent.v4beta1.Job.requisition_id], use getJob method to retrieve - // detailed information of the created/updated job. - Job job = 1; - - // The status of the job processed. This field is populated if the - // processing of the [job][google.cloud.talent.v4beta1.JobOperationResult.JobResult.job] fails. - google.rpc.Status status = 2; - } - - // List of job mutation results from a batch mutate operation. It can change - // until operation status is FINISHED, FAILED or CANCELLED. - repeated JobResult job_results = 1; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/job_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/job_service_pb2.py deleted file mode 100644 index 014959dc4cac..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job_service_pb2.py +++ /dev/null @@ -1,2581 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/job_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - filters_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - histogram_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - job_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/job_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\017JobServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n3google/cloud/talent_v4beta1/proto/job_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a/google/cloud/talent_v4beta1/proto/filters.proto\x1a\x31google/cloud/talent_v4beta1/proto/histogram.proto\x1a+google/cloud/talent_v4beta1/proto/job.proto\x1a#google/longrunning/operations.proto\x1a\x19google/protobuf/any.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto"w\n\x10\x43reateJobRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x32\n\x03job\x18\x02 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02">\n\rGetJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job"w\n\x10UpdateJobRequest\x12\x32\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"A\n\x10\x44\x65leteJobRequest\x12-\n\x04name\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\n\x17jobs.googleapis.com/Job"^\n\x16\x42\x61tchDeleteJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02"\xb6\x01\n\x0fListJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x13\n\x06\x66ilter\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x36\n\x08job_view\x18\x05 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView"\x9c\x01\n\x10ListJobsResponse\x12.\n\x04jobs\x18\x01 \x03(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata"\xd0\t\n\x11SearchJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12N\n\x0bsearch_mode\x18\x02 \x01(\x0e\x32\x39.google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode\x12K\n\x10request_metadata\x18\x03 \x01(\x0b\x32,.google.cloud.talent.v4beta1.RequestMetadataB\x03\xe0\x41\x02\x12\x38\n\tjob_query\x18\x04 \x01(\x0b\x32%.google.cloud.talent.v4beta1.JobQuery\x12\x19\n\x11\x65nable_broadening\x18\x05 \x01(\x08\x12#\n\x1brequire_precise_result_size\x18\x06 \x01(\x08\x12\x46\n\x11histogram_queries\x18\x07 \x03(\x0b\x32+.google.cloud.talent.v4beta1.HistogramQuery\x12\x36\n\x08job_view\x18\x08 \x01(\x0e\x32$.google.cloud.talent.v4beta1.JobView\x12\x0e\n\x06offset\x18\t \x01(\x05\x12\x11\n\tpage_size\x18\n \x01(\x05\x12\x12\n\npage_token\x18\x0b \x01(\t\x12\x10\n\x08order_by\x18\x0c \x01(\t\x12\x62\n\x15\x64iversification_level\x18\r \x01(\x0e\x32\x43.google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel\x12]\n\x13\x63ustom_ranking_info\x18\x0e \x01(\x0b\x32@.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo\x12\x1d\n\x15\x64isable_keyword_match\x18\x10 \x01(\x08\x1a\x9a\x02\n\x11\x43ustomRankingInfo\x12o\n\x10importance_level\x18\x01 \x01(\x0e\x32P.google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevelB\x03\xe0\x41\x02\x12\x1f\n\x12ranking_expression\x18\x02 \x01(\tB\x03\xe0\x41\x02"s\n\x0fImportanceLevel\x12 \n\x1cIMPORTANCE_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\x01\x12\x07\n\x03LOW\x10\x02\x12\x08\n\x04MILD\x10\x03\x12\n\n\x06MEDIUM\x10\x04\x12\x08\n\x04HIGH\x10\x05\x12\x0b\n\x07\x45XTREME\x10\x06"R\n\nSearchMode\x12\x1b\n\x17SEARCH_MODE_UNSPECIFIED\x10\x00\x12\x0e\n\nJOB_SEARCH\x10\x01\x12\x17\n\x13\x46\x45\x41TURED_JOB_SEARCH\x10\x02"W\n\x14\x44iversificationLevel\x12%\n!DIVERSIFICATION_LEVEL_UNSPECIFIED\x10\x00\x12\x0c\n\x08\x44ISABLED\x10\x01\x12\n\n\x06SIMPLE\x10\x02"\xd7\x06\n\x12SearchJobsResponse\x12R\n\rmatching_jobs\x18\x01 \x03(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob\x12R\n\x17histogram_query_results\x18\x02 \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.HistogramQueryResult\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t\x12?\n\x10location_filters\x18\x04 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x1c\n\x14\x65stimated_total_size\x18\x05 \x01(\x05\x12\x12\n\ntotal_size\x18\x06 \x01(\x05\x12?\n\x08metadata\x18\x07 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x12"\n\x1a\x62roadened_query_jobs_count\x18\x08 \x01(\x05\x12I\n\x10spell_correction\x18\t \x01(\x0b\x32/.google.cloud.talent.v4beta1.SpellingCorrection\x1a\xdc\x01\n\x0bMatchingJob\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12\x13\n\x0bjob_summary\x18\x02 \x01(\t\x12\x19\n\x11job_title_snippet\x18\x03 \x01(\t\x12\x1b\n\x13search_text_snippet\x18\x04 \x01(\t\x12Q\n\x0c\x63ommute_info\x18\x05 \x01(\x0b\x32;.google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo\x1a~\n\x0b\x43ommuteInfo\x12;\n\x0cjob_location\x18\x01 \x01(\x0b\x32%.google.cloud.talent.v4beta1.Location\x12\x32\n\x0ftravel_duration\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"~\n\x16\x42\x61tchCreateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02"\xaf\x01\n\x16\x42\x61tchUpdateJobsRequest\x12/\n\x06parent\x18\x01 \x01(\tB\x1f\xe0\x41\x02\xfa\x41\x19\x12\x17jobs.googleapis.com/Job\x12\x33\n\x04jobs\x18\x02 \x03(\x0b\x32 .google.cloud.talent.v4beta1.JobB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\xc4\x01\n\x12JobOperationResult\x12N\n\x0bjob_results\x18\x01 \x03(\x0b\x32\x39.google.cloud.talent.v4beta1.JobOperationResult.JobResult\x1a^\n\tJobResult\x12-\n\x03job\x18\x01 \x01(\x0b\x32 .google.cloud.talent.v4beta1.Job\x12"\n\x06status\x18\x02 \x01(\x0b\x32\x12.google.rpc.Status*v\n\x07JobView\x12\x18\n\x14JOB_VIEW_UNSPECIFIED\x10\x00\x12\x14\n\x10JOB_VIEW_ID_ONLY\x10\x01\x12\x14\n\x10JOB_VIEW_MINIMAL\x10\x02\x12\x12\n\x0eJOB_VIEW_SMALL\x10\x03\x12\x11\n\rJOB_VIEW_FULL\x10\x04\x32\xce\x12\n\nJobService\x12\xc9\x01\n\tCreateJob\x12-.google.cloud.talent.v4beta1.CreateJobRequest\x1a .google.cloud.talent.v4beta1.Job"k\x82\xd3\xe4\x93\x02X"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\x01*Z&"!/v4beta1/{parent=projects/*}/jobs:\x01*\xda\x41\nparent,job\x12\x9b\x02\n\x0f\x42\x61tchCreateJobs\x12\x33.google.cloud.talent.v4beta1.BatchCreateJobsRequest\x1a\x1d.google.longrunning.Operation"\xb3\x01\x82\xd3\xe4\x93\x02p"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\x01*Z2"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb7\x01\n\x06GetJob\x12*.google.cloud.talent.v4beta1.GetJobRequest\x1a .google.cloud.talent.v4beta1.Job"_\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\x12!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xca\x01\n\tUpdateJob\x12-.google.cloud.talent.v4beta1.UpdateJobRequest\x1a .google.cloud.talent.v4beta1.Job"l\x82\xd3\xe4\x93\x02`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\x01*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\x01*\xda\x41\x03job\x12\x9b\x02\n\x0f\x42\x61tchUpdateJobs\x12\x33.google.cloud.talent.v4beta1.BatchUpdateJobsRequest\x1a\x1d.google.longrunning.Operation"\xb3\x01\x82\xd3\xe4\x93\x02p"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\x01*Z2"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\x01*\xda\x41\x0bparent,jobs\xca\x41,\n\x12JobOperationResult\x12\x16\x42\x61tchOperationMetadata\x12\xb3\x01\n\tDeleteJob\x12-.google.cloud.talent.v4beta1.DeleteJobRequest\x1a\x16.google.protobuf.Empty"_\x82\xd3\xe4\x93\x02R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\xda\x41\x04name\x12\xe4\x01\n\x0f\x42\x61tchDeleteJobs\x12\x33.google.cloud.talent.v4beta1.BatchDeleteJobsRequest\x1a\x16.google.protobuf.Empty"\x83\x01\x82\xd3\xe4\x93\x02m"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\x01*Z/"-/v4beta1/{parent=projects/*}/jobs:batchDelete\xda\x41\rparent,filter\x12\xd1\x01\n\x08ListJobs\x12,.google.cloud.talent.v4beta1.ListJobsRequest\x1a-.google.cloud.talent.v4beta1.ListJobsResponse"h\x82\xd3\xe4\x93\x02R\x12+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\x12!/v4beta1/{parent=projects/*}/jobs\xda\x41\rparent,filter\x12\xdb\x01\n\nSearchJobs\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse"l\x82\xd3\xe4\x93\x02\x66"2/v4beta1/{parent=projects/*/tenants/*}/jobs:search:\x01*Z-"(/v4beta1/{parent=projects/*}/jobs:search:\x01*\x12\xf3\x01\n\x12SearchJobsForAlert\x12..google.cloud.talent.v4beta1.SearchJobsRequest\x1a/.google.cloud.talent.v4beta1.SearchJobsResponse"|\x82\xd3\xe4\x93\x02v":/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert:\x01*Z5"0/v4beta1/{parent=projects/*}/jobs:searchForAlert:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB}\n\x1f\x63om.google.cloud.talent.v4beta1B\x0fJobServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_JOBVIEW = _descriptor.EnumDescriptor( - name="JobView", - full_name="google.cloud.talent.v4beta1.JobView", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="JOB_VIEW_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_VIEW_ID_ONLY", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_VIEW_MINIMAL", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_VIEW_SMALL", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="JOB_VIEW_FULL", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3987, - serialized_end=4105, -) -_sym_db.RegisterEnumDescriptor(_JOBVIEW) - -JobView = enum_type_wrapper.EnumTypeWrapper(_JOBVIEW) -JOB_VIEW_UNSPECIFIED = 0 -JOB_VIEW_ID_ONLY = 1 -JOB_VIEW_MINIMAL = 2 -JOB_VIEW_SMALL = 3 -JOB_VIEW_FULL = 4 - - -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO_IMPORTANCELEVEL = _descriptor.EnumDescriptor( - name="ImportanceLevel", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ImportanceLevel", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="IMPORTANCE_LEVEL_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NONE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOW", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MILD", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MEDIUM", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HIGH", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EXTREME", index=6, number=6, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2334, - serialized_end=2449, -) -_sym_db.RegisterEnumDescriptor(_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO_IMPORTANCELEVEL) - -_SEARCHJOBSREQUEST_SEARCHMODE = _descriptor.EnumDescriptor( - name="SearchMode", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.SearchMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SEARCH_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="JOB_SEARCH", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FEATURED_JOB_SEARCH", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2451, - serialized_end=2533, -) -_sym_db.RegisterEnumDescriptor(_SEARCHJOBSREQUEST_SEARCHMODE) - -_SEARCHJOBSREQUEST_DIVERSIFICATIONLEVEL = _descriptor.EnumDescriptor( - name="DiversificationLevel", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.DiversificationLevel", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DIVERSIFICATION_LEVEL_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="DISABLED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SIMPLE", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2535, - serialized_end=2622, -) -_sym_db.RegisterEnumDescriptor(_SEARCHJOBSREQUEST_DIVERSIFICATIONLEVEL) - - -_CREATEJOBREQUEST = _descriptor.Descriptor( - name="CreateJobRequest", - full_name="google.cloud.talent.v4beta1.CreateJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateJobRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.talent.v4beta1.CreateJobRequest.job", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=576, - serialized_end=695, -) - - -_GETJOBREQUEST = _descriptor.Descriptor( - name="GetJobRequest", - full_name="google.cloud.talent.v4beta1.GetJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.GetJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\n\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=697, - serialized_end=759, -) - - -_UPDATEJOBREQUEST = _descriptor.Descriptor( - name="UpdateJobRequest", - full_name="google.cloud.talent.v4beta1.UpdateJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.talent.v4beta1.UpdateJobRequest.job", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.UpdateJobRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=761, - serialized_end=880, -) - - -_DELETEJOBREQUEST = _descriptor.Descriptor( - name="DeleteJobRequest", - full_name="google.cloud.talent.v4beta1.DeleteJobRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.DeleteJobRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\n\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=882, - serialized_end=947, -) - - -_BATCHDELETEJOBSREQUEST = _descriptor.Descriptor( - name="BatchDeleteJobsRequest", - full_name="google.cloud.talent.v4beta1.BatchDeleteJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.BatchDeleteJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.talent.v4beta1.BatchDeleteJobsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=949, - serialized_end=1043, -) - - -_LISTJOBSREQUEST = _descriptor.Descriptor( - name="ListJobsRequest", - full_name="google.cloud.talent.v4beta1.ListJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.ListJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.talent.v4beta1.ListJobsRequest.filter", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.ListJobsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.ListJobsRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_view", - full_name="google.cloud.talent.v4beta1.ListJobsRequest.job_view", - index=4, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1046, - serialized_end=1228, -) - - -_LISTJOBSRESPONSE = _descriptor.Descriptor( - name="ListJobsResponse", - full_name="google.cloud.talent.v4beta1.ListJobsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="jobs", - full_name="google.cloud.talent.v4beta1.ListJobsResponse.jobs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.ListJobsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.ListJobsResponse.metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1231, - serialized_end=1387, -) - - -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO = _descriptor.Descriptor( - name="CustomRankingInfo", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="importance_level", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.importance_level", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="ranking_expression", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo.ranking_expression", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO_IMPORTANCELEVEL], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2167, - serialized_end=2449, -) - -_SEARCHJOBSREQUEST = _descriptor.Descriptor( - name="SearchJobsRequest", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="search_mode", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.search_mode", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="request_metadata", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.request_metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_query", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.job_query", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_broadening", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.enable_broadening", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="require_precise_result_size", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.require_precise_result_size", - index=5, - number=6, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram_queries", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.histogram_queries", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_view", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.job_view", - index=7, - number=8, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="offset", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.offset", - index=8, - number=9, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.page_size", - index=9, - number=10, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.page_token", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="order_by", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.order_by", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="diversification_level", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.diversification_level", - index=12, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_ranking_info", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.custom_ranking_info", - index=13, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disable_keyword_match", - full_name="google.cloud.talent.v4beta1.SearchJobsRequest.disable_keyword_match", - index=14, - number=16, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO], - enum_types=[_SEARCHJOBSREQUEST_SEARCHMODE, _SEARCHJOBSREQUEST_DIVERSIFICATIONLEVEL], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1390, - serialized_end=2622, -) - - -_SEARCHJOBSRESPONSE_MATCHINGJOB = _descriptor.Descriptor( - name="MatchingJob", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_summary", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job_summary", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title_snippet", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.job_title_snippet", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="search_text_snippet", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.search_text_snippet", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="commute_info", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob.commute_info", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3132, - serialized_end=3352, -) - -_SEARCHJOBSRESPONSE_COMMUTEINFO = _descriptor.Descriptor( - name="CommuteInfo", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job_location", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.job_location", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="travel_duration", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo.travel_duration", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3354, - serialized_end=3480, -) - -_SEARCHJOBSRESPONSE = _descriptor.Descriptor( - name="SearchJobsResponse", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="matching_jobs", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.matching_jobs", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram_query_results", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.histogram_query_results", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.next_page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_filters", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.location_filters", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="estimated_total_size", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.estimated_total_size", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_size", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.total_size", - index=5, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.metadata", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="broadened_query_jobs_count", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.broadened_query_jobs_count", - index=7, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spell_correction", - full_name="google.cloud.talent.v4beta1.SearchJobsResponse.spell_correction", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SEARCHJOBSRESPONSE_MATCHINGJOB, _SEARCHJOBSRESPONSE_COMMUTEINFO], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2625, - serialized_end=3480, -) - - -_BATCHCREATEJOBSREQUEST = _descriptor.Descriptor( - name="BatchCreateJobsRequest", - full_name="google.cloud.talent.v4beta1.BatchCreateJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.BatchCreateJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="jobs", - full_name="google.cloud.talent.v4beta1.BatchCreateJobsRequest.jobs", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3482, - serialized_end=3608, -) - - -_BATCHUPDATEJOBSREQUEST = _descriptor.Descriptor( - name="BatchUpdateJobsRequest", - full_name="google.cloud.talent.v4beta1.BatchUpdateJobsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.BatchUpdateJobsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\031\022\027jobs.googleapis.com/Job"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="jobs", - full_name="google.cloud.talent.v4beta1.BatchUpdateJobsRequest.jobs", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.BatchUpdateJobsRequest.update_mask", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3611, - serialized_end=3786, -) - - -_JOBOPERATIONRESULT_JOBRESULT = _descriptor.Descriptor( - name="JobResult", - full_name="google.cloud.talent.v4beta1.JobOperationResult.JobResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job", - full_name="google.cloud.talent.v4beta1.JobOperationResult.JobResult.job", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.cloud.talent.v4beta1.JobOperationResult.JobResult.status", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3891, - serialized_end=3985, -) - -_JOBOPERATIONRESULT = _descriptor.Descriptor( - name="JobOperationResult", - full_name="google.cloud.talent.v4beta1.JobOperationResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="job_results", - full_name="google.cloud.talent.v4beta1.JobOperationResult.job_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[_JOBOPERATIONRESULT_JOBRESULT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3789, - serialized_end=3985, -) - -_CREATEJOBREQUEST.fields_by_name[ - "job" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_UPDATEJOBREQUEST.fields_by_name[ - "job" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_UPDATEJOBREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTJOBSREQUEST.fields_by_name["job_view"].enum_type = _JOBVIEW -_LISTJOBSRESPONSE.fields_by_name[ - "jobs" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_LISTJOBSRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO.fields_by_name[ - "importance_level" -].enum_type = _SEARCHJOBSREQUEST_CUSTOMRANKINGINFO_IMPORTANCELEVEL -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO.containing_type = _SEARCHJOBSREQUEST -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO_IMPORTANCELEVEL.containing_type = ( - _SEARCHJOBSREQUEST_CUSTOMRANKINGINFO -) -_SEARCHJOBSREQUEST.fields_by_name[ - "search_mode" -].enum_type = _SEARCHJOBSREQUEST_SEARCHMODE -_SEARCHJOBSREQUEST.fields_by_name[ - "request_metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._REQUESTMETADATA -) -_SEARCHJOBSREQUEST.fields_by_name[ - "job_query" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2._JOBQUERY -) -_SEARCHJOBSREQUEST.fields_by_name[ - "histogram_queries" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2._HISTOGRAMQUERY -) -_SEARCHJOBSREQUEST.fields_by_name["job_view"].enum_type = _JOBVIEW -_SEARCHJOBSREQUEST.fields_by_name[ - "diversification_level" -].enum_type = _SEARCHJOBSREQUEST_DIVERSIFICATIONLEVEL -_SEARCHJOBSREQUEST.fields_by_name[ - "custom_ranking_info" -].message_type = _SEARCHJOBSREQUEST_CUSTOMRANKINGINFO -_SEARCHJOBSREQUEST_SEARCHMODE.containing_type = _SEARCHJOBSREQUEST -_SEARCHJOBSREQUEST_DIVERSIFICATIONLEVEL.containing_type = _SEARCHJOBSREQUEST -_SEARCHJOBSRESPONSE_MATCHINGJOB.fields_by_name[ - "job" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_SEARCHJOBSRESPONSE_MATCHINGJOB.fields_by_name[ - "commute_info" -].message_type = _SEARCHJOBSRESPONSE_COMMUTEINFO -_SEARCHJOBSRESPONSE_MATCHINGJOB.containing_type = _SEARCHJOBSRESPONSE -_SEARCHJOBSRESPONSE_COMMUTEINFO.fields_by_name[ - "job_location" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._LOCATION -) -_SEARCHJOBSRESPONSE_COMMUTEINFO.fields_by_name[ - "travel_duration" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_SEARCHJOBSRESPONSE_COMMUTEINFO.containing_type = _SEARCHJOBSRESPONSE -_SEARCHJOBSRESPONSE.fields_by_name[ - "matching_jobs" -].message_type = _SEARCHJOBSRESPONSE_MATCHINGJOB -_SEARCHJOBSRESPONSE.fields_by_name[ - "histogram_query_results" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2._HISTOGRAMQUERYRESULT -) -_SEARCHJOBSRESPONSE.fields_by_name[ - "location_filters" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._LOCATION -) -_SEARCHJOBSRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -_SEARCHJOBSRESPONSE.fields_by_name[ - "spell_correction" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._SPELLINGCORRECTION -) -_BATCHCREATEJOBSREQUEST.fields_by_name[ - "jobs" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_BATCHUPDATEJOBSREQUEST.fields_by_name[ - "jobs" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_BATCHUPDATEJOBSREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_JOBOPERATIONRESULT_JOBRESULT.fields_by_name[ - "job" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB -_JOBOPERATIONRESULT_JOBRESULT.fields_by_name[ - "status" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_JOBOPERATIONRESULT_JOBRESULT.containing_type = _JOBOPERATIONRESULT -_JOBOPERATIONRESULT.fields_by_name[ - "job_results" -].message_type = _JOBOPERATIONRESULT_JOBRESULT -DESCRIPTOR.message_types_by_name["CreateJobRequest"] = _CREATEJOBREQUEST -DESCRIPTOR.message_types_by_name["GetJobRequest"] = _GETJOBREQUEST -DESCRIPTOR.message_types_by_name["UpdateJobRequest"] = _UPDATEJOBREQUEST -DESCRIPTOR.message_types_by_name["DeleteJobRequest"] = _DELETEJOBREQUEST -DESCRIPTOR.message_types_by_name["BatchDeleteJobsRequest"] = _BATCHDELETEJOBSREQUEST -DESCRIPTOR.message_types_by_name["ListJobsRequest"] = _LISTJOBSREQUEST -DESCRIPTOR.message_types_by_name["ListJobsResponse"] = _LISTJOBSRESPONSE -DESCRIPTOR.message_types_by_name["SearchJobsRequest"] = _SEARCHJOBSREQUEST -DESCRIPTOR.message_types_by_name["SearchJobsResponse"] = _SEARCHJOBSRESPONSE -DESCRIPTOR.message_types_by_name["BatchCreateJobsRequest"] = _BATCHCREATEJOBSREQUEST -DESCRIPTOR.message_types_by_name["BatchUpdateJobsRequest"] = _BATCHUPDATEJOBSREQUEST -DESCRIPTOR.message_types_by_name["JobOperationResult"] = _JOBOPERATIONRESULT -DESCRIPTOR.enum_types_by_name["JobView"] = _JOBVIEW -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateJobRequest = _reflection.GeneratedProtocolMessageType( - "CreateJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEJOBREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Create job request. - - - Attributes: - parent: - Required. The resource name of the tenant under which the job - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenant/bar". If tenant id is unspecified a - default tenant is created. For example, "projects/foo". - job: - Required. The Job to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateJobRequest) - ), -) -_sym_db.RegisterMessage(CreateJobRequest) - -GetJobRequest = _reflection.GeneratedProtocolMessageType( - "GetJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETJOBREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Get job request. - - - Attributes: - name: - Required. The resource name of the job to retrieve. The - format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". - For example, "projects/foo/tenants/bar/jobs/baz". If tenant - id is unspecified, the default tenant is used. For example, - "projects/foo/jobs/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.GetJobRequest) - ), -) -_sym_db.RegisterMessage(GetJobRequest) - -UpdateJobRequest = _reflection.GeneratedProtocolMessageType( - "UpdateJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEJOBREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Update job request. - - - Attributes: - job: - Required. The Job to be updated. - update_mask: - Strongly recommended for the best service experience. If [upd - ate\_mask][google.cloud.talent.v4beta1.UpdateJobRequest.update - \_mask] is provided, only the specified fields in - [job][google.cloud.talent.v4beta1.UpdateJobRequest.job] are - updated. Otherwise all the fields are updated. A field mask - to restrict the fields that are updated. Only top level fields - of [Job][google.cloud.talent.v4beta1.Job] are supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.UpdateJobRequest) - ), -) -_sym_db.RegisterMessage(UpdateJobRequest) - -DeleteJobRequest = _reflection.GeneratedProtocolMessageType( - "DeleteJobRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEJOBREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Delete job request. - - - Attributes: - name: - Required. The resource name of the job to be deleted. The - format is - "projects/{project\_id}/tenants/{tenant\_id}/jobs/{job\_id}". - For example, "projects/foo/tenants/bar/jobs/baz". If tenant - id is unspecified, the default tenant is used. For example, - "projects/foo/jobs/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeleteJobRequest) - ), -) -_sym_db.RegisterMessage(DeleteJobRequest) - -BatchDeleteJobsRequest = _reflection.GeneratedProtocolMessageType( - "BatchDeleteJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHDELETEJOBSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Batch delete jobs request. - - - Attributes: - parent: - Required. The resource name of the tenant under which the job - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - filter: - Required. The filter string specifies the jobs to be deleted. - Supported operator: =, AND The fields eligible for filtering - are: - ``companyName`` (Required) - ``requisitionId`` - (Required) Sample Query: companyName = - "projects/foo/companies/bar" AND requisitionId = "req-1" - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.BatchDeleteJobsRequest) - ), -) -_sym_db.RegisterMessage(BatchDeleteJobsRequest) - -ListJobsRequest = _reflection.GeneratedProtocolMessageType( - "ListJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTJOBSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""List jobs request. - - - Attributes: - parent: - Required. The resource name of the tenant under which the job - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - filter: - Required. The filter string specifies the jobs to be - enumerated. Supported operator: =, AND The fields eligible - for filtering are: - ``companyName`` (Required) - - ``requisitionId`` - ``status`` Available values: OPEN, - EXPIRED, ALL. Defaults to OPEN if no value is specified. - Sample Query: - companyName = - "projects/foo/tenants/bar/companies/baz" - companyName = - "projects/foo/tenants/bar/companies/baz" AND requisitionId - = "req-1" - companyName = - "projects/foo/tenants/bar/companies/baz" AND status = - "EXPIRED" - page_token: - The starting point of a query result. - page_size: - The maximum number of jobs to be returned per page of results. - If [job\_view][google.cloud.talent.v4beta1.ListJobsRequest.job - \_view] is set to [JobView.JOB\_VIEW\_ID\_ONLY][google.cloud.t - alent.v4beta1.JobView.JOB\_VIEW\_ID\_ONLY], the maximum - allowed page size is 1000. Otherwise, the maximum allowed page - size is 100. Default is 100 if empty or a number < 1 is - specified. - job_view: - The desired job attributes returned for jobs in the search - response. Defaults to [JobView.JOB\_VIEW\_FULL][google.cloud.t - alent.v4beta1.JobView.JOB\_VIEW\_FULL] if no value is - specified. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListJobsRequest) - ), -) -_sym_db.RegisterMessage(ListJobsRequest) - -ListJobsResponse = _reflection.GeneratedProtocolMessageType( - "ListJobsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTJOBSRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""List jobs response. - - - Attributes: - jobs: - The Jobs for a given company. The maximum number of items - returned is based on the limit field provided in the request. - next_page_token: - A token to retrieve the next page of results. - metadata: - Additional information for the API invocation, such as the - request tracking id. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListJobsResponse) - ), -) -_sym_db.RegisterMessage(ListJobsResponse) - -SearchJobsRequest = _reflection.GeneratedProtocolMessageType( - "SearchJobsRequest", - (_message.Message,), - dict( - CustomRankingInfo=_reflection.GeneratedProtocolMessageType( - "CustomRankingInfo", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Custom ranking information for - [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - - - Attributes: - importance_level: - Required. Controls over how important the score of [CustomRank - ingInfo.ranking\_expression][google.cloud.talent.v4beta1.Searc - hJobsRequest.CustomRankingInfo.ranking\_expression] gets - applied to job's final ranking position. An error is thrown - if not specified. - ranking_expression: - Required. Controls over how job documents get ranked on top of - existing relevance score (determined by API algorithm). A - combination of the ranking expression and relevance score is - used to determine job's final ranking position. The syntax - for this expression is a subset of Google SQL syntax. - Supported operators are: +, -, \*, /, where the left and right - side of the operator is either a numeric [Job.custom\_attribut - es][google.cloud.talent.v4beta1.Job.custom\_attributes] key, - integer/double value or an expression that can be evaluated to - a number. Parenthesis are supported to adjust calculation - precedence. The expression must be < 100 characters in length. - The expression is considered invalid for a job if the - expression references custom attributes that are not populated - on the job or if the expression results in a divide by zero. - If an expression is invalid for a job, that job is demoted to - the end of the results. Sample ranking expression (year + 25) - \* 0.25 - (freshness / 0.5) - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchJobsRequest.CustomRankingInfo) - ), - ), - DESCRIPTOR=_SEARCHJOBSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""The Request body of the ``SearchJobs`` call. - - - Attributes: - parent: - Required. The resource name of the tenant to search within. - The format is "projects/{project\_id}/tenants/{tenant\_id}". - For example, "projects/foo/tenant/bar". If tenant id is - unspecified, a default tenant is created. For example, - "projects/foo". - search_mode: - Mode of a search. Defaults to [SearchMode.JOB\_SEARCH][google - .cloud.talent.v4beta1.SearchJobsRequest.SearchMode.JOB\_SEARCH - ]. - request_metadata: - Required. The meta information collected about the job - searcher, used to improve the search quality of the service. - The identifiers (such as ``user_id``) are provided by users, - and must be unique and consistent. - job_query: - Query used to search against jobs, such as keyword, location - filters, etc. - enable_broadening: - Controls whether to broaden the search when it produces sparse - results. Broadened queries append results to the end of the - matching results list. Defaults to false. - require_precise_result_size: - Controls if the search job request requires the return of a - precise count of the first 300 results. Setting this to - ``true`` ensures consistency in the number of results per - page. Best practice is to set this value to true if a client - allows users to jump directly to a non-sequential search - results page. Enabling this flag may adversely impact - performance. Defaults to false. - histogram_queries: - An expression specifies a histogram request against matching - jobs. Expression syntax is an aggregation function call with - histogram facets and other options. Available aggregation - function calls are: \* ``count(string_histogram_facet)``: - Count the number of matching entities, for each distinct - attribute value. \* ``count(numeric_histogram_facet, list of - buckets)``: Count the number of matching entities within each - bucket. Data types: - Histogram facet: facet names with - format [a-zA-Z][a-zA-Z0-9\_]+. - String: string like "any - string with backslash escape for quote(")." - Number: whole - number and floating point number like 10, -1 and -0.01. - - List: list of elements with comma(,) separator surrounded by - square brackets, for example, [1, 2, 3] and ["one", "two", - "three"]. Built-in constants: - MIN (minimum number similar - to java Double.MIN\_VALUE) - MAX (maximum number similar to - java Double.MAX\_VALUE) Built-in functions: - bucket(start, - end[, label]): bucket built-in function creates a bucket - with range of [start, end). Note that the end is exclusive, - for example, bucket(1, MAX, "positive number") or bucket(1, - 10). Job histogram facets: - company\_display\_name: - histogram by [Job.company\_display\_name][google.cloud.tale - nt.v4beta1.Job.company\_display\_name]. - employment\_type: - histogram by [Job.employment\_types][google.cloud.talent.v4 - beta1.Job.employment\_types], for example, "FULL\_TIME", - "PART\_TIME". - company\_size: histogram by - [CompanySize][google.cloud.talent.v4beta1.CompanySize], for - example, "SMALL", "MEDIUM", "BIG". - - publish\_time\_in\_month: histogram by the [Job.posting\_pu - blish\_time][google.cloud.talent.v4beta1.Job.posting\_publish\ - _time] in months. Must specify list of numeric buckets in - spec. - publish\_time\_in\_year: histogram by the [Job.pos - ting\_publish\_time][google.cloud.talent.v4beta1.Job.posting\_ - publish\_time] in years. Must specify list of numeric - buckets in spec. - degree\_types: histogram by the [Job.de - gree\_types][google.cloud.talent.v4beta1.Job.degree\_types], - for example, "Bachelors", "Masters". - job\_level: histogram - by the - [Job.job\_level][google.cloud.talent.v4beta1.Job.job\_level], - for example, "Entry Level". - country: histogram by the - country code of jobs, for example, "US", "FR". - admin1: - histogram by the admin1 code of jobs, which is a global - placeholder referring to the state, province, or the - particular term a country uses to define the geographic - structure below the country level, for example, "CA", "IL". - - city: histogram by a combination of the "city name, admin1 - code". For example, "Mountain View, CA", "New York, NY". - - admin1\_country: histogram by a combination of the "admin1 - code, country", for example, "CA, US", "IL, US". - - city\_coordinate: histogram by the city center's GPS - coordinates (latitude and longitude), for example, - 37.4038522,-122.0987765. Since the coordinates of a city - center can change, customers may need to refresh them - periodically. - locale: histogram by the [Job.language\_co - de][google.cloud.talent.v4beta1.Job.language\_code], for - example, "en-US", "fr-FR". - language: histogram by the - language subtag of the [Job.language\_code][google.cloud.ta - lent.v4beta1.Job.language\_code], for example, "en", "fr". - - category: histogram by the - [JobCategory][google.cloud.talent.v4beta1.JobCategory], for - example, "COMPUTER\_AND\_IT", "HEALTHCARE". - - base\_compensation\_unit: histogram by the [CompensationInf - o.CompensationUnit][google.cloud.talent.v4beta1.CompensationIn - fo.CompensationUnit] of base salary, for example, "WEEKLY", - "MONTHLY". - base\_compensation: histogram by the base - salary. Must specify list of numeric buckets to group - results by. - annualized\_base\_compensation: histogram by - the base annualized salary. Must specify list of numeric - buckets to group results by. - - annualized\_total\_compensation: histogram by the total - annualized salary. Must specify list of numeric buckets to - group results by. - string\_custom\_attribute: histogram by - string [Job.custom\_attributes][google.cloud.talent.v4beta1 - .Job.custom\_attributes]. Values can be accessed via square - bracket notations like string\_custom\_attribute["key1"]. - - numeric\_custom\_attribute: histogram by numeric [Job.custo - m\_attributes][google.cloud.talent.v4beta1.Job.custom\_attribu - tes]. Values can be accessed via square bracket notations - like numeric\_custom\_attribute["key1"]. Must specify list - of numeric buckets to group results by. Example - expressions: - ``count(admin1)`` - - ``count(base_compensation, [bucket(1000, 10000), bucket(10000, - 100000), bucket(100000, MAX)])`` - - ``count(string_custom_attribute["some-string-custom- - attribute"])`` - ``count(numeric_custom_attribute["some- - numeric-custom-attribute"], [bucket(MIN, 0, "negative"), - bucket(0, MAX, "non-negative"])`` - job_view: - The desired job attributes returned for jobs in the search - response. Defaults to [JobView.JOB\_VIEW\_SMALL][google.cloud. - talent.v4beta1.JobView.JOB\_VIEW\_SMALL] if no value is - specified. - offset: - An integer that specifies the current offset (that is, - starting result location, amongst the jobs deemed by the API - as relevant) in search results. This field is only considered - if [page\_token][google.cloud.talent.v4beta1.SearchJobsRequest - .page\_token] is unset. The maximum allowed value is 5000. - Otherwise an error is thrown. The maximum allowed value is - 5000. Otherwise an error is thrown. For example, 0 means to - return results starting from the first matching job, and 10 - means to return from the 11th job. This can be used for - pagination, (for example, pageSize = 10 and offset = 10 means - to return from the second page). - page_size: - A limit on the number of jobs returned in the search results. - Increasing this value above the default value of 10 can - increase search response time. The value can be between 1 and - 100. - page_token: - The token specifying the current offset within search results. - See [SearchJobsResponse.next\_page\_token][google.cloud.talent - .v4beta1.SearchJobsResponse.next\_page\_token] for an - explanation of how to obtain the next set of query results. - order_by: - The criteria determining how search results are sorted. - Default is ``"relevance desc"``. Supported options are: - - ``"relevance desc"``: By relevance descending, as determined - by the API algorithms. Relevance thresholding of query - results is only available with this ordering. - - ``"posting_publish_time desc"``: By [Job.posting\_publish\_ - time][google.cloud.talent.v4beta1.Job.posting\_publish\_time] - descending. - ``"posting_update_time desc"``: By [Job.post - ing\_update\_time][google.cloud.talent.v4beta1.Job.posting\_up - date\_time] descending. - ``"title"``: By - [Job.title][google.cloud.talent.v4beta1.Job.title] - ascending. - ``"title desc"``: By - [Job.title][google.cloud.talent.v4beta1.Job.title] descending. - - ``"annualized_base_compensation"``: By job's [Compensati - onInfo.annualized\_base\_compensation\_range][google.cloud.tal - ent.v4beta1.CompensationInfo.annualized\_base\_compensation\_r - ange] ascending. Jobs whose annualized base compensation is - unspecified are put at the end of search results. - - ``"annualized_base_compensation desc"``: By job's [Compensa - tionInfo.annualized\_base\_compensation\_range][google.cloud.t - alent.v4beta1.CompensationInfo.annualized\_base\_compensation\ - _range] descending. Jobs whose annualized base compensation - is unspecified are put at the end of search results. - - ``"annualized_total_compensation"``: By job's [Compensation - Info.annualized\_total\_compensation\_range][google.cloud.tale - nt.v4beta1.CompensationInfo.annualized\_total\_compensation\_r - ange] ascending. Jobs whose annualized base compensation is - unspecified are put at the end of search results. - - ``"annualized_total_compensation desc"``: By job's [Compens - ationInfo.annualized\_total\_compensation\_range][google.cloud - .talent.v4beta1.CompensationInfo.annualized\_total\_compensati - on\_range] descending. Jobs whose annualized base - compensation is unspecified are put at the end of search - results. - ``"custom_ranking desc"``: By the relevance score - adjusted to the [SearchJobsRequest.CustomRankingInfo.rankin - g\_expression][google.cloud.talent.v4beta1.SearchJobsRequest.C - ustomRankingInfo.ranking\_expression] with weight factor - assigned by [SearchJobsRequest.CustomRankingInfo.importance - \_level][google.cloud.talent.v4beta1.SearchJobsRequest.CustomR - ankingInfo.importance\_level] in descending order. - - Location sorting: Use the special syntax to order jobs by - distance: ``"distance_from('Hawaii')"``: Order by distance - from Hawaii. ``"distance_from(19.89, 155.5)"``: Order by - distance from a coordinate. ``"distance_from('Hawaii'), - distance_from('Puerto Rico')"``: Order by multiple - locations. See details below. ``"distance_from('Hawaii'), - distance_from(19.89, 155.5)"``: Order by multiple - locations. See details below. The string can have a maximum - of 256 characters. When multiple distance centers are - provided, a job that is close to any of the distance - centers would have a high rank. When a job has multiple - locations, the job location closest to one of the distance - centers will be used. Jobs that don't have locations will - be ranked at the bottom. Distance is calculated with a - precision of 11.3 meters (37.4 feet). Diversification - strategy is still applied unless explicitly disabled in - [diversification\_level][google.cloud.talent.v4beta1.SearchJob - sRequest.diversification\_level]. - diversification_level: - Controls whether highly similar jobs are returned next to each - other in the search results. Jobs are identified as highly - similar based on their titles, job categories, and locations. - Highly similar results are clustered so that only one - representative job of the cluster is displayed to the job - seeker higher up in the results, with the other jobs being - displayed lower down in the results. Defaults to [Diversifica - tionLevel.SIMPLE][google.cloud.talent.v4beta1.SearchJobsReques - t.DiversificationLevel.SIMPLE] if no value is specified. - custom_ranking_info: - Controls over how job documents get ranked on top of existing - relevance score (determined by API algorithm). - disable_keyword_match: - Controls whether to disable exact keyword match on - [Job.title][google.cloud.talent.v4beta1.Job.title], [Job.descr - iption][google.cloud.talent.v4beta1.Job.description], [Job.com - pany\_display\_name][google.cloud.talent.v4beta1.Job.company\_ - display\_name], - [Job.addresses][google.cloud.talent.v4beta1.Job.addresses], [J - ob.qualifications][google.cloud.talent.v4beta1.Job.qualificati - ons]. When disable keyword match is turned off, a keyword - match returns jobs that do not match given category filters - when there are matching keywords. For example, for the query - "program manager," a result is returned even if the job - posting has the title "software developer," which doesn't fall - into "program manager" ontology, but does have "program - manager" appearing in its description. For queries like - "cloud" that don't contain title or location specific - ontology, jobs with "cloud" keyword matches are returned - regardless of this flag's value. Use [Company.keyword\_search - able\_job\_custom\_attributes][google.cloud.talent.v4beta1.Com - pany.keyword\_searchable\_job\_custom\_attributes] if company- - specific globally matched custom field/attribute string values - are needed. Enabling keyword match improves recall of - subsequent search requests. Defaults to false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchJobsRequest) - ), -) -_sym_db.RegisterMessage(SearchJobsRequest) -_sym_db.RegisterMessage(SearchJobsRequest.CustomRankingInfo) - -SearchJobsResponse = _reflection.GeneratedProtocolMessageType( - "SearchJobsResponse", - (_message.Message,), - dict( - MatchingJob=_reflection.GeneratedProtocolMessageType( - "MatchingJob", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHJOBSRESPONSE_MATCHINGJOB, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Job entry with metadata inside - [SearchJobsResponse][google.cloud.talent.v4beta1.SearchJobsResponse]. - - - Attributes: - job: - Job resource that matches the specified [SearchJobsRequest][go - ogle.cloud.talent.v4beta1.SearchJobsRequest]. - job_summary: - A summary of the job with core information that's displayed on - the search results listing page. - job_title_snippet: - Contains snippets of text from the - [Job.title][google.cloud.talent.v4beta1.Job.title] field most - closely matching a search query's keywords, if available. The - matching query keywords are enclosed in HTML bold tags. - search_text_snippet: - Contains snippets of text from the - [Job.description][google.cloud.talent.v4beta1.Job.description] - and similar fields that most closely match a search query's - keywords, if available. All HTML tags in the original fields - are stripped when returned in this field, and matching query - keywords are enclosed in HTML bold tags. - commute_info: - Commute information which is generated based on specified - [CommuteFilter][google.cloud.talent.v4beta1.CommuteFilter]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchJobsResponse.MatchingJob) - ), - ), - CommuteInfo=_reflection.GeneratedProtocolMessageType( - "CommuteInfo", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHJOBSRESPONSE_COMMUTEINFO, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Commute details related to this job. - - - Attributes: - job_location: - Location used as the destination in the commute calculation. - travel_duration: - The number of seconds required to travel to the job location - from the query location. A duration of 0 seconds indicates - that the job isn't reachable within the requested duration, - but was returned as part of an expanded query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchJobsResponse.CommuteInfo) - ), - ), - DESCRIPTOR=_SEARCHJOBSRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Response for SearchJob method. - - - Attributes: - matching_jobs: - The Job entities that match the specified [SearchJobsRequest][ - google.cloud.talent.v4beta1.SearchJobsRequest]. - histogram_query_results: - The histogram results that match with specified [SearchJobsReq - uest.histogram\_queries][google.cloud.talent.v4beta1.SearchJob - sRequest.histogram\_queries]. - next_page_token: - The token that specifies the starting position of the next - page of results. This field is empty if there are no more - results. - location_filters: - The location filters that the service applied to the specified - query. If any filters are lat-lng based, the [Location.locatio - n\_type][google.cloud.talent.v4beta1.Location.location\_type] - is [Location.LocationType.LOCATION\_TYPE\_UNSPECIFIED][google. - cloud.talent.v4beta1.Location.LocationType.LOCATION\_TYPE\_UNS - PECIFIED]. - estimated_total_size: - An estimation of the number of jobs that match the specified - query. This number isn't guaranteed to be accurate. For - accurate results, see [SearchJobsRequest.require\_precise\_res - ult\_size][google.cloud.talent.v4beta1.SearchJobsRequest.requi - re\_precise\_result\_size]. - total_size: - The precise result count, which is available only if the - client set [SearchJobsRequest.require\_precise\_result\_size][ - google.cloud.talent.v4beta1.SearchJobsRequest.require\_precise - \_result\_size] to ``true``, or if the response is the last - page of results. Otherwise, the value is ``-1``. - metadata: - Additional information for the API invocation, such as the - request tracking id. - broadened_query_jobs_count: - If query broadening is enabled, we may append additional - results from the broadened query. This number indicates how - many of the jobs returned in the jobs field are from the - broadened query. These results are always at the end of the - jobs list. In particular, a value of 0, or if the field isn't - set, all the jobs in the jobs list are from the original - (without broadening) query. If this field is non-zero, - subsequent requests with offset after this result set should - contain all broadened results. - spell_correction: - The spell checking result, and correction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchJobsResponse) - ), -) -_sym_db.RegisterMessage(SearchJobsResponse) -_sym_db.RegisterMessage(SearchJobsResponse.MatchingJob) -_sym_db.RegisterMessage(SearchJobsResponse.CommuteInfo) - -BatchCreateJobsRequest = _reflection.GeneratedProtocolMessageType( - "BatchCreateJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHCREATEJOBSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Request to create a batch of jobs. - - - Attributes: - parent: - Required. The resource name of the tenant under which the job - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - jobs: - Required. The jobs to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.BatchCreateJobsRequest) - ), -) -_sym_db.RegisterMessage(BatchCreateJobsRequest) - -BatchUpdateJobsRequest = _reflection.GeneratedProtocolMessageType( - "BatchUpdateJobsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHUPDATEJOBSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Request to update a batch of jobs. - - - Attributes: - parent: - Required. The resource name of the tenant under which the job - is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenant/bar". If tenant id is unspecified, a - default tenant is created. For example, "projects/foo". - jobs: - Required. The jobs to be updated. - update_mask: - Strongly recommended for the best service experience. Be aware - that it will also increase latency when checking the status of - a batch operation. If [update\_mask][google.cloud.talent.v4be - ta1.BatchUpdateJobsRequest.update\_mask] is provided, only the - specified fields in [Job][google.cloud.talent.v4beta1.Job] are - updated. Otherwise all the fields are updated. A field mask - to restrict the fields that are updated. Only top level fields - of [Job][google.cloud.talent.v4beta1.Job] are supported. If [ - update\_mask][google.cloud.talent.v4beta1.BatchUpdateJobsReque - st.update\_mask] is provided, The - [Job][google.cloud.talent.v4beta1.Job] inside [JobResult][goog - le.cloud.talent.v4beta1.JobOperationResult.JobResult] will - only contains fields that is updated, plus the Id of the Job. - Otherwise, [Job][google.cloud.talent.v4beta1.Job] will include - all fields, which can yield a very large response. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.BatchUpdateJobsRequest) - ), -) -_sym_db.RegisterMessage(BatchUpdateJobsRequest) - -JobOperationResult = _reflection.GeneratedProtocolMessageType( - "JobOperationResult", - (_message.Message,), - dict( - JobResult=_reflection.GeneratedProtocolMessageType( - "JobResult", - (_message.Message,), - dict( - DESCRIPTOR=_JOBOPERATIONRESULT_JOBRESULT, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""Mutation result of a job. - - - Attributes: - job: - Here [Job][google.cloud.talent.v4beta1.Job] only contains - basic information including - [name][google.cloud.talent.v4beta1.Job.name], - [company][google.cloud.talent.v4beta1.Job.company], [language\ - _code][google.cloud.talent.v4beta1.Job.language\_code] and [re - quisition\_id][google.cloud.talent.v4beta1.Job.requisition\_id - ], use getJob method to retrieve detailed information of the - created/updated job. - status: - The status of the job processed. This field is populated if - the processing of the [job][google.cloud.talent.v4beta1.JobOpe - rationResult.JobResult.job] fails. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.JobOperationResult.JobResult) - ), - ), - DESCRIPTOR=_JOBOPERATIONRESULT, - __module__="google.cloud.talent_v4beta1.proto.job_service_pb2", - __doc__="""The result of - [JobService.BatchCreateJobs][google.cloud.talent.v4beta1.JobService.BatchCreateJobs] - or - [JobService.BatchUpdateJobs][google.cloud.talent.v4beta1.JobService.BatchUpdateJobs] - APIs. It's used to replace - [google.longrunning.Operation.response][google.longrunning.Operation.response] - in case of success. - - - Attributes: - job_results: - List of job mutation results from a batch mutate operation. It - can change until operation status is FINISHED, FAILED or - CANCELLED. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.JobOperationResult) - ), -) -_sym_db.RegisterMessage(JobOperationResult) -_sym_db.RegisterMessage(JobOperationResult.JobResult) - - -DESCRIPTOR._options = None -_CREATEJOBREQUEST.fields_by_name["parent"]._options = None -_CREATEJOBREQUEST.fields_by_name["job"]._options = None -_GETJOBREQUEST.fields_by_name["name"]._options = None -_UPDATEJOBREQUEST.fields_by_name["job"]._options = None -_DELETEJOBREQUEST.fields_by_name["name"]._options = None -_BATCHDELETEJOBSREQUEST.fields_by_name["parent"]._options = None -_BATCHDELETEJOBSREQUEST.fields_by_name["filter"]._options = None -_LISTJOBSREQUEST.fields_by_name["parent"]._options = None -_LISTJOBSREQUEST.fields_by_name["filter"]._options = None -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO.fields_by_name["importance_level"]._options = None -_SEARCHJOBSREQUEST_CUSTOMRANKINGINFO.fields_by_name[ - "ranking_expression" -]._options = None -_SEARCHJOBSREQUEST.fields_by_name["parent"]._options = None -_SEARCHJOBSREQUEST.fields_by_name["request_metadata"]._options = None -_BATCHCREATEJOBSREQUEST.fields_by_name["parent"]._options = None -_BATCHCREATEJOBSREQUEST.fields_by_name["jobs"]._options = None -_BATCHUPDATEJOBSREQUEST.fields_by_name["parent"]._options = None -_BATCHUPDATEJOBSREQUEST.fields_by_name["jobs"]._options = None - -_JOBSERVICE = _descriptor.ServiceDescriptor( - name="JobService", - full_name="google.cloud.talent.v4beta1.JobService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=4108, - serialized_end=6490, - methods=[ - _descriptor.MethodDescriptor( - name="CreateJob", - full_name="google.cloud.talent.v4beta1.JobService.CreateJob", - index=0, - containing_service=None, - input_type=_CREATEJOBREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB, - serialized_options=_b( - '\202\323\344\223\002X"+/v4beta1/{parent=projects/*/tenants/*}/jobs:\001*Z&"!/v4beta1/{parent=projects/*}/jobs:\001*\332A\nparent,job' - ), - ), - _descriptor.MethodDescriptor( - name="BatchCreateJobs", - full_name="google.cloud.talent.v4beta1.JobService.BatchCreateJobs", - index=1, - containing_service=None, - input_type=_BATCHCREATEJOBSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002p"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchCreate:\001*Z2"-/v4beta1/{parent=projects/*}/jobs:batchCreate:\001*\332A\013parent,jobs\312A,\n\022JobOperationResult\022\026BatchOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="GetJob", - full_name="google.cloud.talent.v4beta1.JobService.GetJob", - index=2, - containing_service=None, - input_type=_GETJOBREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB, - serialized_options=_b( - "\202\323\344\223\002R\022+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#\022!/v4beta1/{name=projects/*/jobs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateJob", - full_name="google.cloud.talent.v4beta1.JobService.UpdateJob", - index=3, - containing_service=None, - input_type=_UPDATEJOBREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2._JOB, - serialized_options=_b( - "\202\323\344\223\002`2//v4beta1/{job.name=projects/*/tenants/*/jobs/*}:\001*Z*2%/v4beta1/{job.name=projects/*/jobs/*}:\001*\332A\003job" - ), - ), - _descriptor.MethodDescriptor( - name="BatchUpdateJobs", - full_name="google.cloud.talent.v4beta1.JobService.BatchUpdateJobs", - index=4, - containing_service=None, - input_type=_BATCHUPDATEJOBSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002p"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchUpdate:\001*Z2"-/v4beta1/{parent=projects/*}/jobs:batchUpdate:\001*\332A\013parent,jobs\312A,\n\022JobOperationResult\022\026BatchOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteJob", - full_name="google.cloud.talent.v4beta1.JobService.DeleteJob", - index=5, - containing_service=None, - input_type=_DELETEJOBREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002R*+/v4beta1/{name=projects/*/tenants/*/jobs/*}Z#*!/v4beta1/{name=projects/*/jobs/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="BatchDeleteJobs", - full_name="google.cloud.talent.v4beta1.JobService.BatchDeleteJobs", - index=6, - containing_service=None, - input_type=_BATCHDELETEJOBSREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002m"7/v4beta1/{parent=projects/*/tenants/*}/jobs:batchDelete:\001*Z/"-/v4beta1/{parent=projects/*}/jobs:batchDelete\332A\rparent,filter' - ), - ), - _descriptor.MethodDescriptor( - name="ListJobs", - full_name="google.cloud.talent.v4beta1.JobService.ListJobs", - index=7, - containing_service=None, - input_type=_LISTJOBSREQUEST, - output_type=_LISTJOBSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002R\022+/v4beta1/{parent=projects/*/tenants/*}/jobsZ#\022!/v4beta1/{parent=projects/*}/jobs\332A\rparent,filter" - ), - ), - _descriptor.MethodDescriptor( - name="SearchJobs", - full_name="google.cloud.talent.v4beta1.JobService.SearchJobs", - index=8, - containing_service=None, - input_type=_SEARCHJOBSREQUEST, - output_type=_SEARCHJOBSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002f"2/v4beta1/{parent=projects/*/tenants/*}/jobs:search:\001*Z-"(/v4beta1/{parent=projects/*}/jobs:search:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="SearchJobsForAlert", - full_name="google.cloud.talent.v4beta1.JobService.SearchJobsForAlert", - index=9, - containing_service=None, - input_type=_SEARCHJOBSREQUEST, - output_type=_SEARCHJOBSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002v":/v4beta1/{parent=projects/*/tenants/*}/jobs:searchForAlert:\001*Z5"0/v4beta1/{parent=projects/*}/jobs:searchForAlert:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_JOBSERVICE) - -DESCRIPTOR.services_by_name["JobService"] = _JOBSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/job_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/job_service_pb2_grpc.py deleted file mode 100644 index ef7c5d03ac95..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/job_service_pb2_grpc.py +++ /dev/null @@ -1,232 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - job_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - job_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class JobServiceStub(object): - """A service handles job management, including job CRUD, enumeration and search. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateJob = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/CreateJob", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.CreateJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.FromString, - ) - self.BatchCreateJobs = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/BatchCreateJobs", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchCreateJobsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.GetJob = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/GetJob", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.GetJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.FromString, - ) - self.UpdateJob = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/UpdateJob", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.UpdateJobRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.FromString, - ) - self.BatchUpdateJobs = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/BatchUpdateJobs", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchUpdateJobsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.DeleteJob = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/DeleteJob", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.DeleteJobRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.BatchDeleteJobs = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/BatchDeleteJobs", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchDeleteJobsRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListJobs = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/ListJobs", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.ListJobsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.ListJobsResponse.FromString, - ) - self.SearchJobs = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/SearchJobs", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsResponse.FromString, - ) - self.SearchJobsForAlert = channel.unary_unary( - "/google.cloud.talent.v4beta1.JobService/SearchJobsForAlert", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsResponse.FromString, - ) - - -class JobServiceServicer(object): - """A service handles job management, including job CRUD, enumeration and search. - """ - - def CreateJob(self, request, context): - """Creates a new job. - - Typically, the job becomes searchable within 10 seconds, but it may take - up to 5 minutes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchCreateJobs(self, request, context): - """Begins executing a batch create jobs operation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetJob(self, request, context): - """Retrieves the specified job, whose status is OPEN or recently EXPIRED - within the last 90 days. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateJob(self, request, context): - """Updates specified job. - - Typically, updated contents become visible in search results within 10 - seconds, but it may take up to 5 minutes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchUpdateJobs(self, request, context): - """Begins executing a batch update jobs operation. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteJob(self, request, context): - """Deletes the specified job. - - Typically, the job becomes unsearchable within 10 seconds, but it may take - up to 5 minutes. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchDeleteJobs(self, request, context): - """Deletes a list of [Job][google.cloud.talent.v4beta1.Job]s by filter. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListJobs(self, request, context): - """Lists jobs by filter. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchJobs(self, request, context): - """Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - - This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs - present in the database, and only returns jobs that the caller has - permission to search against. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchJobsForAlert(self, request, context): - """Searches for jobs using the provided [SearchJobsRequest][google.cloud.talent.v4beta1.SearchJobsRequest]. - - This API call is intended for the use case of targeting passive job - seekers (for example, job seekers who have signed up to receive email - alerts about potential job opportunities), and has different algorithmic - adjustments that are targeted to passive job seekers. - - This call constrains the [visibility][google.cloud.talent.v4beta1.Job.visibility] of jobs - present in the database, and only returns jobs the caller has - permission to search against. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_JobServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateJob": grpc.unary_unary_rpc_method_handler( - servicer.CreateJob, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.CreateJobRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.SerializeToString, - ), - "BatchCreateJobs": grpc.unary_unary_rpc_method_handler( - servicer.BatchCreateJobs, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchCreateJobsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "GetJob": grpc.unary_unary_rpc_method_handler( - servicer.GetJob, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.GetJobRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.SerializeToString, - ), - "UpdateJob": grpc.unary_unary_rpc_method_handler( - servicer.UpdateJob, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.UpdateJobRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__pb2.Job.SerializeToString, - ), - "BatchUpdateJobs": grpc.unary_unary_rpc_method_handler( - servicer.BatchUpdateJobs, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchUpdateJobsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "DeleteJob": grpc.unary_unary_rpc_method_handler( - servicer.DeleteJob, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.DeleteJobRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "BatchDeleteJobs": grpc.unary_unary_rpc_method_handler( - servicer.BatchDeleteJobs, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.BatchDeleteJobsRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListJobs": grpc.unary_unary_rpc_method_handler( - servicer.ListJobs, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.ListJobsRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.ListJobsResponse.SerializeToString, - ), - "SearchJobs": grpc.unary_unary_rpc_method_handler( - servicer.SearchJobs, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsResponse.SerializeToString, - ), - "SearchJobsForAlert": grpc.unary_unary_rpc_method_handler( - servicer.SearchJobsForAlert, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_job__service__pb2.SearchJobsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.JobService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/profile.proto b/talent/google/cloud/talent_v4beta1/proto/profile.proto deleted file mode 100644 index 16d4e7149fa2..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile.proto +++ /dev/null @@ -1,784 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/type/date.proto"; -import "google/type/postal_address.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "ProfileResourceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// Cloud Profile Discovery API definition - -// A resource that represents the profile for a job candidate (also referred to -// as a "single-source profile"). -message Profile { - option (google.api.resource) = { - type: "jobs.googleapis.com/Profile" - pattern: "projects/{project}/tenants/{tenant}/profiles/{profile}" - }; - - // Required during profile update. - // - // Resource name assigned to a profile by the API. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}", - // for example, "projects/foo/tenants/bar/profiles/baz". - string name = 1; - - // Profile's id in client system, if available. This value is unique for each - // profile inside a tenant. An error is thrown if another profile with the - // same external_id is created. - // - // The maximum number of bytes allowed is 100. - string external_id = 2; - - // The source description indicating where the profile is acquired. - // - // For example, if a candidate profile is acquired from a resume, the user can - // input "resume" here to indicate the source. - // - // The maximum number of bytes allowed is 100. - string source = 3; - - // The URI set by clients that links to this profile's client-side copy. - // - // The maximum number of bytes allowed is 4000. - string uri = 4; - - // The cluster id of the profile to associate with other profile(s) for the - // same candidate. - // - // This field should be generated by the customer. If a value is not provided, - // a random UUID is assigned to this field of the profile. - // - // This is used to link multiple profiles to the same candidate. For example, - // a client has a candidate with two profiles, where one was created recently - // and the other one was created 5 years ago. These two profiles may be very - // different. The clients can create the first profile and get a generated - // [group_id][google.cloud.talent.v4beta1.Profile.group_id], and assign it when the second profile is created, - // indicating these two profiles are referring to the same candidate. - string group_id = 5; - - // Indicates the hirable status of the candidate. - google.protobuf.BoolValue is_hirable = 6; - - // The timestamp when the profile was first created at this source. - google.protobuf.Timestamp create_time = 7; - - // The timestamp when the profile was last updated at this source. - google.protobuf.Timestamp update_time = 8; - - // The timestamp when the profile was last updated as a result of a direct or - // indirect action by a candidate. - // - // These actions include: - // - // * Direct actions such as the candidate submitting a new resume as part of a - // job application to the agency, using a self-service tool such as a website - // to update their profile, and so on. - // * Indirect actions by the candidate such as uploading a resume to a job - // board that is collected by the agency through a feed, providing a resume to - // a recruiter who then uploads it into the ATS, and so on. - // * Updates made to the candidate's profile by the recruiter as a result of - // interacting with the candidate (for example adding a skill or work - // preference, and so on). Changes to [recruiting_notes][google.cloud.talent.v4beta1.Profile.recruiting_notes] are specifically - // excluded from this action type. - // - // Note: [candidate_update_time][google.cloud.talent.v4beta1.Profile.candidate_update_time] must be greater than or equal to - // [resume_update_time][google.cloud.talent.v4beta1.Profile.resume_update_time] or an error is thrown. - google.protobuf.Timestamp candidate_update_time = 67; - - // The timestamp when the candidate's resume was added or updated on the - // candidate's profile. Whether that resume was directly uploaded by a - // candidate, pulled from a 3rd party job board feed, added by a recruiter, - // and so on. - // - // If this field is updated, it's expected that [resume][google.cloud.talent.v4beta1.Profile.resume] is provided in - // the create or update calls. - google.protobuf.Timestamp resume_update_time = 68; - - // The resume representing this profile. - Resume resume = 53; - - // The names of the candidate this profile references. - // - // Currently only one person name is supported. - repeated PersonName person_names = 11; - - // The candidate's postal addresses. It's highly recommended to - // input this information as accurately as possible to help improve search - // quality. Here are some recommendations: - // - // * Provide [Address.usage][google.cloud.talent.v4beta1.Address.usage] if possible, especially if the address is - // PERSONAL. During a search only personal addresses are considered. If there - // is no such address, all addresses with unspecified usage are assumed to be - // personal. - // * Provide [Address.current][google.cloud.talent.v4beta1.Address.current] for the current address if possible. During - // a search, only current addresses are considered. If there is no such - // address, all addresses are assumed to be current. - // - // When displaying a candidate's addresses, it is sometimes desirable to limit - // the number of addresses shown. In these cases we recommend that you display - // the addresses in the following order of priority: - // 1. [Address.usage][google.cloud.talent.v4beta1.Address.usage] is PERSONAL and [Address.current][google.cloud.talent.v4beta1.Address.current] is true. - // 2. [Address.usage][google.cloud.talent.v4beta1.Address.usage] is PERSONAL and [Address.current][google.cloud.talent.v4beta1.Address.current] is false or not - // set. - // 3. [Address.usage][google.cloud.talent.v4beta1.Address.usage] is CONTACT_INFO_USAGE_UNSPECIFIED and - // [Address.current][google.cloud.talent.v4beta1.Address.current] is true. - // 4. [Address.usage][google.cloud.talent.v4beta1.Address.usage] is CONTACT_INFO_USAGE_UNSPECIFIED and - // [Address.current][google.cloud.talent.v4beta1.Address.current] is false or not set. - repeated Address addresses = 12; - - // The candidate's email addresses. - repeated Email email_addresses = 13; - - // The candidate's phone number(s). - repeated Phone phone_numbers = 14; - - // The candidate's personal URIs. - repeated PersonalUri personal_uris = 15; - - // Available contact information besides [addresses][google.cloud.talent.v4beta1.Profile.addresses], [email_addresses][google.cloud.talent.v4beta1.Profile.email_addresses], - // [phone_numbers][google.cloud.talent.v4beta1.Profile.phone_numbers] and [personal_uris][google.cloud.talent.v4beta1.Profile.personal_uris]. For example, Hang-out, Skype. - repeated AdditionalContactInfo additional_contact_info = 16; - - // The employment history records of the candidate. It's highly recommended - // to input this information as accurately as possible to help improve search - // quality. Here are some recommendations: - // - // * Specify the start and end dates of the employment records. - // * List different employment types separately, no matter how minor the - // change is. - // For example, only job title is changed from "software engineer" to "senior - // software engineer". - // * Provide [EmploymentRecord.is_current][google.cloud.talent.v4beta1.EmploymentRecord.is_current] for the current employment if - // possible. If not, it's inferred from user inputs. - // - // The limitation for max number of employment records is 100. - repeated EmploymentRecord employment_records = 17; - - // The education history record of the candidate. It's highly recommended to - // input this information as accurately as possible to help improve search - // quality. Here are some recommendations: - // - // * Specify the start and end dates of the education records. - // * List each education type separately, no matter how minor the change is. - // For example, the profile contains the education experience from the same - // school but different degrees. - // * Provide [EducationRecord.is_current][google.cloud.talent.v4beta1.EducationRecord.is_current] for the current education if - // possible. If not, it's inferred from user inputs. - // - // The limitation for max number of education records is 100. - repeated EducationRecord education_records = 18; - - // The skill set of the candidate. It's highly recommended to provide as - // much information as possible to help improve the search quality. - // - // The limitation for max number of skills is 500. - repeated Skill skills = 19; - - // The individual or collaborative activities which the candidate has - // participated in, for example, open-source projects, class assignments that - // aren't listed in [employment_records][google.cloud.talent.v4beta1.Profile.employment_records]. - // - // The limitation for max number of activities is 50. - repeated Activity activities = 20; - - // The publications published by the candidate. - // - // The limitation for max number of publications is 50. - repeated Publication publications = 21; - - // The patents acquired by the candidate. - repeated Patent patents = 22; - - // The certifications acquired by the candidate. - repeated Certification certifications = 23; - - // Output only. The resource names of the candidate's applications. - repeated string applications = 47 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource names of the candidate's assignments. - repeated string assignments = 48 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // A map of fields to hold both filterable and non-filterable custom profile - // attributes that aren't covered by the provided structured fields. See - // [CustomAttribute][google.cloud.talent.v4beta1.CustomAttribute] for more details. - // - // At most 100 filterable and at most 100 unfilterable keys are supported. If - // limit is exceeded, an error is thrown. Custom attributes are `unfilterable` - // by default. These are filterable when the `filterable` flag is set to - // `true`. - // - // Numeric custom attributes: each key can only map to one numeric value, - // otherwise an error is thrown. Client can also filter on numeric custom - // attributes using '>', '<' or '=' operators. - // - // String custom attributes: each key can map up to 50 string values. For - // filterable string value, each value has a byte size of no more than 256B. - // For unfilterable string values, the maximum byte size of a single key is - // 64B. An error is thrown for any request exceeding the limit. - // The maximum total byte size is 10KB. - map custom_attributes = 26; - - // Output only. Indicates if a summarized profile was created as part of the - // profile creation API call. This flag does not indicate whether a profile is - // searchable or not. - bool processed = 27 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Keyword snippet shows how the search result is related to a - // search query. This is only returned in [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse]. - string keyword_snippet = 28 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Candidate's availability signals. - repeated AvailabilitySignal availability_signals = 70 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Derived locations of the profile, resolved from [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses]. - // - // [derived_addresses][google.cloud.talent.v4beta1.Profile.derived_addresses] are exactly matched to [Profile.addresses][google.cloud.talent.v4beta1.Profile.addresses] in the - // same order. - repeated Location derived_addresses = 64 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Candidate availability signal. -message AvailabilitySignal { - // Type of signal. - AvailabilitySignalType type = 1; - - // Timestamp of when the given availability activity last happened. - google.protobuf.Timestamp last_update_time = 2; - - // Indicates if the [last_update_time][google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time] is within - // [AvailabilityFilter.range][google.cloud.talent.v4beta1.AvailabilityFilter.range]. - // - // Returned only in a search response when there is an [AvailabilityFilter][google.cloud.talent.v4beta1.AvailabilityFilter] - // in [ProfileQuery.availability_filters][google.cloud.talent.v4beta1.ProfileQuery.availability_filters] where - // [signal_type][google.cloud.talent.v4beta1.AvailabilityFilter.signal_type] matches [type][google.cloud.talent.v4beta1.AvailabilitySignal.type]. - google.protobuf.BoolValue filter_satisfied = 3; -} - -// Resource that represents a resume. -message Resume { - // The format of a structured resume. - enum ResumeType { - // Default value. - RESUME_TYPE_UNSPECIFIED = 0; - - // The profile contents in HR-XML format. - // See https://schemas.liquid-technologies.com/hr-xml/2007-04-15/ for more - // information about Human Resources XML. - HRXML = 1; - - // Resume type not specified. - OTHER_RESUME_TYPE = 2; - } - - // Users can create a profile with only this field field, if [resume_type][google.cloud.talent.v4beta1.Resume.resume_type] - // is [HRXML][google.cloud.talent.v4beta1.Resume.ResumeType.HRXML]. For example, the API parses this field and - // creates a profile - // with all structured fields populated. [EmploymentRecord][google.cloud.talent.v4beta1.EmploymentRecord], - // [EducationRecord][google.cloud.talent.v4beta1.EducationRecord], and so on. An error is thrown if this field cannot be - // parsed. - // - // Note that the use of the functionality offered by this field to extract - // data from resumes is an Alpha feature and as such is not covered by any - // SLA. - string structured_resume = 1; - - // The format of [structured_resume][google.cloud.talent.v4beta1.Resume.structured_resume]. - ResumeType resume_type = 2; -} - -// Resource that represents the name of a person. -message PersonName { - // Resource that represents a person's structured name. - message PersonStructuredName { - // Given/first name. - // - // It's derived from [formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name] if not provided. - // - // Number of characters allowed is 100. - string given_name = 1; - - // Preferred given/first name or nickname. - // - // Number of characters allowed is 100. - string preferred_name = 6; - - // Middle initial. - // - // It's derived from [formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name] if not provided. - // - // Number of characters allowed is 20. - string middle_initial = 2; - - // Family/last name. - // - // It's derived from [formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name] if not provided. - // - // Number of characters allowed is 100. - string family_name = 3; - - // Suffixes. - // - // Number of characters allowed is 20. - repeated string suffixes = 4; - - // Prefixes. - // - // Number of characters allowed is 20. - repeated string prefixes = 5; - } - - // The name of a person. It can be one of - // [formatted_name][google.cloud.talent.v4beta1.PersonName.formatted_name] or - // [structured_name][google.cloud.talent.v4beta1.PersonName.structured_name]. - oneof person_name { - // A string represents a person's full name. For example, "Dr. John Smith". - // - // Number of characters allowed is 100. - string formatted_name = 1; - - // A person's name in a structured way (last name, first name, suffix, and - // so on.) - PersonStructuredName structured_name = 2; - } - - // Preferred name for the person. This field is ignored if [structured_name][google.cloud.talent.v4beta1.PersonName.structured_name] - // is provided. - // - // Number of characters allowed is 100. - string preferred_name = 3; -} - -// Resource that represents a address. -message Address { - // The usage of the address. For example, SCHOOL, WORK, PERSONAL. - ContactInfoUsage usage = 1; - - // The address of a person. It can be one of - // [unstructured_address][google.cloud.talent.v4beta1.Address.unstructured_address] or - // [structured_address][google.cloud.talent.v4beta1.Address.structured_address]. - oneof address { - // Unstructured address. - // - // For example, "1600 Amphitheatre Pkwy, Mountain View, CA 94043", - // "Sunnyvale, California". - // - // Number of characters allowed is 100. - string unstructured_address = 2; - - // Structured address that contains street address, city, state, country, - // and so on. - google.type.PostalAddress structured_address = 3; - } - - // Indicates if it's the person's current address. - google.protobuf.BoolValue current = 4; -} - -// Resource that represents a person's email address. -message Email { - // The usage of the email address. For example, SCHOOL, WORK, PERSONAL. - ContactInfoUsage usage = 1; - - // Email address. - // - // Number of characters allowed is 4,000. - string email_address = 2; -} - -// Resource that represents a person's telephone number. -message Phone { - // Enum that represents the type of the telephone. - enum PhoneType { - // Default value. - PHONE_TYPE_UNSPECIFIED = 0; - - // A landline. - LANDLINE = 1; - - // A mobile. - MOBILE = 2; - - // A fax. - FAX = 3; - - // A pager. - PAGER = 4; - - // A TTY (test telephone) or TDD (telecommunication device for the deaf). - TTY_OR_TDD = 5; - - // A voicemail. - VOICEMAIL = 6; - - // A virtual telephone number is a number that can be routed to another - // number and managed by the user via Web, SMS, IVR, and so on. It is - // associated with a particular person, and may be routed to either a MOBILE - // or LANDLINE number. The [phone usage][google.cloud.talent.v4beta1.ContactInfoUsage] should - // be set to PERSONAL for these phone types. Some more information can be - // found here: https://en.wikipedia.org/wiki/Personal_Numbers - VIRTUAL = 7; - - // Voice over IP numbers. This includes TSoIP (Telephony Service over IP). - VOIP = 8; - - // In some regions (e.g. the USA), it is impossible to distinguish between - // fixed-line and mobile numbers by looking at the phone number itself. - MOBILE_OR_LANDLINE = 9; - } - - // The usage of the phone. For example, SCHOOL, WORK, PERSONAL. - ContactInfoUsage usage = 1; - - // The phone type. For example, LANDLINE, MOBILE, FAX. - PhoneType type = 2; - - // Phone number. - // - // Any phone formats are supported and only exact matches are performed on - // searches. For example, if a phone number in profile is provided in the - // format of "(xxx)xxx-xxxx", in profile searches the same phone format - // has to be provided. - // - // Number of characters allowed is 20. - string number = 3; - - // When this number is available. Any descriptive string is expected. - // - // Number of characters allowed is 100. - string when_available = 4; -} - -// Resource that represents a valid URI for a personal use. -message PersonalUri { - // The personal URI. - // - // Number of characters allowed is 4,000. - string uri = 1; -} - -// Resource that represents contact information other than phone, email, -// URI and addresses. -message AdditionalContactInfo { - // The usage of this contact method. For example, SCHOOL, WORK, PERSONAL. - ContactInfoUsage usage = 1; - - // The name of the contact method. - // - // For example, "hangout", "skype". - // - // Number of characters allowed is 100. - string name = 2; - - // The contact id. - // - // Number of characters allowed is 100. - string contact_id = 3; -} - -// Resource that represents an employment record of a candidate. -message EmploymentRecord { - // Start date of the employment. - google.type.Date start_date = 1; - - // End date of the employment. - google.type.Date end_date = 2; - - // The name of the employer company/organization. - // - // For example, "Google", "Alphabet", and so on. - // - // Number of characters allowed is 250. - string employer_name = 3; - - // The division name of the employment. - // - // For example, division, department, client, and so on. - // - // Number of characters allowed is 100. - string division_name = 4; - - // The physical address of the employer. - Address address = 5; - - // The job title of the employment. - // - // For example, "Software Engineer", "Data Scientist", and so on. - // - // Number of characters allowed is 250. - string job_title = 6; - - // The description of job content. - // - // Number of characters allowed is 100,000. - string job_description = 7; - - // If the jobs is a supervisor position. - google.protobuf.BoolValue is_supervisor = 8; - - // If this employment is self-employed. - google.protobuf.BoolValue is_self_employed = 9; - - // If this employment is current. - google.protobuf.BoolValue is_current = 10; - - // Output only. The job title snippet shows how the [job_title][google.cloud.talent.v4beta1.EmploymentRecord.job_title] is related - // to a search query. It's empty if the [job_title][google.cloud.talent.v4beta1.EmploymentRecord.job_title] isn't related to the - // search query. - string job_title_snippet = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The job description snippet shows how the [job_description][google.cloud.talent.v4beta1.EmploymentRecord.job_description] - // is related to a search query. It's empty if the [job_description][google.cloud.talent.v4beta1.EmploymentRecord.job_description] isn't - // related to the search query. - string job_description_snippet = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The employer name snippet shows how the [employer_name][google.cloud.talent.v4beta1.EmploymentRecord.employer_name] is - // related to a search query. It's empty if the [employer_name][google.cloud.talent.v4beta1.EmploymentRecord.employer_name] isn't - // related to the search query. - string employer_name_snippet = 13 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Resource that represents an education record of a candidate. -message EducationRecord { - // The start date of the education. - google.type.Date start_date = 1; - - // The end date of the education. - google.type.Date end_date = 2; - - // The expected graduation date if currently pursuing a degree. - google.type.Date expected_graduation_date = 3; - - // The name of the school or institution. - // - // For example, "Stanford University", "UC Berkeley", and so on. - // - // Number of characters allowed is 250. - string school_name = 4; - - // The physical address of the education institution. - Address address = 5; - - // The degree information. It can be one of - // [degree_description][google.cloud.talent.v4beta1.EducationRecord.degree_description] or - // [structured_degree][google.cloud.talent.v4beta1.EducationRecord.structured_degree]. - oneof degree { - // The full description of the degree. - // - // For example, "Master of Science in Computer Science", "B.S in Math". - // - // Number of characters allowed is 100. - string degree_description = 6; - - // The structured notation of the degree. - Degree structured_degree = 7; - } - - // The description of the education. - // - // Number of characters allowed is 100,000. - string description = 8; - - // If this education is current. - google.protobuf.BoolValue is_current = 9; - - // Output only. The school name snippet shows how the [school_name][google.cloud.talent.v4beta1.EducationRecord.school_name] is related to a - // search query in search result. It's empty if the [school_name][google.cloud.talent.v4beta1.EducationRecord.school_name] isn't - // related to the search query. - string school_name_snippet = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The job description snippet shows how the [Degree][google.cloud.talent.v4beta1.Degree] is related to a search - // query in search result. It's empty if the [Degree][google.cloud.talent.v4beta1.Degree] isn't related to the - // search query. - string degree_snippet = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Resource that represents a degree pursuing or acquired by a candidate. -message Degree { - // ISCED degree type. - DegreeType degree_type = 1; - - // Full Degree name. - // - // For example, "B.S.", "Master of Arts", and so on. - // - // Number of characters allowed is 100. - string degree_name = 2; - - // Fields of study for the degree. - // - // For example, "Computer science", "engineering". - // - // Number of characters allowed is 100. - repeated string fields_of_study = 3; -} - -// Resource that represents an individual or collaborative activity participated -// in by a candidate, for example, an open-source project, a class assignment, -// and so on. -message Activity { - // Activity display name. - // - // Number of characters allowed is 100. - string display_name = 1; - - // Activity description. - // - // Number of characters allowed is 100,000. - string description = 2; - - // Activity URI. - // - // Number of characters allowed is 4,000. - string uri = 3; - - // The first creation date of the activity. - google.type.Date create_date = 4; - - // The last update date of the activity. - google.type.Date update_date = 5; - - // A list of team members involved in this activity. - // - // Number of characters allowed is 100. - // - // The limitation for max number of team members is 50. - repeated string team_members = 6; - - // A list of skills used in this activity. - // - // The limitation for max number of skills used is 50. - repeated Skill skills_used = 7; - - // Output only. Activity name snippet shows how the [display_name][google.cloud.talent.v4beta1.Activity.display_name] is related to a search - // query. It's empty if the [display_name][google.cloud.talent.v4beta1.Activity.display_name] isn't related to the search - // query. - string activity_name_snippet = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Activity description snippet shows how the - // [description][google.cloud.talent.v4beta1.Activity.description] is related to a search query. It's empty if the - // [description][google.cloud.talent.v4beta1.Activity.description] isn't related to the search query. - string activity_description_snippet = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Skill used snippet shows how the corresponding - // [skills_used][google.cloud.talent.v4beta1.Activity.skills_used] are related to a search query. It's empty if the - // corresponding [skills_used][google.cloud.talent.v4beta1.Activity.skills_used] are not related to the search query. - repeated string skills_used_snippet = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Resource that represents a publication resource of a candidate. -message Publication { - // A list of author names. - // - // Number of characters allowed is 100. - repeated string authors = 1; - - // The title of the publication. - // - // Number of characters allowed is 100. - string title = 2; - - // The description of the publication. - // - // Number of characters allowed is 100,000. - string description = 3; - - // The journal name of the publication. - // - // Number of characters allowed is 100. - string journal = 4; - - // Volume number. - // - // Number of characters allowed is 100. - string volume = 5; - - // The publisher of the journal. - // - // Number of characters allowed is 100. - string publisher = 6; - - // The publication date. - google.type.Date publication_date = 7; - - // The publication type. - // - // Number of characters allowed is 100. - string publication_type = 8; - - // ISBN number. - // - // Number of characters allowed is 100. - string isbn = 9; -} - -// Resource that represents the patent acquired by a candidate. -message Patent { - // Name of the patent. - // - // Number of characters allowed is 100. - string display_name = 1; - - // A list of inventors' names. - // - // Number of characters allowed for each is 100. - repeated string inventors = 2; - - // The status of the patent. - // - // Number of characters allowed is 100. - string patent_status = 3; - - // The date the last time the status of the patent was checked. - google.type.Date patent_status_date = 4; - - // The date that the patent was filed. - google.type.Date patent_filing_date = 5; - - // The name of the patent office. - // - // Number of characters allowed is 100. - string patent_office = 6; - - // The number of the patent. - // - // Number of characters allowed is 100. - string patent_number = 7; - - // The description of the patent. - // - // Number of characters allowed is 100,000. - string patent_description = 8; - - // The skills used in this patent. - repeated Skill skills_used = 9; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/profile_pb2.py b/talent/google/cloud/talent_v4beta1/proto/profile_pb2.py deleted file mode 100644 index eea799af0e6c..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile_pb2.py +++ /dev/null @@ -1,3588 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/profile.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.type import date_pb2 as google_dot_type_dot_date__pb2 -from google.type import postal_address_pb2 as google_dot_type_dot_postal__address__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/profile.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\024ProfileResourceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n/google/cloud/talent_v4beta1/proto/profile.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x16google/type/date.proto\x1a google/type/postal_address.proto\x1a\x1cgoogle/api/annotations.proto"\xf6\r\n\x07Profile\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x13\n\x0b\x65xternal_id\x18\x02 \x01(\t\x12\x0e\n\x06source\x18\x03 \x01(\t\x12\x0b\n\x03uri\x18\x04 \x01(\t\x12\x10\n\x08group_id\x18\x05 \x01(\t\x12.\n\nis_hirable\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12/\n\x0b\x63reate_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x15\x63\x61ndidate_update_time\x18\x43 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x36\n\x12resume_update_time\x18\x44 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x06resume\x18\x35 \x01(\x0b\x32#.google.cloud.talent.v4beta1.Resume\x12=\n\x0cperson_names\x18\x0b \x03(\x0b\x32\'.google.cloud.talent.v4beta1.PersonName\x12\x37\n\taddresses\x18\x0c \x03(\x0b\x32$.google.cloud.talent.v4beta1.Address\x12;\n\x0f\x65mail_addresses\x18\r \x03(\x0b\x32".google.cloud.talent.v4beta1.Email\x12\x39\n\rphone_numbers\x18\x0e \x03(\x0b\x32".google.cloud.talent.v4beta1.Phone\x12?\n\rpersonal_uris\x18\x0f \x03(\x0b\x32(.google.cloud.talent.v4beta1.PersonalUri\x12S\n\x17\x61\x64\x64itional_contact_info\x18\x10 \x03(\x0b\x32\x32.google.cloud.talent.v4beta1.AdditionalContactInfo\x12I\n\x12\x65mployment_records\x18\x11 \x03(\x0b\x32-.google.cloud.talent.v4beta1.EmploymentRecord\x12G\n\x11\x65\x64ucation_records\x18\x12 \x03(\x0b\x32,.google.cloud.talent.v4beta1.EducationRecord\x12\x32\n\x06skills\x18\x13 \x03(\x0b\x32".google.cloud.talent.v4beta1.Skill\x12\x39\n\nactivities\x18\x14 \x03(\x0b\x32%.google.cloud.talent.v4beta1.Activity\x12>\n\x0cpublications\x18\x15 \x03(\x0b\x32(.google.cloud.talent.v4beta1.Publication\x12\x34\n\x07patents\x18\x16 \x03(\x0b\x32#.google.cloud.talent.v4beta1.Patent\x12\x42\n\x0e\x63\x65rtifications\x18\x17 \x03(\x0b\x32*.google.cloud.talent.v4beta1.Certification\x12\x19\n\x0c\x61pplications\x18/ \x03(\tB\x03\xe0\x41\x03\x12\x18\n\x0b\x61ssignments\x18\x30 \x03(\tB\x03\xe0\x41\x03\x12U\n\x11\x63ustom_attributes\x18\x1a \x03(\x0b\x32:.google.cloud.talent.v4beta1.Profile.CustomAttributesEntry\x12\x16\n\tprocessed\x18\x1b \x01(\x08\x42\x03\xe0\x41\x03\x12\x1c\n\x0fkeyword_snippet\x18\x1c \x01(\tB\x03\xe0\x41\x03\x12R\n\x14\x61vailability_signals\x18\x46 \x03(\x0b\x32/.google.cloud.talent.v4beta1.AvailabilitySignalB\x03\xe0\x41\x03\x12\x45\n\x11\x64\x65rived_addresses\x18@ \x03(\x0b\x32%.google.cloud.talent.v4beta1.LocationB\x03\xe0\x41\x03\x1a\x65\n\x15\x43ustomAttributesEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12;\n\x05value\x18\x02 \x01(\x0b\x32,.google.cloud.talent.v4beta1.CustomAttribute:\x02\x38\x01:X\xea\x41U\n\x1bjobs.googleapis.com/Profile\x12\x36projects/{project}/tenants/{tenant}/profiles/{profile}"\xc3\x01\n\x12\x41vailabilitySignal\x12\x41\n\x04type\x18\x01 \x01(\x0e\x32\x33.google.cloud.talent.v4beta1.AvailabilitySignalType\x12\x34\n\x10last_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x34\n\x10\x66ilter_satisfied\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.BoolValue"\xb5\x01\n\x06Resume\x12\x19\n\x11structured_resume\x18\x01 \x01(\t\x12\x43\n\x0bresume_type\x18\x02 \x01(\x0e\x32..google.cloud.talent.v4beta1.Resume.ResumeType"K\n\nResumeType\x12\x1b\n\x17RESUME_TYPE_UNSPECIFIED\x10\x00\x12\t\n\x05HRXML\x10\x01\x12\x15\n\x11OTHER_RESUME_TYPE\x10\x02"\xbc\x02\n\nPersonName\x12\x18\n\x0e\x66ormatted_name\x18\x01 \x01(\tH\x00\x12W\n\x0fstructured_name\x18\x02 \x01(\x0b\x32<.google.cloud.talent.v4beta1.PersonName.PersonStructuredNameH\x00\x12\x16\n\x0epreferred_name\x18\x03 \x01(\t\x1a\x93\x01\n\x14PersonStructuredName\x12\x12\n\ngiven_name\x18\x01 \x01(\t\x12\x16\n\x0epreferred_name\x18\x06 \x01(\t\x12\x16\n\x0emiddle_initial\x18\x02 \x01(\t\x12\x13\n\x0b\x66\x61mily_name\x18\x03 \x01(\t\x12\x10\n\x08suffixes\x18\x04 \x03(\t\x12\x10\n\x08prefixes\x18\x05 \x03(\tB\r\n\x0bperson_name"\xd9\x01\n\x07\x41\x64\x64ress\x12<\n\x05usage\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4beta1.ContactInfoUsage\x12\x1e\n\x14unstructured_address\x18\x02 \x01(\tH\x00\x12\x38\n\x12structured_address\x18\x03 \x01(\x0b\x32\x1a.google.type.PostalAddressH\x00\x12+\n\x07\x63urrent\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\t\n\x07\x61\x64\x64ress"\\\n\x05\x45mail\x12<\n\x05usage\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4beta1.ContactInfoUsage\x12\x15\n\remail_address\x18\x02 \x01(\t"\xcf\x02\n\x05Phone\x12<\n\x05usage\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4beta1.ContactInfoUsage\x12:\n\x04type\x18\x02 \x01(\x0e\x32,.google.cloud.talent.v4beta1.Phone.PhoneType\x12\x0e\n\x06number\x18\x03 \x01(\t\x12\x16\n\x0ewhen_available\x18\x04 \x01(\t"\xa3\x01\n\tPhoneType\x12\x1a\n\x16PHONE_TYPE_UNSPECIFIED\x10\x00\x12\x0c\n\x08LANDLINE\x10\x01\x12\n\n\x06MOBILE\x10\x02\x12\x07\n\x03\x46\x41X\x10\x03\x12\t\n\x05PAGER\x10\x04\x12\x0e\n\nTTY_OR_TDD\x10\x05\x12\r\n\tVOICEMAIL\x10\x06\x12\x0b\n\x07VIRTUAL\x10\x07\x12\x08\n\x04VOIP\x10\x08\x12\x16\n\x12MOBILE_OR_LANDLINE\x10\t"\x1a\n\x0bPersonalUri\x12\x0b\n\x03uri\x18\x01 \x01(\t"w\n\x15\x41\x64\x64itionalContactInfo\x12<\n\x05usage\x18\x01 \x01(\x0e\x32-.google.cloud.talent.v4beta1.ContactInfoUsage\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x12\n\ncontact_id\x18\x03 \x01(\t"\xf2\x03\n\x10\x45mploymentRecord\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12\x15\n\remployer_name\x18\x03 \x01(\t\x12\x15\n\rdivision_name\x18\x04 \x01(\t\x12\x35\n\x07\x61\x64\x64ress\x18\x05 \x01(\x0b\x32$.google.cloud.talent.v4beta1.Address\x12\x11\n\tjob_title\x18\x06 \x01(\t\x12\x17\n\x0fjob_description\x18\x07 \x01(\t\x12\x31\n\ris_supervisor\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x34\n\x10is_self_employed\x18\t \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12.\n\nis_current\x18\n \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12\x1e\n\x11job_title_snippet\x18\x0b \x01(\tB\x03\xe0\x41\x03\x12$\n\x17job_description_snippet\x18\x0c \x01(\tB\x03\xe0\x41\x03\x12"\n\x15\x65mployer_name_snippet\x18\r \x01(\tB\x03\xe0\x41\x03"\xcc\x03\n\x0f\x45\x64ucationRecord\x12%\n\nstart_date\x18\x01 \x01(\x0b\x32\x11.google.type.Date\x12#\n\x08\x65nd_date\x18\x02 \x01(\x0b\x32\x11.google.type.Date\x12\x33\n\x18\x65xpected_graduation_date\x18\x03 \x01(\x0b\x32\x11.google.type.Date\x12\x13\n\x0bschool_name\x18\x04 \x01(\t\x12\x35\n\x07\x61\x64\x64ress\x18\x05 \x01(\x0b\x32$.google.cloud.talent.v4beta1.Address\x12\x1c\n\x12\x64\x65gree_description\x18\x06 \x01(\tH\x00\x12@\n\x11structured_degree\x18\x07 \x01(\x0b\x32#.google.cloud.talent.v4beta1.DegreeH\x00\x12\x13\n\x0b\x64\x65scription\x18\x08 \x01(\t\x12.\n\nis_current\x18\t \x01(\x0b\x32\x1a.google.protobuf.BoolValue\x12 \n\x13school_name_snippet\x18\n \x01(\tB\x03\xe0\x41\x03\x12\x1b\n\x0e\x64\x65gree_snippet\x18\x0b \x01(\tB\x03\xe0\x41\x03\x42\x08\n\x06\x64\x65gree"t\n\x06\x44\x65gree\x12<\n\x0b\x64\x65gree_type\x18\x01 \x01(\x0e\x32\'.google.cloud.talent.v4beta1.DegreeType\x12\x13\n\x0b\x64\x65gree_name\x18\x02 \x01(\t\x12\x17\n\x0f\x66ields_of_study\x18\x03 \x03(\t"\xd2\x02\n\x08\x41\x63tivity\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x0b\n\x03uri\x18\x03 \x01(\t\x12&\n\x0b\x63reate_date\x18\x04 \x01(\x0b\x32\x11.google.type.Date\x12&\n\x0bupdate_date\x18\x05 \x01(\x0b\x32\x11.google.type.Date\x12\x14\n\x0cteam_members\x18\x06 \x03(\t\x12\x37\n\x0bskills_used\x18\x07 \x03(\x0b\x32".google.cloud.talent.v4beta1.Skill\x12"\n\x15\x61\x63tivity_name_snippet\x18\x08 \x01(\tB\x03\xe0\x41\x03\x12)\n\x1c\x61\x63tivity_description_snippet\x18\t \x01(\tB\x03\xe0\x41\x03\x12 \n\x13skills_used_snippet\x18\n \x03(\tB\x03\xe0\x41\x03"\xcb\x01\n\x0bPublication\x12\x0f\n\x07\x61uthors\x18\x01 \x03(\t\x12\r\n\x05title\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x0f\n\x07journal\x18\x04 \x01(\t\x12\x0e\n\x06volume\x18\x05 \x01(\t\x12\x11\n\tpublisher\x18\x06 \x01(\t\x12+\n\x10publication_date\x18\x07 \x01(\x0b\x32\x11.google.type.Date\x12\x18\n\x10publication_type\x18\x08 \x01(\t\x12\x0c\n\x04isbn\x18\t \x01(\t"\xa9\x02\n\x06Patent\x12\x14\n\x0c\x64isplay_name\x18\x01 \x01(\t\x12\x11\n\tinventors\x18\x02 \x03(\t\x12\x15\n\rpatent_status\x18\x03 \x01(\t\x12-\n\x12patent_status_date\x18\x04 \x01(\x0b\x32\x11.google.type.Date\x12-\n\x12patent_filing_date\x18\x05 \x01(\x0b\x32\x11.google.type.Date\x12\x15\n\rpatent_office\x18\x06 \x01(\t\x12\x15\n\rpatent_number\x18\x07 \x01(\t\x12\x1a\n\x12patent_description\x18\x08 \x01(\t\x12\x37\n\x0bskills_used\x18\t \x03(\x0b\x32".google.cloud.talent.v4beta1.SkillB\x82\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x14ProfileResourceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, - google_dot_type_dot_date__pb2.DESCRIPTOR, - google_dot_type_dot_postal__address__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_RESUME_RESUMETYPE = _descriptor.EnumDescriptor( - name="ResumeType", - full_name="google.cloud.talent.v4beta1.Resume.ResumeType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="RESUME_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="HRXML", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OTHER_RESUME_TYPE", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2463, - serialized_end=2538, -) -_sym_db.RegisterEnumDescriptor(_RESUME_RESUMETYPE) - -_PHONE_PHONETYPE = _descriptor.EnumDescriptor( - name="PhoneType", - full_name="google.cloud.talent.v4beta1.Phone.PhoneType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="PHONE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LANDLINE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOBILE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAX", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PAGER", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TTY_OR_TDD", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VOICEMAIL", index=6, number=6, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VIRTUAL", index=7, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VOIP", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOBILE_OR_LANDLINE", - index=9, - number=9, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3346, - serialized_end=3509, -) -_sym_db.RegisterEnumDescriptor(_PHONE_PHONETYPE) - - -_PROFILE_CUSTOMATTRIBUTESENTRY = _descriptor.Descriptor( - name="CustomAttributesEntry", - full_name="google.cloud.talent.v4beta1.Profile.CustomAttributesEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.talent.v4beta1.Profile.CustomAttributesEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.talent.v4beta1.Profile.CustomAttributesEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1965, - serialized_end=2066, -) - -_PROFILE = _descriptor.Descriptor( - name="Profile", - full_name="google.cloud.talent.v4beta1.Profile", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.Profile.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="external_id", - full_name="google.cloud.talent.v4beta1.Profile.external_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.cloud.talent.v4beta1.Profile.source", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.talent.v4beta1.Profile.uri", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="group_id", - full_name="google.cloud.talent.v4beta1.Profile.group_id", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_hirable", - full_name="google.cloud.talent.v4beta1.Profile.is_hirable", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.talent.v4beta1.Profile.create_time", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.talent.v4beta1.Profile.update_time", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="candidate_update_time", - full_name="google.cloud.talent.v4beta1.Profile.candidate_update_time", - index=8, - number=67, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resume_update_time", - full_name="google.cloud.talent.v4beta1.Profile.resume_update_time", - index=9, - number=68, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resume", - full_name="google.cloud.talent.v4beta1.Profile.resume", - index=10, - number=53, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="person_names", - full_name="google.cloud.talent.v4beta1.Profile.person_names", - index=11, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="addresses", - full_name="google.cloud.talent.v4beta1.Profile.addresses", - index=12, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="email_addresses", - full_name="google.cloud.talent.v4beta1.Profile.email_addresses", - index=13, - number=13, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="phone_numbers", - full_name="google.cloud.talent.v4beta1.Profile.phone_numbers", - index=14, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="personal_uris", - full_name="google.cloud.talent.v4beta1.Profile.personal_uris", - index=15, - number=15, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="additional_contact_info", - full_name="google.cloud.talent.v4beta1.Profile.additional_contact_info", - index=16, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employment_records", - full_name="google.cloud.talent.v4beta1.Profile.employment_records", - index=17, - number=17, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="education_records", - full_name="google.cloud.talent.v4beta1.Profile.education_records", - index=18, - number=18, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skills", - full_name="google.cloud.talent.v4beta1.Profile.skills", - index=19, - number=19, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="activities", - full_name="google.cloud.talent.v4beta1.Profile.activities", - index=20, - number=20, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publications", - full_name="google.cloud.talent.v4beta1.Profile.publications", - index=21, - number=21, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patents", - full_name="google.cloud.talent.v4beta1.Profile.patents", - index=22, - number=22, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="certifications", - full_name="google.cloud.talent.v4beta1.Profile.certifications", - index=23, - number=23, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="applications", - full_name="google.cloud.talent.v4beta1.Profile.applications", - index=24, - number=47, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="assignments", - full_name="google.cloud.talent.v4beta1.Profile.assignments", - index=25, - number=48, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="custom_attributes", - full_name="google.cloud.talent.v4beta1.Profile.custom_attributes", - index=26, - number=26, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="processed", - full_name="google.cloud.talent.v4beta1.Profile.processed", - index=27, - number=27, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="keyword_snippet", - full_name="google.cloud.talent.v4beta1.Profile.keyword_snippet", - index=28, - number=28, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="availability_signals", - full_name="google.cloud.talent.v4beta1.Profile.availability_signals", - index=29, - number=70, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="derived_addresses", - full_name="google.cloud.talent.v4beta1.Profile.derived_addresses", - index=30, - number=64, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PROFILE_CUSTOMATTRIBUTESENTRY], - enum_types=[], - serialized_options=_b( - "\352AU\n\033jobs.googleapis.com/Profile\0226projects/{project}/tenants/{tenant}/profiles/{profile}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=374, - serialized_end=2156, -) - - -_AVAILABILITYSIGNAL = _descriptor.Descriptor( - name="AvailabilitySignal", - full_name="google.cloud.talent.v4beta1.AvailabilitySignal", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.AvailabilitySignal.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="last_update_time", - full_name="google.cloud.talent.v4beta1.AvailabilitySignal.last_update_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter_satisfied", - full_name="google.cloud.talent.v4beta1.AvailabilitySignal.filter_satisfied", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2159, - serialized_end=2354, -) - - -_RESUME = _descriptor.Descriptor( - name="Resume", - full_name="google.cloud.talent.v4beta1.Resume", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="structured_resume", - full_name="google.cloud.talent.v4beta1.Resume.structured_resume", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="resume_type", - full_name="google.cloud.talent.v4beta1.Resume.resume_type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_RESUME_RESUMETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2357, - serialized_end=2538, -) - - -_PERSONNAME_PERSONSTRUCTUREDNAME = _descriptor.Descriptor( - name="PersonStructuredName", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="given_name", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.given_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="preferred_name", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.preferred_name", - index=1, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="middle_initial", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.middle_initial", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="family_name", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.family_name", - index=3, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="suffixes", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.suffixes", - index=4, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="prefixes", - full_name="google.cloud.talent.v4beta1.PersonName.PersonStructuredName.prefixes", - index=5, - number=5, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2695, - serialized_end=2842, -) - -_PERSONNAME = _descriptor.Descriptor( - name="PersonName", - full_name="google.cloud.talent.v4beta1.PersonName", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="formatted_name", - full_name="google.cloud.talent.v4beta1.PersonName.formatted_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="structured_name", - full_name="google.cloud.talent.v4beta1.PersonName.structured_name", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="preferred_name", - full_name="google.cloud.talent.v4beta1.PersonName.preferred_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PERSONNAME_PERSONSTRUCTUREDNAME], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="person_name", - full_name="google.cloud.talent.v4beta1.PersonName.person_name", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2541, - serialized_end=2857, -) - - -_ADDRESS = _descriptor.Descriptor( - name="Address", - full_name="google.cloud.talent.v4beta1.Address", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="usage", - full_name="google.cloud.talent.v4beta1.Address.usage", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="unstructured_address", - full_name="google.cloud.talent.v4beta1.Address.unstructured_address", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="structured_address", - full_name="google.cloud.talent.v4beta1.Address.structured_address", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="current", - full_name="google.cloud.talent.v4beta1.Address.current", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="address", - full_name="google.cloud.talent.v4beta1.Address.address", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2860, - serialized_end=3077, -) - - -_EMAIL = _descriptor.Descriptor( - name="Email", - full_name="google.cloud.talent.v4beta1.Email", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="usage", - full_name="google.cloud.talent.v4beta1.Email.usage", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="email_address", - full_name="google.cloud.talent.v4beta1.Email.email_address", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3079, - serialized_end=3171, -) - - -_PHONE = _descriptor.Descriptor( - name="Phone", - full_name="google.cloud.talent.v4beta1.Phone", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="usage", - full_name="google.cloud.talent.v4beta1.Phone.usage", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.talent.v4beta1.Phone.type", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="number", - full_name="google.cloud.talent.v4beta1.Phone.number", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="when_available", - full_name="google.cloud.talent.v4beta1.Phone.when_available", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_PHONE_PHONETYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3174, - serialized_end=3509, -) - - -_PERSONALURI = _descriptor.Descriptor( - name="PersonalUri", - full_name="google.cloud.talent.v4beta1.PersonalUri", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.talent.v4beta1.PersonalUri.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3511, - serialized_end=3537, -) - - -_ADDITIONALCONTACTINFO = _descriptor.Descriptor( - name="AdditionalContactInfo", - full_name="google.cloud.talent.v4beta1.AdditionalContactInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="usage", - full_name="google.cloud.talent.v4beta1.AdditionalContactInfo.usage", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.AdditionalContactInfo.name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="contact_id", - full_name="google.cloud.talent.v4beta1.AdditionalContactInfo.contact_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3539, - serialized_end=3658, -) - - -_EMPLOYMENTRECORD = _descriptor.Descriptor( - name="EmploymentRecord", - full_name="google.cloud.talent.v4beta1.EmploymentRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_date", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.start_date", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_date", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.end_date", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employer_name", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.employer_name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="division_name", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.division_name", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.address", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.job_title", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_description", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.job_description", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_supervisor", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.is_supervisor", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_self_employed", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.is_self_employed", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_current", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.is_current", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_title_snippet", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.job_title_snippet", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="job_description_snippet", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.job_description_snippet", - index=11, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="employer_name_snippet", - full_name="google.cloud.talent.v4beta1.EmploymentRecord.employer_name_snippet", - index=12, - number=13, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3661, - serialized_end=4159, -) - - -_EDUCATIONRECORD = _descriptor.Descriptor( - name="EducationRecord", - full_name="google.cloud.talent.v4beta1.EducationRecord", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_date", - full_name="google.cloud.talent.v4beta1.EducationRecord.start_date", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_date", - full_name="google.cloud.talent.v4beta1.EducationRecord.end_date", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="expected_graduation_date", - full_name="google.cloud.talent.v4beta1.EducationRecord.expected_graduation_date", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="school_name", - full_name="google.cloud.talent.v4beta1.EducationRecord.school_name", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="address", - full_name="google.cloud.talent.v4beta1.EducationRecord.address", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="degree_description", - full_name="google.cloud.talent.v4beta1.EducationRecord.degree_description", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="structured_degree", - full_name="google.cloud.talent.v4beta1.EducationRecord.structured_degree", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.EducationRecord.description", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_current", - full_name="google.cloud.talent.v4beta1.EducationRecord.is_current", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="school_name_snippet", - full_name="google.cloud.talent.v4beta1.EducationRecord.school_name_snippet", - index=9, - number=10, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="degree_snippet", - full_name="google.cloud.talent.v4beta1.EducationRecord.degree_snippet", - index=10, - number=11, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="degree", - full_name="google.cloud.talent.v4beta1.EducationRecord.degree", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=4162, - serialized_end=4622, -) - - -_DEGREE = _descriptor.Descriptor( - name="Degree", - full_name="google.cloud.talent.v4beta1.Degree", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="degree_type", - full_name="google.cloud.talent.v4beta1.Degree.degree_type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="degree_name", - full_name="google.cloud.talent.v4beta1.Degree.degree_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fields_of_study", - full_name="google.cloud.talent.v4beta1.Degree.fields_of_study", - index=2, - number=3, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4624, - serialized_end=4740, -) - - -_ACTIVITY = _descriptor.Descriptor( - name="Activity", - full_name="google.cloud.talent.v4beta1.Activity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.talent.v4beta1.Activity.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.Activity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.talent.v4beta1.Activity.uri", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_date", - full_name="google.cloud.talent.v4beta1.Activity.create_date", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_date", - full_name="google.cloud.talent.v4beta1.Activity.update_date", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="team_members", - full_name="google.cloud.talent.v4beta1.Activity.team_members", - index=5, - number=6, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skills_used", - full_name="google.cloud.talent.v4beta1.Activity.skills_used", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="activity_name_snippet", - full_name="google.cloud.talent.v4beta1.Activity.activity_name_snippet", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="activity_description_snippet", - full_name="google.cloud.talent.v4beta1.Activity.activity_description_snippet", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skills_used_snippet", - full_name="google.cloud.talent.v4beta1.Activity.skills_used_snippet", - index=9, - number=10, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4743, - serialized_end=5081, -) - - -_PUBLICATION = _descriptor.Descriptor( - name="Publication", - full_name="google.cloud.talent.v4beta1.Publication", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="authors", - full_name="google.cloud.talent.v4beta1.Publication.authors", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="title", - full_name="google.cloud.talent.v4beta1.Publication.title", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.talent.v4beta1.Publication.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="journal", - full_name="google.cloud.talent.v4beta1.Publication.journal", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="volume", - full_name="google.cloud.talent.v4beta1.Publication.volume", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publisher", - full_name="google.cloud.talent.v4beta1.Publication.publisher", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publication_date", - full_name="google.cloud.talent.v4beta1.Publication.publication_date", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="publication_type", - full_name="google.cloud.talent.v4beta1.Publication.publication_type", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="isbn", - full_name="google.cloud.talent.v4beta1.Publication.isbn", - index=8, - number=9, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5084, - serialized_end=5287, -) - - -_PATENT = _descriptor.Descriptor( - name="Patent", - full_name="google.cloud.talent.v4beta1.Patent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.talent.v4beta1.Patent.display_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="inventors", - full_name="google.cloud.talent.v4beta1.Patent.inventors", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_status", - full_name="google.cloud.talent.v4beta1.Patent.patent_status", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_status_date", - full_name="google.cloud.talent.v4beta1.Patent.patent_status_date", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_filing_date", - full_name="google.cloud.talent.v4beta1.Patent.patent_filing_date", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_office", - full_name="google.cloud.talent.v4beta1.Patent.patent_office", - index=5, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_number", - full_name="google.cloud.talent.v4beta1.Patent.patent_number", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="patent_description", - full_name="google.cloud.talent.v4beta1.Patent.patent_description", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="skills_used", - full_name="google.cloud.talent.v4beta1.Patent.skills_used", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5290, - serialized_end=5587, -) - -_PROFILE_CUSTOMATTRIBUTESENTRY.fields_by_name[ - "value" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CUSTOMATTRIBUTE -) -_PROFILE_CUSTOMATTRIBUTESENTRY.containing_type = _PROFILE -_PROFILE.fields_by_name[ - "is_hirable" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_PROFILE.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PROFILE.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PROFILE.fields_by_name[ - "candidate_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PROFILE.fields_by_name[ - "resume_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PROFILE.fields_by_name["resume"].message_type = _RESUME -_PROFILE.fields_by_name["person_names"].message_type = _PERSONNAME -_PROFILE.fields_by_name["addresses"].message_type = _ADDRESS -_PROFILE.fields_by_name["email_addresses"].message_type = _EMAIL -_PROFILE.fields_by_name["phone_numbers"].message_type = _PHONE -_PROFILE.fields_by_name["personal_uris"].message_type = _PERSONALURI -_PROFILE.fields_by_name["additional_contact_info"].message_type = _ADDITIONALCONTACTINFO -_PROFILE.fields_by_name["employment_records"].message_type = _EMPLOYMENTRECORD -_PROFILE.fields_by_name["education_records"].message_type = _EDUCATIONRECORD -_PROFILE.fields_by_name[ - "skills" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._SKILL -_PROFILE.fields_by_name["activities"].message_type = _ACTIVITY -_PROFILE.fields_by_name["publications"].message_type = _PUBLICATION -_PROFILE.fields_by_name["patents"].message_type = _PATENT -_PROFILE.fields_by_name[ - "certifications" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CERTIFICATION -) -_PROFILE.fields_by_name[ - "custom_attributes" -].message_type = _PROFILE_CUSTOMATTRIBUTESENTRY -_PROFILE.fields_by_name["availability_signals"].message_type = _AVAILABILITYSIGNAL -_PROFILE.fields_by_name[ - "derived_addresses" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._LOCATION -) -_AVAILABILITYSIGNAL.fields_by_name[ - "type" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._AVAILABILITYSIGNALTYPE -) -_AVAILABILITYSIGNAL.fields_by_name[ - "last_update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_AVAILABILITYSIGNAL.fields_by_name[ - "filter_satisfied" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_RESUME.fields_by_name["resume_type"].enum_type = _RESUME_RESUMETYPE -_RESUME_RESUMETYPE.containing_type = _RESUME -_PERSONNAME_PERSONSTRUCTUREDNAME.containing_type = _PERSONNAME -_PERSONNAME.fields_by_name[ - "structured_name" -].message_type = _PERSONNAME_PERSONSTRUCTUREDNAME -_PERSONNAME.oneofs_by_name["person_name"].fields.append( - _PERSONNAME.fields_by_name["formatted_name"] -) -_PERSONNAME.fields_by_name[ - "formatted_name" -].containing_oneof = _PERSONNAME.oneofs_by_name["person_name"] -_PERSONNAME.oneofs_by_name["person_name"].fields.append( - _PERSONNAME.fields_by_name["structured_name"] -) -_PERSONNAME.fields_by_name[ - "structured_name" -].containing_oneof = _PERSONNAME.oneofs_by_name["person_name"] -_ADDRESS.fields_by_name[ - "usage" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CONTACTINFOUSAGE -) -_ADDRESS.fields_by_name[ - "structured_address" -].message_type = google_dot_type_dot_postal__address__pb2._POSTALADDRESS -_ADDRESS.fields_by_name[ - "current" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_ADDRESS.oneofs_by_name["address"].fields.append( - _ADDRESS.fields_by_name["unstructured_address"] -) -_ADDRESS.fields_by_name[ - "unstructured_address" -].containing_oneof = _ADDRESS.oneofs_by_name["address"] -_ADDRESS.oneofs_by_name["address"].fields.append( - _ADDRESS.fields_by_name["structured_address"] -) -_ADDRESS.fields_by_name[ - "structured_address" -].containing_oneof = _ADDRESS.oneofs_by_name["address"] -_EMAIL.fields_by_name[ - "usage" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CONTACTINFOUSAGE -) -_PHONE.fields_by_name[ - "usage" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CONTACTINFOUSAGE -) -_PHONE.fields_by_name["type"].enum_type = _PHONE_PHONETYPE -_PHONE_PHONETYPE.containing_type = _PHONE -_ADDITIONALCONTACTINFO.fields_by_name[ - "usage" -].enum_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._CONTACTINFOUSAGE -) -_EMPLOYMENTRECORD.fields_by_name[ - "start_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_EMPLOYMENTRECORD.fields_by_name[ - "end_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_EMPLOYMENTRECORD.fields_by_name["address"].message_type = _ADDRESS -_EMPLOYMENTRECORD.fields_by_name[ - "is_supervisor" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_EMPLOYMENTRECORD.fields_by_name[ - "is_self_employed" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_EMPLOYMENTRECORD.fields_by_name[ - "is_current" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_EDUCATIONRECORD.fields_by_name[ - "start_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_EDUCATIONRECORD.fields_by_name[ - "end_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_EDUCATIONRECORD.fields_by_name[ - "expected_graduation_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_EDUCATIONRECORD.fields_by_name["address"].message_type = _ADDRESS -_EDUCATIONRECORD.fields_by_name["structured_degree"].message_type = _DEGREE -_EDUCATIONRECORD.fields_by_name[ - "is_current" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_EDUCATIONRECORD.oneofs_by_name["degree"].fields.append( - _EDUCATIONRECORD.fields_by_name["degree_description"] -) -_EDUCATIONRECORD.fields_by_name[ - "degree_description" -].containing_oneof = _EDUCATIONRECORD.oneofs_by_name["degree"] -_EDUCATIONRECORD.oneofs_by_name["degree"].fields.append( - _EDUCATIONRECORD.fields_by_name["structured_degree"] -) -_EDUCATIONRECORD.fields_by_name[ - "structured_degree" -].containing_oneof = _EDUCATIONRECORD.oneofs_by_name["degree"] -_DEGREE.fields_by_name[ - "degree_type" -].enum_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._DEGREETYPE -_ACTIVITY.fields_by_name[ - "create_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_ACTIVITY.fields_by_name[ - "update_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_ACTIVITY.fields_by_name[ - "skills_used" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._SKILL -_PUBLICATION.fields_by_name[ - "publication_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_PATENT.fields_by_name[ - "patent_status_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_PATENT.fields_by_name[ - "patent_filing_date" -].message_type = google_dot_type_dot_date__pb2._DATE -_PATENT.fields_by_name[ - "skills_used" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._SKILL -DESCRIPTOR.message_types_by_name["Profile"] = _PROFILE -DESCRIPTOR.message_types_by_name["AvailabilitySignal"] = _AVAILABILITYSIGNAL -DESCRIPTOR.message_types_by_name["Resume"] = _RESUME -DESCRIPTOR.message_types_by_name["PersonName"] = _PERSONNAME -DESCRIPTOR.message_types_by_name["Address"] = _ADDRESS -DESCRIPTOR.message_types_by_name["Email"] = _EMAIL -DESCRIPTOR.message_types_by_name["Phone"] = _PHONE -DESCRIPTOR.message_types_by_name["PersonalUri"] = _PERSONALURI -DESCRIPTOR.message_types_by_name["AdditionalContactInfo"] = _ADDITIONALCONTACTINFO -DESCRIPTOR.message_types_by_name["EmploymentRecord"] = _EMPLOYMENTRECORD -DESCRIPTOR.message_types_by_name["EducationRecord"] = _EDUCATIONRECORD -DESCRIPTOR.message_types_by_name["Degree"] = _DEGREE -DESCRIPTOR.message_types_by_name["Activity"] = _ACTIVITY -DESCRIPTOR.message_types_by_name["Publication"] = _PUBLICATION -DESCRIPTOR.message_types_by_name["Patent"] = _PATENT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Profile = _reflection.GeneratedProtocolMessageType( - "Profile", - (_message.Message,), - dict( - CustomAttributesEntry=_reflection.GeneratedProtocolMessageType( - "CustomAttributesEntry", - (_message.Message,), - dict( - DESCRIPTOR=_PROFILE_CUSTOMATTRIBUTESENTRY, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2" - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Profile.CustomAttributesEntry) - ), - ), - DESCRIPTOR=_PROFILE, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""A resource that represents the profile for a job candidate - (also referred to as a "single-source profile"). - - - Attributes: - name: - Required during profile update. Resource name assigned to a - profile by the API. The format is "projects/{project\_id}/ten - ants/{tenant\_id}/profiles/{profile\_id}", for example, - "projects/foo/tenants/bar/profiles/baz". - external_id: - Profile's id in client system, if available. This value is - unique for each profile inside a tenant. An error is thrown if - another profile with the same external\_id is created. The - maximum number of bytes allowed is 100. - source: - The source description indicating where the profile is - acquired. For example, if a candidate profile is acquired - from a resume, the user can input "resume" here to indicate - the source. The maximum number of bytes allowed is 100. - uri: - The URI set by clients that links to this profile's client- - side copy. The maximum number of bytes allowed is 4000. - group_id: - The cluster id of the profile to associate with other - profile(s) for the same candidate. This field should be - generated by the customer. If a value is not provided, a - random UUID is assigned to this field of the profile. This is - used to link multiple profiles to the same candidate. For - example, a client has a candidate with two profiles, where one - was created recently and the other one was created 5 years - ago. These two profiles may be very different. The clients can - create the first profile and get a generated - [group\_id][google.cloud.talent.v4beta1.Profile.group\_id], - and assign it when the second profile is created, indicating - these two profiles are referring to the same candidate. - is_hirable: - Indicates the hirable status of the candidate. - create_time: - The timestamp when the profile was first created at this - source. - update_time: - The timestamp when the profile was last updated at this - source. - candidate_update_time: - The timestamp when the profile was last updated as a result of - a direct or indirect action by a candidate. These actions - include: - Direct actions such as the candidate submitting a - new resume as part of a job application to the agency, - using a self-service tool such as a website to update their - profile, and so on. - Indirect actions by the candidate such - as uploading a resume to a job board that is collected by - the agency through a feed, providing a resume to a - recruiter who then uploads it into the ATS, and so on. - - Updates made to the candidate's profile by the recruiter as a - result of interacting with the candidate (for example - adding a skill or work preference, and so on). Changes to - [recruiting\_notes][google.cloud.talent.v4beta1.Profile.recrui - ting\_notes] are specifically excluded from this action - type. Note: [candidate\_update\_time][google.cloud.talent.v4b - eta1.Profile.candidate\_update\_time] must be greater than or - equal to [resume\_update\_time][google.cloud.talent.v4beta1.Pr - ofile.resume\_update\_time] or an error is thrown. - resume_update_time: - The timestamp when the candidate's resume was added or updated - on the candidate's profile. Whether that resume was directly - uploaded by a candidate, pulled from a 3rd party job board - feed, added by a recruiter, and so on. If this field is - updated, it's expected that - [resume][google.cloud.talent.v4beta1.Profile.resume] is - provided in the create or update calls. - resume: - The resume representing this profile. - person_names: - The names of the candidate this profile references. Currently - only one person name is supported. - addresses: - The candidate's postal addresses. It's highly recommended to - input this information as accurately as possible to help - improve search quality. Here are some recommendations: - - Provide - [Address.usage][google.cloud.talent.v4beta1.Address.usage] if - possible, especially if the address is PERSONAL. During a - search only personal addresses are considered. If there is - no such address, all addresses with unspecified usage are - assumed to be personal. - Provide - [Address.current][google.cloud.talent.v4beta1.Address.current] - for the current address if possible. During a search, only - current addresses are considered. If there is no such - address, all addresses are assumed to be current. When - displaying a candidate's addresses, it is sometimes desirable - to limit the number of addresses shown. In these cases we - recommend that you display the addresses in the following - order of priority: 1. - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - PERSONAL and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is true. 2. - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - PERSONAL and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is false or not set. 3. - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - CONTACT\_INFO\_USAGE\_UNSPECIFIED and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is true. 4. - [Address.usage][google.cloud.talent.v4beta1.Address.usage] is - CONTACT\_INFO\_USAGE\_UNSPECIFIED and - [Address.current][google.cloud.talent.v4beta1.Address.current] - is false or not set. - email_addresses: - The candidate's email addresses. - phone_numbers: - The candidate's phone number(s). - personal_uris: - The candidate's personal URIs. - additional_contact_info: - Available contact information besides - [addresses][google.cloud.talent.v4beta1.Profile.addresses], [e - mail\_addresses][google.cloud.talent.v4beta1.Profile.email\_ad - dresses], [phone\_numbers][google.cloud.talent.v4beta1.Profile - .phone\_numbers] and [personal\_uris][google.cloud.talent.v4be - ta1.Profile.personal\_uris]. For example, Hang-out, Skype. - employment_records: - The employment history records of the candidate. It's highly - recommended to input this information as accurately as - possible to help improve search quality. Here are some - recommendations: - Specify the start and end dates of the - employment records. - List different employment types - separately, no matter how minor the change is. For example, - only job title is changed from "software engineer" to - "senior software engineer". - Provide [EmploymentRecord.is - \_current][google.cloud.talent.v4beta1.EmploymentRecord.is\_cu - rrent] for the current employment if possible. If not, it's - inferred from user inputs. The limitation for max number - of employment records is 100. - education_records: - The education history record of the candidate. It's highly - recommended to input this information as accurately as - possible to help improve search quality. Here are some - recommendations: - Specify the start and end dates of the - education records. - List each education type separately, no - matter how minor the change is. For example, the profile - contains the education experience from the same school but - different degrees. - Provide [EducationRecord.is\_current] - [google.cloud.talent.v4beta1.EducationRecord.is\_current] - for the current education if possible. If not, it's inferred - from user inputs. The limitation for max number of - education records is 100. - skills: - The skill set of the candidate. It's highly recommended to - provide as much information as possible to help improve the - search quality. The limitation for max number of skills is - 500. - activities: - The individual or collaborative activities which the candidate - has participated in, for example, open-source projects, class - assignments that aren't listed in [employment\_records][google - .cloud.talent.v4beta1.Profile.employment\_records]. The - limitation for max number of activities is 50. - publications: - The publications published by the candidate. The limitation - for max number of publications is 50. - patents: - The patents acquired by the candidate. - certifications: - The certifications acquired by the candidate. - applications: - Output only. The resource names of the candidate's - applications. - assignments: - Output only. The resource names of the candidate's - assignments. - custom_attributes: - A map of fields to hold both filterable and non-filterable - custom profile attributes that aren't covered by the provided - structured fields. See - [CustomAttribute][google.cloud.talent.v4beta1.CustomAttribute] - for more details. At most 100 filterable and at most 100 - unfilterable keys are supported. If limit is exceeded, an - error is thrown. Custom attributes are ``unfilterable`` by - default. These are filterable when the ``filterable`` flag is - set to ``true``. Numeric custom attributes: each key can only - map to one numeric value, otherwise an error is thrown. Client - can also filter on numeric custom attributes using '>', '<' or - '=' operators. String custom attributes: each key can map up - to 50 string values. For filterable string value, each value - has a byte size of no more than 256B. For unfilterable string - values, the maximum byte size of a single key is 64B. An error - is thrown for any request exceeding the limit. The maximum - total byte size is 10KB. - processed: - Output only. Indicates if a summarized profile was created as - part of the profile creation API call. This flag does not - indicate whether a profile is searchable or not. - keyword_snippet: - Output only. Keyword snippet shows how the search result is - related to a search query. This is only returned in [SearchPro - filesResponse][google.cloud.talent.v4beta1.SearchProfilesRespo - nse]. - availability_signals: - Output only. Candidate's availability signals. - derived_addresses: - Output only. Derived locations of the profile, resolved from [ - Profile.addresses][google.cloud.talent.v4beta1.Profile.address - es]. [derived\_addresses][google.cloud.talent.v4beta1.Profile - .derived\_addresses] are exactly matched to [Profile.addresses - ][google.cloud.talent.v4beta1.Profile.addresses] in the same - order. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Profile) - ), -) -_sym_db.RegisterMessage(Profile) -_sym_db.RegisterMessage(Profile.CustomAttributesEntry) - -AvailabilitySignal = _reflection.GeneratedProtocolMessageType( - "AvailabilitySignal", - (_message.Message,), - dict( - DESCRIPTOR=_AVAILABILITYSIGNAL, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Candidate availability signal. - - - Attributes: - type: - Type of signal. - last_update_time: - Timestamp of when the given availability activity last - happened. - filter_satisfied: - Indicates if the [last\_update\_time][google.cloud.talent.v4be - ta1.AvailabilitySignal.last\_update\_time] is within [Availabi - lityFilter.range][google.cloud.talent.v4beta1.AvailabilityFilt - er.range]. Returned only in a search response when there is - an [AvailabilityFilter][google.cloud.talent.v4beta1.Availabili - tyFilter] in [ProfileQuery.availability\_filters][google.cloud - .talent.v4beta1.ProfileQuery.availability\_filters] where [sig - nal\_type][google.cloud.talent.v4beta1.AvailabilityFilter.sign - al\_type] matches - [type][google.cloud.talent.v4beta1.AvailabilitySignal.type]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.AvailabilitySignal) - ), -) -_sym_db.RegisterMessage(AvailabilitySignal) - -Resume = _reflection.GeneratedProtocolMessageType( - "Resume", - (_message.Message,), - dict( - DESCRIPTOR=_RESUME, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a resume. - - - Attributes: - structured_resume: - Users can create a profile with only this field field, if [res - ume\_type][google.cloud.talent.v4beta1.Resume.resume\_type] is - [HRXML][google.cloud.talent.v4beta1.Resume.ResumeType.HRXML]. - For example, the API parses this field and creates a profile - with all structured fields populated. [EmploymentRecord][googl - e.cloud.talent.v4beta1.EmploymentRecord], [EducationRecord][go - ogle.cloud.talent.v4beta1.EducationRecord], and so on. An - error is thrown if this field cannot be parsed. Note that the - use of the functionality offered by this field to extract data - from resumes is an Alpha feature and as such is not covered by - any SLA. - resume_type: - The format of [structured\_resume][google.cloud.talent.v4beta1 - .Resume.structured\_resume]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Resume) - ), -) -_sym_db.RegisterMessage(Resume) - -PersonName = _reflection.GeneratedProtocolMessageType( - "PersonName", - (_message.Message,), - dict( - PersonStructuredName=_reflection.GeneratedProtocolMessageType( - "PersonStructuredName", - (_message.Message,), - dict( - DESCRIPTOR=_PERSONNAME_PERSONSTRUCTUREDNAME, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a person's structured name. - - - Attributes: - given_name: - Given/first name. It's derived from [formatted\_name][google. - cloud.talent.v4beta1.PersonName.formatted\_name] if not - provided. Number of characters allowed is 100. - preferred_name: - Preferred given/first name or nickname. Number of characters - allowed is 100. - middle_initial: - Middle initial. It's derived from [formatted\_name][google.cl - oud.talent.v4beta1.PersonName.formatted\_name] if not - provided. Number of characters allowed is 20. - family_name: - Family/last name. It's derived from [formatted\_name][google. - cloud.talent.v4beta1.PersonName.formatted\_name] if not - provided. Number of characters allowed is 100. - suffixes: - Suffixes. Number of characters allowed is 20. - prefixes: - Prefixes. Number of characters allowed is 20. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.PersonName.PersonStructuredName) - ), - ), - DESCRIPTOR=_PERSONNAME, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents the name of a person. - - - Attributes: - person_name: - The name of a person. It can be one of [formatted\_name][googl - e.cloud.talent.v4beta1.PersonName.formatted\_name] or [structu - red\_name][google.cloud.talent.v4beta1.PersonName.structured\_ - name]. - formatted_name: - A string represents a person's full name. For example, "Dr. - John Smith". Number of characters allowed is 100. - structured_name: - A person's name in a structured way (last name, first name, - suffix, and so on.) - preferred_name: - Preferred name for the person. This field is ignored if [struc - tured\_name][google.cloud.talent.v4beta1.PersonName.structured - \_name] is provided. Number of characters allowed is 100. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.PersonName) - ), -) -_sym_db.RegisterMessage(PersonName) -_sym_db.RegisterMessage(PersonName.PersonStructuredName) - -Address = _reflection.GeneratedProtocolMessageType( - "Address", - (_message.Message,), - dict( - DESCRIPTOR=_ADDRESS, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a address. - - - Attributes: - usage: - The usage of the address. For example, SCHOOL, WORK, PERSONAL. - address: - The address of a person. It can be one of [unstructured\_addre - ss][google.cloud.talent.v4beta1.Address.unstructured\_address] - or [structured\_address][google.cloud.talent.v4beta1.Address.s - tructured\_address]. - unstructured_address: - Unstructured address. For example, "1600 Amphitheatre Pkwy, - Mountain View, CA 94043", "Sunnyvale, California". Number of - characters allowed is 100. - structured_address: - Structured address that contains street address, city, state, - country, and so on. - current: - Indicates if it's the person's current address. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Address) - ), -) -_sym_db.RegisterMessage(Address) - -Email = _reflection.GeneratedProtocolMessageType( - "Email", - (_message.Message,), - dict( - DESCRIPTOR=_EMAIL, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a person's email address. - - - Attributes: - usage: - The usage of the email address. For example, SCHOOL, WORK, - PERSONAL. - email_address: - Email address. Number of characters allowed is 4,000. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Email) - ), -) -_sym_db.RegisterMessage(Email) - -Phone = _reflection.GeneratedProtocolMessageType( - "Phone", - (_message.Message,), - dict( - DESCRIPTOR=_PHONE, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a person's telephone number. - - - Attributes: - usage: - The usage of the phone. For example, SCHOOL, WORK, PERSONAL. - type: - The phone type. For example, LANDLINE, MOBILE, FAX. - number: - Phone number. Any phone formats are supported and only exact - matches are performed on searches. For example, if a phone - number in profile is provided in the format of "(xxx)xxx- - xxxx", in profile searches the same phone format has to be - provided. Number of characters allowed is 20. - when_available: - When this number is available. Any descriptive string is - expected. Number of characters allowed is 100. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Phone) - ), -) -_sym_db.RegisterMessage(Phone) - -PersonalUri = _reflection.GeneratedProtocolMessageType( - "PersonalUri", - (_message.Message,), - dict( - DESCRIPTOR=_PERSONALURI, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a valid URI for a personal use. - - - Attributes: - uri: - The personal URI. Number of characters allowed is 4,000. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.PersonalUri) - ), -) -_sym_db.RegisterMessage(PersonalUri) - -AdditionalContactInfo = _reflection.GeneratedProtocolMessageType( - "AdditionalContactInfo", - (_message.Message,), - dict( - DESCRIPTOR=_ADDITIONALCONTACTINFO, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents contact information other than - phone, email, URI and addresses. - - - Attributes: - usage: - The usage of this contact method. For example, SCHOOL, WORK, - PERSONAL. - name: - The name of the contact method. For example, "hangout", - "skype". Number of characters allowed is 100. - contact_id: - The contact id. Number of characters allowed is 100. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.AdditionalContactInfo) - ), -) -_sym_db.RegisterMessage(AdditionalContactInfo) - -EmploymentRecord = _reflection.GeneratedProtocolMessageType( - "EmploymentRecord", - (_message.Message,), - dict( - DESCRIPTOR=_EMPLOYMENTRECORD, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents an employment record of a - candidate. - - - Attributes: - start_date: - Start date of the employment. - end_date: - End date of the employment. - employer_name: - The name of the employer company/organization. For example, - "Google", "Alphabet", and so on. Number of characters allowed - is 250. - division_name: - The division name of the employment. For example, division, - department, client, and so on. Number of characters allowed - is 100. - address: - The physical address of the employer. - job_title: - The job title of the employment. For example, "Software - Engineer", "Data Scientist", and so on. Number of characters - allowed is 250. - job_description: - The description of job content. Number of characters allowed - is 100,000. - is_supervisor: - If the jobs is a supervisor position. - is_self_employed: - If this employment is self-employed. - is_current: - If this employment is current. - job_title_snippet: - Output only. The job title snippet shows how the [job\_title][ - google.cloud.talent.v4beta1.EmploymentRecord.job\_title] is - related to a search query. It's empty if the [job\_title][goog - le.cloud.talent.v4beta1.EmploymentRecord.job\_title] isn't - related to the search query. - job_description_snippet: - Output only. The job description snippet shows how the [job\_d - escription][google.cloud.talent.v4beta1.EmploymentRecord.job\_ - description] is related to a search query. It's empty if the [ - job\_description][google.cloud.talent.v4beta1.EmploymentRecord - .job\_description] isn't related to the search query. - employer_name_snippet: - Output only. The employer name snippet shows how the [employer - \_name][google.cloud.talent.v4beta1.EmploymentRecord.employer\ - _name] is related to a search query. It's empty if the [employ - er\_name][google.cloud.talent.v4beta1.EmploymentRecord.employe - r\_name] isn't related to the search query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.EmploymentRecord) - ), -) -_sym_db.RegisterMessage(EmploymentRecord) - -EducationRecord = _reflection.GeneratedProtocolMessageType( - "EducationRecord", - (_message.Message,), - dict( - DESCRIPTOR=_EDUCATIONRECORD, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents an education record of a - candidate. - - - Attributes: - start_date: - The start date of the education. - end_date: - The end date of the education. - expected_graduation_date: - The expected graduation date if currently pursuing a degree. - school_name: - The name of the school or institution. For example, "Stanford - University", "UC Berkeley", and so on. Number of characters - allowed is 250. - address: - The physical address of the education institution. - degree: - The degree information. It can be one of [degree\_description] - [google.cloud.talent.v4beta1.EducationRecord.degree\_descripti - on] or [structured\_degree][google.cloud.talent.v4beta1.Educat - ionRecord.structured\_degree]. - degree_description: - The full description of the degree. For example, "Master of - Science in Computer Science", "B.S in Math". Number of - characters allowed is 100. - structured_degree: - The structured notation of the degree. - description: - The description of the education. Number of characters - allowed is 100,000. - is_current: - If this education is current. - school_name_snippet: - Output only. The school name snippet shows how the [school\_na - me][google.cloud.talent.v4beta1.EducationRecord.school\_name] - is related to a search query in search result. It's empty if - the [school\_name][google.cloud.talent.v4beta1.EducationRecord - .school\_name] isn't related to the search query. - degree_snippet: - Output only. The job description snippet shows how the - [Degree][google.cloud.talent.v4beta1.Degree] is related to a - search query in search result. It's empty if the - [Degree][google.cloud.talent.v4beta1.Degree] isn't related to - the search query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.EducationRecord) - ), -) -_sym_db.RegisterMessage(EducationRecord) - -Degree = _reflection.GeneratedProtocolMessageType( - "Degree", - (_message.Message,), - dict( - DESCRIPTOR=_DEGREE, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a degree pursuing or acquired by - a candidate. - - - Attributes: - degree_type: - ISCED degree type. - degree_name: - Full Degree name. For example, "B.S.", "Master of Arts", and - so on. Number of characters allowed is 100. - fields_of_study: - Fields of study for the degree. For example, "Computer - science", "engineering". Number of characters allowed is 100. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Degree) - ), -) -_sym_db.RegisterMessage(Degree) - -Activity = _reflection.GeneratedProtocolMessageType( - "Activity", - (_message.Message,), - dict( - DESCRIPTOR=_ACTIVITY, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents an individual or collaborative - activity participated in by a candidate, for example, an open-source - project, a class assignment, and so on. - - - Attributes: - display_name: - Activity display name. Number of characters allowed is 100. - description: - Activity description. Number of characters allowed is - 100,000. - uri: - Activity URI. Number of characters allowed is 4,000. - create_date: - The first creation date of the activity. - update_date: - The last update date of the activity. - team_members: - A list of team members involved in this activity. Number of - characters allowed is 100. The limitation for max number of - team members is 50. - skills_used: - A list of skills used in this activity. The limitation for - max number of skills used is 50. - activity_name_snippet: - Output only. Activity name snippet shows how the [display\_nam - e][google.cloud.talent.v4beta1.Activity.display\_name] is - related to a search query. It's empty if the [display\_name][g - oogle.cloud.talent.v4beta1.Activity.display\_name] isn't - related to the search query. - activity_description_snippet: - Output only. Activity description snippet shows how the [descr - iption][google.cloud.talent.v4beta1.Activity.description] is - related to a search query. It's empty if the [description][goo - gle.cloud.talent.v4beta1.Activity.description] isn't related - to the search query. - skills_used_snippet: - Output only. Skill used snippet shows how the corresponding [s - kills\_used][google.cloud.talent.v4beta1.Activity.skills\_used - ] are related to a search query. It's empty if the - corresponding [skills\_used][google.cloud.talent.v4beta1.Activ - ity.skills\_used] are not related to the search query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Activity) - ), -) -_sym_db.RegisterMessage(Activity) - -Publication = _reflection.GeneratedProtocolMessageType( - "Publication", - (_message.Message,), - dict( - DESCRIPTOR=_PUBLICATION, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents a publication resource of a - candidate. - - - Attributes: - authors: - A list of author names. Number of characters allowed is 100. - title: - The title of the publication. Number of characters allowed is - 100. - description: - The description of the publication. Number of characters - allowed is 100,000. - journal: - The journal name of the publication. Number of characters - allowed is 100. - volume: - Volume number. Number of characters allowed is 100. - publisher: - The publisher of the journal. Number of characters allowed is - 100. - publication_date: - The publication date. - publication_type: - The publication type. Number of characters allowed is 100. - isbn: - ISBN number. Number of characters allowed is 100. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Publication) - ), -) -_sym_db.RegisterMessage(Publication) - -Patent = _reflection.GeneratedProtocolMessageType( - "Patent", - (_message.Message,), - dict( - DESCRIPTOR=_PATENT, - __module__="google.cloud.talent_v4beta1.proto.profile_pb2", - __doc__="""Resource that represents the patent acquired by a - candidate. - - - Attributes: - display_name: - Name of the patent. Number of characters allowed is 100. - inventors: - A list of inventors' names. Number of characters allowed for - each is 100. - patent_status: - The status of the patent. Number of characters allowed is - 100. - patent_status_date: - The date the last time the status of the patent was checked. - patent_filing_date: - The date that the patent was filed. - patent_office: - The name of the patent office. Number of characters allowed - is 100. - patent_number: - The number of the patent. Number of characters allowed is - 100. - patent_description: - The description of the patent. Number of characters allowed - is 100,000. - skills_used: - The skills used in this patent. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Patent) - ), -) -_sym_db.RegisterMessage(Patent) - - -DESCRIPTOR._options = None -_PROFILE_CUSTOMATTRIBUTESENTRY._options = None -_PROFILE.fields_by_name["applications"]._options = None -_PROFILE.fields_by_name["assignments"]._options = None -_PROFILE.fields_by_name["processed"]._options = None -_PROFILE.fields_by_name["keyword_snippet"]._options = None -_PROFILE.fields_by_name["availability_signals"]._options = None -_PROFILE.fields_by_name["derived_addresses"]._options = None -_PROFILE._options = None -_EMPLOYMENTRECORD.fields_by_name["job_title_snippet"]._options = None -_EMPLOYMENTRECORD.fields_by_name["job_description_snippet"]._options = None -_EMPLOYMENTRECORD.fields_by_name["employer_name_snippet"]._options = None -_EDUCATIONRECORD.fields_by_name["school_name_snippet"]._options = None -_EDUCATIONRECORD.fields_by_name["degree_snippet"]._options = None -_ACTIVITY.fields_by_name["activity_name_snippet"]._options = None -_ACTIVITY.fields_by_name["activity_description_snippet"]._options = None -_ACTIVITY.fields_by_name["skills_used_snippet"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/profile_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/profile_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/profile_service.proto b/talent/google/cloud/talent_v4beta1/proto/profile_service.proto deleted file mode 100644 index f443511e7015..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile_service.proto +++ /dev/null @@ -1,512 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/cloud/talent/v4beta1/filters.proto"; -import "google/cloud/talent/v4beta1/histogram.proto"; -import "google/cloud/talent/v4beta1/profile.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/any.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/rpc/status.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "ProfileServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service that handles profile management, including profile CRUD, -// enumeration and search. -service ProfileService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Lists profiles by filter. The order is unspecified. - rpc ListProfiles(ListProfilesRequest) returns (ListProfilesResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*/tenants/*}/profiles" - }; - option (google.api.method_signature) = "parent"; - } - - // Creates and returns a new profile. - rpc CreateProfile(CreateProfileRequest) returns (Profile) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}/profiles" - body: "*" - }; - option (google.api.method_signature) = "parent,profile"; - } - - // Gets the specified profile. - rpc GetProfile(GetProfileRequest) returns (Profile) { - option (google.api.http) = { - get: "/v4beta1/{name=projects/*/tenants/*/profiles/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the specified profile and returns the updated result. - rpc UpdateProfile(UpdateProfileRequest) returns (Profile) { - option (google.api.http) = { - patch: "/v4beta1/{profile.name=projects/*/tenants/*/profiles/*}" - body: "*" - }; - option (google.api.method_signature) = "profile"; - } - - // Deletes the specified profile. - // Prerequisite: The profile has no associated applications or assignments - // associated. - rpc DeleteProfile(DeleteProfileRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v4beta1/{name=projects/*/tenants/*/profiles/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Searches for profiles within a tenant. - // - // For example, search by raw queries "software engineer in Mountain View" or - // search by structured filters (location filter, education filter, etc.). - // - // See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information. - rpc SearchProfiles(SearchProfilesRequest) returns (SearchProfilesResponse) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*/tenants/*}:search" - body: "*" - }; - } -} - -// List profiles request. -message ListProfilesRequest { - // Required. The resource name of the tenant under which the profile is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenants/bar". - string parent = 1 [(google.api.field_behavior) = REQUIRED]; - - // The filter string specifies the profiles to be enumerated. - // - // Supported operator: =, AND - // - // The field(s) eligible for filtering are: - // - // * `externalId` - // * `groupId` - // - // externalId and groupId cannot be specified at the same time. If both - // externalId and groupId are provided, the API will return a bad request - // error. - // - // Sample Query: - // - // * externalId = "externalId-1" - // * groupId = "groupId-1" - string filter = 5; - - // The token that specifies the current offset (that is, starting result). - // - // Please set the value to [ListProfilesResponse.next_page_token][google.cloud.talent.v4beta1.ListProfilesResponse.next_page_token] to - // continue the list. - string page_token = 2; - - // The maximum number of profiles to be returned, at most 100. - // - // Default is 100 unless a positive number smaller than 100 is specified. - int32 page_size = 3; - - // A field mask to specify the profile fields to be listed in response. - // All fields are listed if it is unset. - // - // Valid values are: - // - // * name - google.protobuf.FieldMask read_mask = 4; -} - -// The List profiles response object. -message ListProfilesResponse { - // Profiles for the specific tenant. - repeated Profile profiles = 1; - - // A token to retrieve the next page of results. This is empty if there are no - // more results. - string next_page_token = 2; -} - -// Create profile request. -message CreateProfileRequest { - // Required. The name of the tenant this profile belongs to. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenants/bar". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Tenant" - } - ]; - - // Required. The profile to be created. - Profile profile = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Get profile request. -message GetProfileRequest { - // Required. Resource name of the profile to get. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For - // example, "projects/foo/tenants/bar/profiles/baz". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Profile" - } - ]; -} - -// Update profile request -message UpdateProfileRequest { - // Required. Profile to be updated. - Profile profile = 1 [(google.api.field_behavior) = REQUIRED]; - - // A field mask to specify the profile fields to update. - // - // A full update is performed if it is unset. - // - // Valid values are: - // - // * external_id - // * source - // * source_types - // * uri - // * is_hirable - // * create_time - // * update_time - // * candidate_update_time - // * resume_update_time - // * resume - // * person_names - // * addresses - // * email_addresses - // * phone_numbers - // * personal_uris - // * additional_contact_info - // * employment_records - // * education_records - // * skills - // * activities - // * publications - // * patents - // * certifications - // * recruiting_notes - // * custom_attributes - // * group_id - // * external_system - // * source_note - // * primary_responsibilities - // * citizenships - // * work_authorizations - // * employee_types - // * language_code - // * qualification_summary - // * allowed_contact_types - // * preferred_contact_types - // * contact_availability - // * language_fluencies - // * work_preference - // * industry_experiences - // * work_environment_experiences - // * work_availability - // * security_clearances - // * references - // * assessments - // * interviews - google.protobuf.FieldMask update_mask = 2; -} - -// Delete profile request. -message DeleteProfileRequest { - // Required. Resource name of the profile to be deleted. - // - // The format is - // "projects/{project_id}/tenants/{tenant_id}/profiles/{profile_id}". For - // example, "projects/foo/tenants/bar/profiles/baz". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Profile" - } - ]; -} - -// The request body of the `SearchProfiles` call. -message SearchProfilesRequest { - // Required. The resource name of the tenant to search within. - // - // The format is "projects/{project_id}/tenants/{tenant_id}". For example, - // "projects/foo/tenants/bar". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Tenant" - } - ]; - - // Required. The meta information collected about the profile search user. This is used - // to improve the search quality of the service. These values are provided by - // users, and must be precise and consistent. - RequestMetadata request_metadata = 2 [(google.api.field_behavior) = REQUIRED]; - - // Search query to execute. See [ProfileQuery][google.cloud.talent.v4beta1.ProfileQuery] for more details. - ProfileQuery profile_query = 3; - - // A limit on the number of profiles returned in the search results. - // A value above the default value 10 can increase search response time. - // - // The maximum value allowed is 100. Otherwise an error is thrown. - int32 page_size = 4; - - // The pageToken, similar to offset enables users of the API to paginate - // through the search results. To retrieve the first page of results, set the - // pageToken to empty. The search response includes a - // [nextPageToken][google.cloud.talent.v4beta1.SearchProfilesResponse.next_page_token] field that can be - // used to populate the pageToken field for the next page of results. Using - // pageToken instead of offset increases the performance of the API, - // especially compared to larger offset values. - string page_token = 5; - - // An integer that specifies the current offset (that is, starting result) in - // search results. This field is only considered if [page_token][google.cloud.talent.v4beta1.SearchProfilesRequest.page_token] is unset. - // - // The maximum allowed value is 5000. Otherwise an error is thrown. - // - // For example, 0 means to search from the first profile, and 10 means to - // search from the 11th profile. This can be used for pagination, for example - // pageSize = 10 and offset = 10 means to search from the second page. - int32 offset = 6; - - // This flag controls the spell-check feature. If `false`, the - // service attempts to correct a misspelled query. - // - // For example, "enginee" is corrected to "engineer". - bool disable_spell_check = 7; - - // The criteria that determines how search results are sorted. - // Defaults is "relevance desc" if no value is specified. - // - // Supported options are: - // - // * "relevance desc": By descending relevance, as determined by the API - // algorithms. - // * "update_date desc": Sort by [Profile.update_time][google.cloud.talent.v4beta1.Profile.update_time] in descending order - // (recently updated profiles first). - // * "create_date desc": Sort by [Profile.create_time][google.cloud.talent.v4beta1.Profile.create_time] in descending order - // (recently created profiles first). - // * "first_name": Sort by [PersonName.PersonStructuredName.given_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.given_name] in - // ascending order. - // * "first_name desc": Sort by [PersonName.PersonStructuredName.given_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.given_name] - // in descending order. - // * "last_name": Sort by [PersonName.PersonStructuredName.family_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.family_name] in - // ascending order. - // * "last_name desc": Sort by [PersonName.PersonStructuredName.family_name][google.cloud.talent.v4beta1.PersonName.PersonStructuredName.family_name] - // in ascending order. - string order_by = 8; - - // When sort by field is based on alphabetical order, sort values case - // sensitively (based on ASCII) when the value is set to true. Default value - // is case in-sensitive sort (false). - bool case_sensitive_sort = 9; - - // A list of expressions specifies histogram requests against matching - // profiles for [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest]. - // - // The expression syntax looks like a function definition with parameters. - // - // Function syntax: function_name(histogram_facet[, list of buckets]) - // - // Data types: - // - // * Histogram facet: facet names with format [a-zA-Z][a-zA-Z0-9_]+. - // * String: string like "any string with backslash escape for quote(\")." - // * Number: whole number and floating point number like 10, -1 and -0.01. - // * List: list of elements with comma(,) separator surrounded by square - // brackets. For example, [1, 2, 3] and ["one", "two", "three"]. - // - // Built-in constants: - // - // * MIN (minimum number similar to java Double.MIN_VALUE) - // * MAX (maximum number similar to java Double.MAX_VALUE) - // - // Built-in functions: - // - // * bucket(start, end[, label]) - // Bucket build-in function creates a bucket with range of [start, end). Note - // that the end is exclusive. - // For example, bucket(1, MAX, "positive number") or bucket(1, 10). - // - // Histogram Facets: - // - // * admin1: Admin1 is a global placeholder for referring to state, province, - // or the particular term a country uses to define the geographic structure - // below the country level. Examples include states codes such as "CA", "IL", - // "NY", and provinces, such as "BC". - // * locality: Locality is a global placeholder for referring to city, town, - // or the particular term a country uses to define the geographic structure - // below the admin1 level. Examples include city names such as - // "Mountain View" and "New York". - // * extended_locality: Extended locality is concatenated version of admin1 - // and locality with comma separator. For example, "Mountain View, CA" and - // "New York, NY". - // * postal_code: Postal code of profile which follows locale code. - // * country: Country code (ISO-3166-1 alpha-2 code) of profile, such as US, - // JP, GB. - // * job_title: Normalized job titles specified in EmploymentHistory. - // * company_name: Normalized company name of profiles to match on. - // * institution: The school name. For example, "MIT", - // "University of California, Berkeley" - // * degree: Highest education degree in ISCED code. Each value in degree - // covers a specific level of education, without any expansion to upper nor - // lower levels of education degree. - // * experience_in_months: experience in months. 0 means 0 month to 1 month - // (exclusive). - // * application_date: The application date specifies application start dates. - // See [ApplicationDateFilter][google.cloud.talent.v4beta1.ApplicationDateFilter] for more details. - // * application_outcome_notes: The application outcome reason specifies the - // reasons behind the outcome of the job application. - // See [ApplicationOutcomeNotesFilter][google.cloud.talent.v4beta1.ApplicationOutcomeNotesFilter] for more details. - // * application_job_title: The application job title specifies the job - // applied for in the application. - // See [ApplicationJobFilter][google.cloud.talent.v4beta1.ApplicationJobFilter] for more details. - // * hirable_status: Hirable status specifies the profile's hirable status. - // * string_custom_attribute: String custom attributes. Values can be accessed - // via square bracket notation like string_custom_attribute["key1"]. - // * numeric_custom_attribute: Numeric custom attributes. Values can be - // accessed via square bracket notation like numeric_custom_attribute["key1"]. - // - // Example expressions: - // - // * count(admin1) - // * count(experience_in_months, [bucket(0, 12, "1 year"), - // bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ years")]) - // * count(string_custom_attribute["assigned_recruiter"]) - // * count(numeric_custom_attribute["favorite_number"], - // [bucket(MIN, 0, "negative"), bucket(0, MAX, "non-negative")]) - repeated HistogramQuery histogram_queries = 10; - - // An id that uniquely identifies the result set of a - // [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles] call. The id should be - // retrieved from the - // [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse] message returned from a previous - // invocation of [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles]. - // - // A result set is an ordered list of search results. - // - // If this field is not set, a new result set is computed based on the - // [profile_query][google.cloud.talent.v4beta1.SearchProfilesRequest.profile_query]. A new [result_set_id][google.cloud.talent.v4beta1.SearchProfilesRequest.result_set_id] is returned as a handle to - // access this result set. - // - // If this field is set, the service will ignore the resource and - // [profile_query][google.cloud.talent.v4beta1.SearchProfilesRequest.profile_query] values, and simply retrieve a page of results from the - // corresponding result set. In this case, one and only one of [page_token][google.cloud.talent.v4beta1.SearchProfilesRequest.page_token] - // or [offset][google.cloud.talent.v4beta1.SearchProfilesRequest.offset] must be set. - // - // A typical use case is to invoke [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] without this - // field, then use the resulting [result_set_id][google.cloud.talent.v4beta1.SearchProfilesRequest.result_set_id] in - // [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse] to page through the results. - string result_set_id = 12; - - // This flag is used to indicate whether the service will attempt to - // understand synonyms and terms related to the search query or treat the - // query "as is" when it generates a set of results. By default this flag is - // set to false, thus allowing expanded results to also be returned. For - // example a search for "software engineer" might also return candidates who - // have experience in jobs similar to software engineer positions. By setting - // this flag to true, the service will only attempt to deliver candidates has - // software engineer in his/her global fields by treating "software engineer" - // as a keyword. - // - // It is recommended to provide a feature in the UI (such as a checkbox) to - // allow recruiters to set this flag to true if they intend to search for - // longer boolean strings. - bool strict_keywords_search = 13; -} - -// Response of SearchProfiles method. -message SearchProfilesResponse { - // An estimation of the number of profiles that match the specified query. - // - // This number isn't guaranteed to be accurate. - int64 estimated_total_size = 1; - - // The spell checking result, and correction. - SpellingCorrection spell_correction = 2; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 3; - - // A token to retrieve the next page of results. This is empty if there are no - // more results. - string next_page_token = 4; - - // The histogram results that match with specified - // [SearchProfilesRequest.histogram_queries][google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries]. - repeated HistogramQueryResult histogram_query_results = 5; - - // The profile entities that match the specified [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest]. - repeated SummarizedProfile summarized_profiles = 6; - - // An id that uniquely identifies the result set of a - // [SearchProfiles][google.cloud.talent.v4beta1.ProfileService.SearchProfiles] call for consistent - // results. - string result_set_id = 7; -} - -// Profile entry with metadata inside [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse]. -message SummarizedProfile { - // A list of profiles that are linked by [Profile.group_id][google.cloud.talent.v4beta1.Profile.group_id]. - repeated Profile profiles = 1; - - // A profile summary shows the profile summary and how the profile matches the - // search query. - // - // In profile summary, the profiles with the same [Profile.group_id][google.cloud.talent.v4beta1.Profile.group_id] are - // merged together. Among profiles, same education/employment records may be - // slightly different but they are merged into one with best efforts. - // - // For example, in one profile the school name is "UC Berkeley" and the field - // study is "Computer Science" and in another one the school name is - // "University of California at Berkeley" and the field study is "CS". The API - // merges these two inputs into one and selects one value for each field. For - // example, the school name in summary is set to "University of California at - // Berkeley" and the field of study is set to "Computer Science". - Profile summary = 2; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2.py deleted file mode 100644 index d471c3ed3b9c..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2.py +++ /dev/null @@ -1,1470 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/profile_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - filters_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - histogram_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - profile_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import any_pb2 as google_dot_protobuf_dot_any__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/profile_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\023ProfileServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n7google/cloud/talent_v4beta1/proto/profile_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a/google/cloud/talent_v4beta1/proto/filters.proto\x1a\x31google/cloud/talent_v4beta1/proto/histogram.proto\x1a/google/cloud/talent_v4beta1/proto/profile.proto\x1a#google/longrunning/operations.proto\x1a\x19google/protobuf/any.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto"\x90\x01\n\x13ListProfilesRequest\x12\x13\n\x06parent\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x0e\n\x06\x66ilter\x18\x05 \x01(\t\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05\x12-\n\tread_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"g\n\x14ListProfilesResponse\x12\x36\n\x08profiles\x18\x01 \x03(\x0b\x32$.google.cloud.talent.v4beta1.Profile\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x86\x01\n\x14\x43reateProfileRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12:\n\x07profile\x18\x02 \x01(\x0b\x32$.google.cloud.talent.v4beta1.ProfileB\x03\xe0\x41\x02"F\n\x11GetProfileRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Profile"\x83\x01\n\x14UpdateProfileRequest\x12:\n\x07profile\x18\x01 \x01(\x0b\x32$.google.cloud.talent.v4beta1.ProfileB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"I\n\x14\x44\x65leteProfileRequest\x12\x31\n\x04name\x18\x01 \x01(\tB#\xe0\x41\x02\xfa\x41\x1d\n\x1bjobs.googleapis.com/Profile"\xdc\x03\n\x15SearchProfilesRequest\x12\x32\n\x06parent\x18\x01 \x01(\tB"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant\x12K\n\x10request_metadata\x18\x02 \x01(\x0b\x32,.google.cloud.talent.v4beta1.RequestMetadataB\x03\xe0\x41\x02\x12@\n\rprofile_query\x18\x03 \x01(\x0b\x32).google.cloud.talent.v4beta1.ProfileQuery\x12\x11\n\tpage_size\x18\x04 \x01(\x05\x12\x12\n\npage_token\x18\x05 \x01(\t\x12\x0e\n\x06offset\x18\x06 \x01(\x05\x12\x1b\n\x13\x64isable_spell_check\x18\x07 \x01(\x08\x12\x10\n\x08order_by\x18\x08 \x01(\t\x12\x1b\n\x13\x63\x61se_sensitive_sort\x18\t \x01(\x08\x12\x46\n\x11histogram_queries\x18\n \x03(\x0b\x32+.google.cloud.talent.v4beta1.HistogramQuery\x12\x15\n\rresult_set_id\x18\x0c \x01(\t\x12\x1e\n\x16strict_keywords_search\x18\r \x01(\x08"\x93\x03\n\x16SearchProfilesResponse\x12\x1c\n\x14\x65stimated_total_size\x18\x01 \x01(\x03\x12I\n\x10spell_correction\x18\x02 \x01(\x0b\x32/.google.cloud.talent.v4beta1.SpellingCorrection\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata\x12\x17\n\x0fnext_page_token\x18\x04 \x01(\t\x12R\n\x17histogram_query_results\x18\x05 \x03(\x0b\x32\x31.google.cloud.talent.v4beta1.HistogramQueryResult\x12K\n\x13summarized_profiles\x18\x06 \x03(\x0b\x32..google.cloud.talent.v4beta1.SummarizedProfile\x12\x15\n\rresult_set_id\x18\x07 \x01(\t"\x82\x01\n\x11SummarizedProfile\x12\x36\n\x08profiles\x18\x01 \x03(\x0b\x32$.google.cloud.talent.v4beta1.Profile\x12\x35\n\x07summary\x18\x02 \x01(\x0b\x32$.google.cloud.talent.v4beta1.Profile2\x9f\t\n\x0eProfileService\x12\xb5\x01\n\x0cListProfiles\x12\x30.google.cloud.talent.v4beta1.ListProfilesRequest\x1a\x31.google.cloud.talent.v4beta1.ListProfilesResponse"@\x82\xd3\xe4\x93\x02\x31\x12//v4beta1/{parent=projects/*/tenants/*}/profiles\xda\x41\x06parent\x12\xb5\x01\n\rCreateProfile\x12\x31.google.cloud.talent.v4beta1.CreateProfileRequest\x1a$.google.cloud.talent.v4beta1.Profile"K\x82\xd3\xe4\x93\x02\x34"//v4beta1/{parent=projects/*/tenants/*}/profiles:\x01*\xda\x41\x0eparent,profile\x12\xa2\x01\n\nGetProfile\x12..google.cloud.talent.v4beta1.GetProfileRequest\x1a$.google.cloud.talent.v4beta1.Profile">\x82\xd3\xe4\x93\x02\x31\x12//v4beta1/{name=projects/*/tenants/*/profiles/*}\xda\x41\x04name\x12\xb6\x01\n\rUpdateProfile\x12\x31.google.cloud.talent.v4beta1.UpdateProfileRequest\x1a$.google.cloud.talent.v4beta1.Profile"L\x82\xd3\xe4\x93\x02<27/v4beta1/{profile.name=projects/*/tenants/*/profiles/*}:\x01*\xda\x41\x07profile\x12\x9a\x01\n\rDeleteProfile\x12\x31.google.cloud.talent.v4beta1.DeleteProfileRequest\x1a\x16.google.protobuf.Empty">\x82\xd3\xe4\x93\x02\x31*//v4beta1/{name=projects/*/tenants/*/profiles/*}\xda\x41\x04name\x12\xb3\x01\n\x0eSearchProfiles\x12\x32.google.cloud.talent.v4beta1.SearchProfilesRequest\x1a\x33.google.cloud.talent.v4beta1.SearchProfilesResponse"8\x82\xd3\xe4\x93\x02\x32"-/v4beta1/{parent=projects/*/tenants/*}:search:\x01*\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x81\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x13ProfileServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_any__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_LISTPROFILESREQUEST = _descriptor.Descriptor( - name="ListProfilesRequest", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest.filter", - index=1, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest.page_token", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest.page_size", - index=3, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="read_mask", - full_name="google.cloud.talent.v4beta1.ListProfilesRequest.read_mask", - index=4, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=553, - serialized_end=697, -) - - -_LISTPROFILESRESPONSE = _descriptor.Descriptor( - name="ListProfilesResponse", - full_name="google.cloud.talent.v4beta1.ListProfilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="profiles", - full_name="google.cloud.talent.v4beta1.ListProfilesResponse.profiles", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.ListProfilesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=699, - serialized_end=802, -) - - -_CREATEPROFILEREQUEST = _descriptor.Descriptor( - name="CreateProfileRequest", - full_name="google.cloud.talent.v4beta1.CreateProfileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateProfileRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\034\n\032jobs.googleapis.com/Tenant"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profile", - full_name="google.cloud.talent.v4beta1.CreateProfileRequest.profile", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=805, - serialized_end=939, -) - - -_GETPROFILEREQUEST = _descriptor.Descriptor( - name="GetProfileRequest", - full_name="google.cloud.talent.v4beta1.GetProfileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.GetProfileRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Profile" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=941, - serialized_end=1011, -) - - -_UPDATEPROFILEREQUEST = _descriptor.Descriptor( - name="UpdateProfileRequest", - full_name="google.cloud.talent.v4beta1.UpdateProfileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="profile", - full_name="google.cloud.talent.v4beta1.UpdateProfileRequest.profile", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.UpdateProfileRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1014, - serialized_end=1145, -) - - -_DELETEPROFILEREQUEST = _descriptor.Descriptor( - name="DeleteProfileRequest", - full_name="google.cloud.talent.v4beta1.DeleteProfileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.DeleteProfileRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\035\n\033jobs.googleapis.com/Profile" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1147, - serialized_end=1220, -) - - -_SEARCHPROFILESREQUEST = _descriptor.Descriptor( - name="SearchProfilesRequest", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\034\n\032jobs.googleapis.com/Tenant"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="request_metadata", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.request_metadata", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="profile_query", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.profile_query", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.page_size", - index=3, - number=4, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.page_token", - index=4, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="offset", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.offset", - index=5, - number=6, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="disable_spell_check", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.disable_spell_check", - index=6, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="order_by", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.order_by", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="case_sensitive_sort", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.case_sensitive_sort", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram_queries", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.histogram_queries", - index=9, - number=10, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="result_set_id", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.result_set_id", - index=10, - number=12, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="strict_keywords_search", - full_name="google.cloud.talent.v4beta1.SearchProfilesRequest.strict_keywords_search", - index=11, - number=13, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1223, - serialized_end=1699, -) - - -_SEARCHPROFILESRESPONSE = _descriptor.Descriptor( - name="SearchProfilesResponse", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="estimated_total_size", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.estimated_total_size", - index=0, - number=1, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spell_correction", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.spell_correction", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.next_page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="histogram_query_results", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.histogram_query_results", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="summarized_profiles", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.summarized_profiles", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="result_set_id", - full_name="google.cloud.talent.v4beta1.SearchProfilesResponse.result_set_id", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1702, - serialized_end=2105, -) - - -_SUMMARIZEDPROFILE = _descriptor.Descriptor( - name="SummarizedProfile", - full_name="google.cloud.talent.v4beta1.SummarizedProfile", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="profiles", - full_name="google.cloud.talent.v4beta1.SummarizedProfile.profiles", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="summary", - full_name="google.cloud.talent.v4beta1.SummarizedProfile.summary", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2108, - serialized_end=2238, -) - -_LISTPROFILESREQUEST.fields_by_name[ - "read_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTPROFILESRESPONSE.fields_by_name[ - "profiles" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE -) -_CREATEPROFILEREQUEST.fields_by_name[ - "profile" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE -) -_UPDATEPROFILEREQUEST.fields_by_name[ - "profile" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE -) -_UPDATEPROFILEREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_SEARCHPROFILESREQUEST.fields_by_name[ - "request_metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._REQUESTMETADATA -) -_SEARCHPROFILESREQUEST.fields_by_name[ - "profile_query" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_filters__pb2._PROFILEQUERY -) -_SEARCHPROFILESREQUEST.fields_by_name[ - "histogram_queries" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2._HISTOGRAMQUERY -) -_SEARCHPROFILESRESPONSE.fields_by_name[ - "spell_correction" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._SPELLINGCORRECTION -) -_SEARCHPROFILESRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -_SEARCHPROFILESRESPONSE.fields_by_name[ - "histogram_query_results" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_histogram__pb2._HISTOGRAMQUERYRESULT -) -_SEARCHPROFILESRESPONSE.fields_by_name[ - "summarized_profiles" -].message_type = _SUMMARIZEDPROFILE -_SUMMARIZEDPROFILE.fields_by_name[ - "profiles" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE -) -_SUMMARIZEDPROFILE.fields_by_name[ - "summary" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE -) -DESCRIPTOR.message_types_by_name["ListProfilesRequest"] = _LISTPROFILESREQUEST -DESCRIPTOR.message_types_by_name["ListProfilesResponse"] = _LISTPROFILESRESPONSE -DESCRIPTOR.message_types_by_name["CreateProfileRequest"] = _CREATEPROFILEREQUEST -DESCRIPTOR.message_types_by_name["GetProfileRequest"] = _GETPROFILEREQUEST -DESCRIPTOR.message_types_by_name["UpdateProfileRequest"] = _UPDATEPROFILEREQUEST -DESCRIPTOR.message_types_by_name["DeleteProfileRequest"] = _DELETEPROFILEREQUEST -DESCRIPTOR.message_types_by_name["SearchProfilesRequest"] = _SEARCHPROFILESREQUEST -DESCRIPTOR.message_types_by_name["SearchProfilesResponse"] = _SEARCHPROFILESRESPONSE -DESCRIPTOR.message_types_by_name["SummarizedProfile"] = _SUMMARIZEDPROFILE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ListProfilesRequest = _reflection.GeneratedProtocolMessageType( - "ListProfilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPROFILESREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""List profiles request. - - - Attributes: - parent: - Required. The resource name of the tenant under which the - profile is created. The format is - "projects/{project\_id}/tenants/{tenant\_id}". For example, - "projects/foo/tenants/bar". - filter: - The filter string specifies the profiles to be enumerated. - Supported operator: =, AND The field(s) eligible for - filtering are: - ``externalId`` - ``groupId`` externalId - and groupId cannot be specified at the same time. If both - externalId and groupId are provided, the API will return a bad - request error. Sample Query: - externalId = "externalId-1" - - groupId = "groupId-1" - page_token: - The token that specifies the current offset (that is, starting - result). Please set the value to [ListProfilesResponse.next\_ - page\_token][google.cloud.talent.v4beta1.ListProfilesResponse. - next\_page\_token] to continue the list. - page_size: - The maximum number of profiles to be returned, at most 100. - Default is 100 unless a positive number smaller than 100 is - specified. - read_mask: - A field mask to specify the profile fields to be listed in - response. All fields are listed if it is unset. Valid values - are: - name - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListProfilesRequest) - ), -) -_sym_db.RegisterMessage(ListProfilesRequest) - -ListProfilesResponse = _reflection.GeneratedProtocolMessageType( - "ListProfilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPROFILESRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""The List profiles response object. - - - Attributes: - profiles: - Profiles for the specific tenant. - next_page_token: - A token to retrieve the next page of results. This is empty if - there are no more results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListProfilesResponse) - ), -) -_sym_db.RegisterMessage(ListProfilesResponse) - -CreateProfileRequest = _reflection.GeneratedProtocolMessageType( - "CreateProfileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEPROFILEREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Create profile request. - - - Attributes: - parent: - Required. The name of the tenant this profile belongs to. The - format is "projects/{project\_id}/tenants/{tenant\_id}". For - example, "projects/foo/tenants/bar". - profile: - Required. The profile to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateProfileRequest) - ), -) -_sym_db.RegisterMessage(CreateProfileRequest) - -GetProfileRequest = _reflection.GeneratedProtocolMessageType( - "GetProfileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETPROFILEREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Get profile request. - - - Attributes: - name: - Required. Resource name of the profile to get. The format is - "projects/{project\_id}/tenants/{tenant\_id}/profiles/{profile - \_id}". For example, "projects/foo/tenants/bar/profiles/baz". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.GetProfileRequest) - ), -) -_sym_db.RegisterMessage(GetProfileRequest) - -UpdateProfileRequest = _reflection.GeneratedProtocolMessageType( - "UpdateProfileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEPROFILEREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Update profile request - - - Attributes: - profile: - Required. Profile to be updated. - update_mask: - A field mask to specify the profile fields to update. A full - update is performed if it is unset. Valid values are: - - external\_id - source - source\_types - uri - is\_hirable - - create\_time - update\_time - candidate\_update\_time - - resume\_update\_time - resume - person\_names - addresses - - email\_addresses - phone\_numbers - personal\_uris - - additional\_contact\_info - employment\_records - - education\_records - skills - activities - publications - - patents - certifications - recruiting\_notes - - custom\_attributes - group\_id - external\_system - - source\_note - primary\_responsibilities - citizenships - - work\_authorizations - employee\_types - language\_code - - qualification\_summary - allowed\_contact\_types - - preferred\_contact\_types - contact\_availability - - language\_fluencies - work\_preference - - industry\_experiences - work\_environment\_experiences - - work\_availability - security\_clearances - references - - assessments - interviews - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.UpdateProfileRequest) - ), -) -_sym_db.RegisterMessage(UpdateProfileRequest) - -DeleteProfileRequest = _reflection.GeneratedProtocolMessageType( - "DeleteProfileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPROFILEREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Delete profile request. - - - Attributes: - name: - Required. Resource name of the profile to be deleted. The - format is "projects/{project\_id}/tenants/{tenant\_id}/profile - s/{profile\_id}". For example, - "projects/foo/tenants/bar/profiles/baz". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeleteProfileRequest) - ), -) -_sym_db.RegisterMessage(DeleteProfileRequest) - -SearchProfilesRequest = _reflection.GeneratedProtocolMessageType( - "SearchProfilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHPROFILESREQUEST, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""The request body of the ``SearchProfiles`` call. - - - Attributes: - parent: - Required. The resource name of the tenant to search within. - The format is "projects/{project\_id}/tenants/{tenant\_id}". - For example, "projects/foo/tenants/bar". - request_metadata: - Required. The meta information collected about the profile - search user. This is used to improve the search quality of the - service. These values are provided by users, and must be - precise and consistent. - profile_query: - Search query to execute. See - [ProfileQuery][google.cloud.talent.v4beta1.ProfileQuery] for - more details. - page_size: - A limit on the number of profiles returned in the search - results. A value above the default value 10 can increase - search response time. The maximum value allowed is 100. - Otherwise an error is thrown. - page_token: - The pageToken, similar to offset enables users of the API to - paginate through the search results. To retrieve the first - page of results, set the pageToken to empty. The search - response includes a [nextPageToken][google.cloud.talent.v4beta - 1.SearchProfilesResponse.next\_page\_token] field that can be - used to populate the pageToken field for the next page of - results. Using pageToken instead of offset increases the - performance of the API, especially compared to larger offset - values. - offset: - An integer that specifies the current offset (that is, - starting result) in search results. This field is only - considered if [page\_token][google.cloud.talent.v4beta1.Search - ProfilesRequest.page\_token] is unset. The maximum allowed - value is 5000. Otherwise an error is thrown. For example, 0 - means to search from the first profile, and 10 means to search - from the 11th profile. This can be used for pagination, for - example pageSize = 10 and offset = 10 means to search from the - second page. - disable_spell_check: - This flag controls the spell-check feature. If ``false``, the - service attempts to correct a misspelled query. For example, - "enginee" is corrected to "engineer". - order_by: - The criteria that determines how search results are sorted. - Defaults is "relevance desc" if no value is specified. - Supported options are: - "relevance desc": By descending - relevance, as determined by the API algorithms. - - "update\_date desc": Sort by [Profile.update\_time][google. - cloud.talent.v4beta1.Profile.update\_time] in descending - order (recently updated profiles first). - "create\_date - desc": Sort by [Profile.create\_time][google.cloud.talent.v - 4beta1.Profile.create\_time] in descending order (recently - created profiles first). - "first\_name": Sort by [PersonN - ame.PersonStructuredName.given\_name][google.cloud.talent.v4be - ta1.PersonName.PersonStructuredName.given\_name] in - ascending order. - "first\_name desc": Sort by [PersonName - .PersonStructuredName.given\_name][google.cloud.talent.v4beta1 - .PersonName.PersonStructuredName.given\_name] in descending - order. - "last\_name": Sort by [PersonName.PersonStructure - dName.family\_name][google.cloud.talent.v4beta1.PersonName.Per - sonStructuredName.family\_name] in ascending order. - - "last\_name desc": Sort by [PersonName.PersonStructuredName - .family\_name][google.cloud.talent.v4beta1.PersonName.PersonSt - ructuredName.family\_name] in ascending order. - case_sensitive_sort: - When sort by field is based on alphabetical order, sort values - case sensitively (based on ASCII) when the value is set to - true. Default value is case in-sensitive sort (false). - histogram_queries: - A list of expressions specifies histogram requests against - matching profiles for [SearchProfilesRequest][google.cloud.tal - ent.v4beta1.SearchProfilesRequest]. The expression syntax - looks like a function definition with parameters. Function - syntax: function\_name(histogram\_facet[, list of buckets]) - Data types: - Histogram facet: facet names with format - [a-zA-Z][a-zA-Z0-9\_]+. - String: string like "any string - with backslash escape for quote(")." - Number: whole number - and floating point number like 10, -1 and -0.01. - List: list - of elements with comma(,) separator surrounded by square - brackets. For example, [1, 2, 3] and ["one", "two", "three"]. - Built-in constants: - MIN (minimum number similar to java - Double.MIN\_VALUE) - MAX (maximum number similar to java - Double.MAX\_VALUE) Built-in functions: - bucket(start, - end[, label]) Bucket build-in function creates a bucket - with range of [start, end). Note that the end is exclusive. - For example, bucket(1, MAX, "positive number") or bucket(1, - 10). Histogram Facets: - admin1: Admin1 is a global - placeholder for referring to state, province, or the - particular term a country uses to define the geographic - structure below the country level. Examples include states - codes such as "CA", "IL", "NY", and provinces, such as "BC". - - locality: Locality is a global placeholder for referring to - city, town, or the particular term a country uses to define - the geographic structure below the admin1 level. Examples - include city names such as "Mountain View" and "New York". - - extended\_locality: Extended locality is concatenated - version of admin1 and locality with comma separator. For - example, "Mountain View, CA" and "New York, NY". - - postal\_code: Postal code of profile which follows locale - code. - country: Country code (ISO-3166-1 alpha-2 code) of - profile, such as US, JP, GB. - job\_title: Normalized job - titles specified in EmploymentHistory. - company\_name: - Normalized company name of profiles to match on. - - institution: The school name. For example, "MIT", "University - of California, Berkeley" - degree: Highest education - degree in ISCED code. Each value in degree covers a - specific level of education, without any expansion to upper - nor lower levels of education degree. - - experience\_in\_months: experience in months. 0 means 0 month - to 1 month (exclusive). - application\_date: The - application date specifies application start dates. See - [ApplicationDateFilter][google.cloud.talent.v4beta1.Applicatio - nDateFilter] for more details. - - application\_outcome\_notes: The application outcome reason - specifies the reasons behind the outcome of the job - application. See [ApplicationOutcomeNotesFilter][google.clo - ud.talent.v4beta1.ApplicationOutcomeNotesFilter] for more - details. - application\_job\_title: The application job title - specifies the job applied for in the application. See [A - pplicationJobFilter][google.cloud.talent.v4beta1.ApplicationJo - bFilter] for more details. - hirable\_status: Hirable - status specifies the profile's hirable status. - - string\_custom\_attribute: String custom attributes. Values - can be accessed via square bracket notation like - string\_custom\_attribute["key1"]. - - numeric\_custom\_attribute: Numeric custom attributes. Values - can be accessed via square bracket notation like - numeric\_custom\_attribute["key1"]. Example expressions: - - count(admin1) - count(experience\_in\_months, [bucket(0, 12, - "1 year"), bucket(12, 36, "1-3 years"), bucket(36, MAX, "3+ - years")]) - - count(string\_custom\_attribute["assigned\_recruiter"]) - - count(numeric\_custom\_attribute["favorite\_number"], - [bucket(MIN, 0, "negative"), bucket(0, MAX, "non- - negative")]) - result_set_id: - An id that uniquely identifies the result set of a [SearchProf - iles][google.cloud.talent.v4beta1.ProfileService.SearchProfile - s] call. The id should be retrieved from the [SearchProfilesRe - sponse][google.cloud.talent.v4beta1.SearchProfilesResponse] - message returned from a previous invocation of [SearchProfiles - ][google.cloud.talent.v4beta1.ProfileService.SearchProfiles]. - A result set is an ordered list of search results. If this - field is not set, a new result set is computed based on the [p - rofile\_query][google.cloud.talent.v4beta1.SearchProfilesReque - st.profile\_query]. A new [result\_set\_id][google.cloud.talen - t.v4beta1.SearchProfilesRequest.result\_set\_id] is returned - as a handle to access this result set. If this field is set, - the service will ignore the resource and [profile\_query][goog - le.cloud.talent.v4beta1.SearchProfilesRequest.profile\_query] - values, and simply retrieve a page of results from the - corresponding result set. In this case, one and only one of [p - age\_token][google.cloud.talent.v4beta1.SearchProfilesRequest. - page\_token] or [offset][google.cloud.talent.v4beta1.SearchPro - filesRequest.offset] must be set. A typical use case is to - invoke [SearchProfilesRequest][google.cloud.talent.v4beta1.Sea - rchProfilesRequest] without this field, then use the resulting - [result\_set\_id][google.cloud.talent.v4beta1.SearchProfilesRe - quest.result\_set\_id] in [SearchProfilesResponse][google.clou - d.talent.v4beta1.SearchProfilesResponse] to page through the - results. - strict_keywords_search: - This flag is used to indicate whether the service will attempt - to understand synonyms and terms related to the search query - or treat the query "as is" when it generates a set of results. - By default this flag is set to false, thus allowing expanded - results to also be returned. For example a search for - "software engineer" might also return candidates who have - experience in jobs similar to software engineer positions. By - setting this flag to true, the service will only attempt to - deliver candidates has software engineer in his/her global - fields by treating "software engineer" as a keyword. It is - recommended to provide a feature in the UI (such as a - checkbox) to allow recruiters to set this flag to true if they - intend to search for longer boolean strings. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchProfilesRequest) - ), -) -_sym_db.RegisterMessage(SearchProfilesRequest) - -SearchProfilesResponse = _reflection.GeneratedProtocolMessageType( - "SearchProfilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_SEARCHPROFILESRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Response of SearchProfiles method. - - - Attributes: - estimated_total_size: - An estimation of the number of profiles that match the - specified query. This number isn't guaranteed to be accurate. - spell_correction: - The spell checking result, and correction. - metadata: - Additional information for the API invocation, such as the - request tracking id. - next_page_token: - A token to retrieve the next page of results. This is empty if - there are no more results. - histogram_query_results: - The histogram results that match with specified [SearchProfile - sRequest.histogram\_queries][google.cloud.talent.v4beta1.Searc - hProfilesRequest.histogram\_queries]. - summarized_profiles: - The profile entities that match the specified [SearchProfilesR - equest][google.cloud.talent.v4beta1.SearchProfilesRequest]. - result_set_id: - An id that uniquely identifies the result set of a [SearchProf - iles][google.cloud.talent.v4beta1.ProfileService.SearchProfile - s] call for consistent results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SearchProfilesResponse) - ), -) -_sym_db.RegisterMessage(SearchProfilesResponse) - -SummarizedProfile = _reflection.GeneratedProtocolMessageType( - "SummarizedProfile", - (_message.Message,), - dict( - DESCRIPTOR=_SUMMARIZEDPROFILE, - __module__="google.cloud.talent_v4beta1.proto.profile_service_pb2", - __doc__="""Profile entry with metadata inside - [SearchProfilesResponse][google.cloud.talent.v4beta1.SearchProfilesResponse]. - - - Attributes: - profiles: - A list of profiles that are linked by [Profile.group\_id][goog - le.cloud.talent.v4beta1.Profile.group\_id]. - summary: - A profile summary shows the profile summary and how the - profile matches the search query. In profile summary, the - profiles with the same [Profile.group\_id][google.cloud.talent - .v4beta1.Profile.group\_id] are merged together. Among - profiles, same education/employment records may be slightly - different but they are merged into one with best efforts. For - example, in one profile the school name is "UC Berkeley" and - the field study is "Computer Science" and in another one the - school name is "University of California at Berkeley" and the - field study is "CS". The API merges these two inputs into one - and selects one value for each field. For example, the school - name in summary is set to "University of California at - Berkeley" and the field of study is set to "Computer Science". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.SummarizedProfile) - ), -) -_sym_db.RegisterMessage(SummarizedProfile) - - -DESCRIPTOR._options = None -_LISTPROFILESREQUEST.fields_by_name["parent"]._options = None -_CREATEPROFILEREQUEST.fields_by_name["parent"]._options = None -_CREATEPROFILEREQUEST.fields_by_name["profile"]._options = None -_GETPROFILEREQUEST.fields_by_name["name"]._options = None -_UPDATEPROFILEREQUEST.fields_by_name["profile"]._options = None -_DELETEPROFILEREQUEST.fields_by_name["name"]._options = None -_SEARCHPROFILESREQUEST.fields_by_name["parent"]._options = None -_SEARCHPROFILESREQUEST.fields_by_name["request_metadata"]._options = None - -_PROFILESERVICE = _descriptor.ServiceDescriptor( - name="ProfileService", - full_name="google.cloud.talent.v4beta1.ProfileService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=2241, - serialized_end=3424, - methods=[ - _descriptor.MethodDescriptor( - name="ListProfiles", - full_name="google.cloud.talent.v4beta1.ProfileService.ListProfiles", - index=0, - containing_service=None, - input_type=_LISTPROFILESREQUEST, - output_type=_LISTPROFILESRESPONSE, - serialized_options=_b( - "\202\323\344\223\0021\022//v4beta1/{parent=projects/*/tenants/*}/profiles\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="CreateProfile", - full_name="google.cloud.talent.v4beta1.ProfileService.CreateProfile", - index=1, - containing_service=None, - input_type=_CREATEPROFILEREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE, - serialized_options=_b( - '\202\323\344\223\0024"//v4beta1/{parent=projects/*/tenants/*}/profiles:\001*\332A\016parent,profile' - ), - ), - _descriptor.MethodDescriptor( - name="GetProfile", - full_name="google.cloud.talent.v4beta1.ProfileService.GetProfile", - index=2, - containing_service=None, - input_type=_GETPROFILEREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE, - serialized_options=_b( - "\202\323\344\223\0021\022//v4beta1/{name=projects/*/tenants/*/profiles/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProfile", - full_name="google.cloud.talent.v4beta1.ProfileService.UpdateProfile", - index=3, - containing_service=None, - input_type=_UPDATEPROFILEREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2._PROFILE, - serialized_options=_b( - "\202\323\344\223\002<27/v4beta1/{profile.name=projects/*/tenants/*/profiles/*}:\001*\332A\007profile" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProfile", - full_name="google.cloud.talent.v4beta1.ProfileService.DeleteProfile", - index=4, - containing_service=None, - input_type=_DELETEPROFILEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0021*//v4beta1/{name=projects/*/tenants/*/profiles/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="SearchProfiles", - full_name="google.cloud.talent.v4beta1.ProfileService.SearchProfiles", - index=5, - containing_service=None, - input_type=_SEARCHPROFILESREQUEST, - output_type=_SEARCHPROFILESRESPONSE, - serialized_options=_b( - '\202\323\344\223\0022"-/v4beta1/{parent=projects/*/tenants/*}:search:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_PROFILESERVICE) - -DESCRIPTOR.services_by_name["ProfileService"] = _PROFILESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2_grpc.py deleted file mode 100644 index cf251d0f0e31..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/profile_service_pb2_grpc.py +++ /dev/null @@ -1,147 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - profile_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - profile_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ProfileServiceStub(object): - """A service that handles profile management, including profile CRUD, - enumeration and search. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListProfiles = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/ListProfiles", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.ListProfilesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.ListProfilesResponse.FromString, - ) - self.CreateProfile = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/CreateProfile", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.CreateProfileRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.FromString, - ) - self.GetProfile = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/GetProfile", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.GetProfileRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.FromString, - ) - self.UpdateProfile = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/UpdateProfile", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.UpdateProfileRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.FromString, - ) - self.DeleteProfile = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/DeleteProfile", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.DeleteProfileRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.SearchProfiles = channel.unary_unary( - "/google.cloud.talent.v4beta1.ProfileService/SearchProfiles", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.SearchProfilesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.SearchProfilesResponse.FromString, - ) - - -class ProfileServiceServicer(object): - """A service that handles profile management, including profile CRUD, - enumeration and search. - """ - - def ListProfiles(self, request, context): - """Lists profiles by filter. The order is unspecified. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateProfile(self, request, context): - """Creates and returns a new profile. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProfile(self, request, context): - """Gets the specified profile. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProfile(self, request, context): - """Updates the specified profile and returns the updated result. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProfile(self, request, context): - """Deletes the specified profile. - Prerequisite: The profile has no associated applications or assignments - associated. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def SearchProfiles(self, request, context): - """Searches for profiles within a tenant. - - For example, search by raw queries "software engineer in Mountain View" or - search by structured filters (location filter, education filter, etc.). - - See [SearchProfilesRequest][google.cloud.talent.v4beta1.SearchProfilesRequest] for more information. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ProfileServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListProfiles": grpc.unary_unary_rpc_method_handler( - servicer.ListProfiles, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.ListProfilesRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.ListProfilesResponse.SerializeToString, - ), - "CreateProfile": grpc.unary_unary_rpc_method_handler( - servicer.CreateProfile, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.CreateProfileRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.SerializeToString, - ), - "GetProfile": grpc.unary_unary_rpc_method_handler( - servicer.GetProfile, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.GetProfileRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.SerializeToString, - ), - "UpdateProfile": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProfile, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.UpdateProfileRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__pb2.Profile.SerializeToString, - ), - "DeleteProfile": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProfile, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.DeleteProfileRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "SearchProfiles": grpc.unary_unary_rpc_method_handler( - servicer.SearchProfiles, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.SearchProfilesRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_profile__service__pb2.SearchProfilesResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.ProfileService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant.proto b/talent/google/cloud/talent_v4beta1/proto/tenant.proto deleted file mode 100644 index d0e7d58528c2..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant.proto +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/api/annotations.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "TenantResourceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; -option (google.api.resource_definition) = { - type: "jobs.googleapis.com/TenantOrProject" - pattern: "projects/{project}/tenants/{tenant}" - pattern: "projects/{project}" -}; - -// A Tenant resource represents a tenant in the service. A tenant is a group or -// entity that shares common access with specific privileges for resources like -// profiles. Customer may create multiple tenants to provide data isolation for -// different groups. -message Tenant { - option (google.api.resource) = { - type: "jobs.googleapis.com/Tenant" - pattern: "projects/{project}/tenants/{tenant}" - }; - - // Enum that represents how user data owned by the tenant is used. - enum DataUsageType { - // Default value. - DATA_USAGE_TYPE_UNSPECIFIED = 0; - - // Data owned by this tenant is used to improve search/recommendation - // quality across tenants. - AGGREGATED = 1; - - // Data owned by this tenant is used to improve search/recommendation - // quality for this tenant only. - ISOLATED = 2; - } - - // Required during tenant update. - // - // The resource name for a tenant. This is generated by the service when a - // tenant is created. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenants/bar". - string name = 1; - - // Required. Client side tenant identifier, used to uniquely identify the tenant. - // - // The maximum number of allowed characters is 255. - string external_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Indicates whether data owned by this tenant may be used to provide product - // improvements across other tenants. - // - // Defaults behavior is [DataUsageType.ISOLATED][google.cloud.talent.v4beta1.Tenant.DataUsageType.ISOLATED] if it's unset. - DataUsageType usage_type = 3; - - // A list of keys of filterable [Profile.custom_attributes][google.cloud.talent.v4beta1.Profile.custom_attributes], whose - // corresponding `string_values` are used in keyword searches. Profiles with - // `string_values` under these specified field keys are returned if any - // of the values match the search keyword. Custom field values with - // parenthesis, brackets and special symbols are not searchable as-is, - // and must be surrounded by quotes. - repeated string keyword_searchable_profile_custom_attributes = 4; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant_pb2.py b/talent/google/cloud/talent_v4beta1/proto/tenant_pb2.py deleted file mode 100644 index e59556c1c20e..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant_pb2.py +++ /dev/null @@ -1,217 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/tenant.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/tenant.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\023TenantResourceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS\352A^\n#jobs.googleapis.com/TenantOrProject\022#projects/{project}/tenants/{tenant}\022\022projects/{project}" - ), - serialized_pb=_b( - '\n.google/cloud/talent_v4beta1/proto/tenant.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1cgoogle/api/annotations.proto"\xc3\x02\n\x06Tenant\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x18\n\x0b\x65xternal_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x45\n\nusage_type\x18\x03 \x01(\x0e\x32\x31.google.cloud.talent.v4beta1.Tenant.DataUsageType\x12\x34\n,keyword_searchable_profile_custom_attributes\x18\x04 \x03(\t"N\n\rDataUsageType\x12\x1f\n\x1b\x44\x41TA_USAGE_TYPE_UNSPECIFIED\x10\x00\x12\x0e\n\nAGGREGATED\x10\x01\x12\x0c\n\x08ISOLATED\x10\x02:D\xea\x41\x41\n\x1ajobs.googleapis.com/Tenant\x12#projects/{project}/tenants/{tenant}B\xe2\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x13TenantResourceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TS\xea\x41^\n#jobs.googleapis.com/TenantOrProject\x12#projects/{project}/tenants/{tenant}\x12\x12projects/{project}b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - ], -) - - -_TENANT_DATAUSAGETYPE = _descriptor.EnumDescriptor( - name="DataUsageType", - full_name="google.cloud.talent.v4beta1.Tenant.DataUsageType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="DATA_USAGE_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="AGGREGATED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ISOLATED", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=378, - serialized_end=456, -) -_sym_db.RegisterEnumDescriptor(_TENANT_DATAUSAGETYPE) - - -_TENANT = _descriptor.Descriptor( - name="Tenant", - full_name="google.cloud.talent.v4beta1.Tenant", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.Tenant.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="external_id", - full_name="google.cloud.talent.v4beta1.Tenant.external_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="usage_type", - full_name="google.cloud.talent.v4beta1.Tenant.usage_type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="keyword_searchable_profile_custom_attributes", - full_name="google.cloud.talent.v4beta1.Tenant.keyword_searchable_profile_custom_attributes", - index=3, - number=4, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TENANT_DATAUSAGETYPE], - serialized_options=_b( - "\352AA\n\032jobs.googleapis.com/Tenant\022#projects/{project}/tenants/{tenant}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=203, - serialized_end=526, -) - -_TENANT.fields_by_name["usage_type"].enum_type = _TENANT_DATAUSAGETYPE -_TENANT_DATAUSAGETYPE.containing_type = _TENANT -DESCRIPTOR.message_types_by_name["Tenant"] = _TENANT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Tenant = _reflection.GeneratedProtocolMessageType( - "Tenant", - (_message.Message,), - dict( - DESCRIPTOR=_TENANT, - __module__="google.cloud.talent_v4beta1.proto.tenant_pb2", - __doc__="""A Tenant resource represents a tenant in the service. A - tenant is a group or entity that shares common access with specific - privileges for resources like profiles. Customer may create multiple - tenants to provide data isolation for different groups. - - - Attributes: - name: - Required during tenant update. The resource name for a - tenant. This is generated by the service when a tenant is - created. The format is - "projects/{project\_id}/tenants/{tenant\_id}", for example, - "projects/foo/tenants/bar". - external_id: - Required. Client side tenant identifier, used to uniquely - identify the tenant. The maximum number of allowed characters - is 255. - usage_type: - Indicates whether data owned by this tenant may be used to - provide product improvements across other tenants. Defaults - behavior is [DataUsageType.ISOLATED][google.cloud.talent.v4bet - a1.Tenant.DataUsageType.ISOLATED] if it's unset. - keyword_searchable_profile_custom_attributes: - A list of keys of filterable [Profile.custom\_attributes][goog - le.cloud.talent.v4beta1.Profile.custom\_attributes], whose - corresponding ``string_values`` are used in keyword searches. - Profiles with ``string_values`` under these specified field - keys are returned if any of the values match the search - keyword. Custom field values with parenthesis, brackets and - special symbols are not searchable as-is, and must be - surrounded by quotes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.Tenant) - ), -) -_sym_db.RegisterMessage(Tenant) - - -DESCRIPTOR._options = None -_TENANT.fields_by_name["external_id"]._options = None -_TENANT._options = None -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/tenant_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant_service.proto b/talent/google/cloud/talent_v4beta1/proto/tenant_service.proto deleted file mode 100644 index ab1dd2f539c2..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant_service.proto +++ /dev/null @@ -1,177 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.talent.v4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/talent/v4beta1/common.proto"; -import "google/cloud/talent/v4beta1/tenant.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; - -option go_package = "google.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent"; -option java_multiple_files = true; -option java_outer_classname = "TenantServiceProto"; -option java_package = "com.google.cloud.talent.v4beta1"; -option objc_class_prefix = "CTS"; - -// A service that handles tenant management, including CRUD and enumeration. -service TenantService { - option (google.api.default_host) = "jobs.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/jobs"; - - // Creates a new tenant entity. - rpc CreateTenant(CreateTenantRequest) returns (Tenant) { - option (google.api.http) = { - post: "/v4beta1/{parent=projects/*}/tenants" - body: "*" - }; - option (google.api.method_signature) = "parent,tenant"; - } - - // Retrieves specified tenant. - rpc GetTenant(GetTenantRequest) returns (Tenant) { - option (google.api.http) = { - get: "/v4beta1/{name=projects/*/tenants/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates specified tenant. - rpc UpdateTenant(UpdateTenantRequest) returns (Tenant) { - option (google.api.http) = { - patch: "/v4beta1/{tenant.name=projects/*/tenants/*}" - body: "*" - }; - option (google.api.method_signature) = "tenant"; - } - - // Deletes specified tenant. - rpc DeleteTenant(DeleteTenantRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v4beta1/{name=projects/*/tenants/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists all tenants associated with the project. - rpc ListTenants(ListTenantsRequest) returns (ListTenantsResponse) { - option (google.api.http) = { - get: "/v4beta1/{parent=projects/*}/tenants" - }; - option (google.api.method_signature) = "parent"; - } -} - -// The Request of the CreateTenant method. -message CreateTenantRequest { - // Required. Resource name of the project under which the tenant is created. - // - // The format is "projects/{project_id}", for example, - // "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. The tenant to be created. - Tenant tenant = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Request for getting a tenant by name. -message GetTenantRequest { - // Required. The resource name of the tenant to be retrieved. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenants/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Tenant" - } - ]; -} - -// Request for updating a specified tenant. -message UpdateTenantRequest { - // Required. The tenant resource to replace the current resource in the system. - Tenant tenant = 1 [(google.api.field_behavior) = REQUIRED]; - - // Strongly recommended for the best service experience. - // - // If [update_mask][google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask] is provided, only the specified fields in - // [tenant][google.cloud.talent.v4beta1.UpdateTenantRequest.tenant] are updated. Otherwise all the fields are updated. - // - // A field mask to specify the tenant fields to be updated. Only - // top level fields of [Tenant][google.cloud.talent.v4beta1.Tenant] are supported. - google.protobuf.FieldMask update_mask = 2; -} - -// Request to delete a tenant. -message DeleteTenantRequest { - // Required. The resource name of the tenant to be deleted. - // - // The format is "projects/{project_id}/tenants/{tenant_id}", for example, - // "projects/foo/tenants/bar". - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "jobs.googleapis.com/Tenant" - } - ]; -} - -// List tenants for which the client has ACL visibility. -message ListTenantsRequest { - // Required. Resource name of the project under which the tenant is created. - // - // The format is "projects/{project_id}", for example, - // "projects/foo". - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // The starting indicator from which to return results. - string page_token = 2; - - // The maximum number of tenants to be returned, at most 100. - // Default is 100 if a non-positive number is provided. - int32 page_size = 3; -} - -// The List tenants response object. -message ListTenantsResponse { - // Tenants for the current client. - repeated Tenant tenants = 1; - - // A token to retrieve the next page of results. - string next_page_token = 2; - - // Additional information for the API invocation, such as the request - // tracking id. - ResponseMetadata metadata = 3; -} diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2.py b/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2.py deleted file mode 100644 index e78c087ce351..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2.py +++ /dev/null @@ -1,644 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/talent_v4beta1/proto/tenant_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.talent_v4beta1.proto import ( - common_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - tenant_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/talent_v4beta1/proto/tenant_service.proto", - package="google.cloud.talent.v4beta1", - syntax="proto3", - serialized_options=_b( - "\n\037com.google.cloud.talent.v4beta1B\022TenantServiceProtoP\001ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\242\002\003CTS" - ), - serialized_pb=_b( - '\n6google/cloud/talent_v4beta1/proto/tenant_service.proto\x12\x1bgoogle.cloud.talent.v4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a.google/cloud/talent_v4beta1/proto/common.proto\x1a.google/cloud/talent_v4beta1/proto/tenant.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto"\x94\x01\n\x13\x43reateTenantRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x38\n\x06tenant\x18\x02 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02"D\n\x10GetTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant"\x80\x01\n\x13UpdateTenantRequest\x12\x38\n\x06tenant\x18\x01 \x01(\x0b\x32#.google.cloud.talent.v4beta1.TenantB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"G\n\x13\x44\x65leteTenantRequest\x12\x30\n\x04name\x18\x01 \x01(\tB"\xe0\x41\x02\xfa\x41\x1c\n\x1ajobs.googleapis.com/Tenant"\x80\x01\n\x12ListTenantsRequest\x12\x43\n\x06parent\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x12\n\npage_token\x18\x02 \x01(\t\x12\x11\n\tpage_size\x18\x03 \x01(\x05"\xa5\x01\n\x13ListTenantsResponse\x12\x34\n\x07tenants\x18\x01 \x03(\x0b\x32#.google.cloud.talent.v4beta1.Tenant\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\x12?\n\x08metadata\x18\x03 \x01(\x0b\x32-.google.cloud.talent.v4beta1.ResponseMetadata2\xa0\x07\n\rTenantService\x12\xa6\x01\n\x0c\x43reateTenant\x12\x30.google.cloud.talent.v4beta1.CreateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant"?\x82\xd3\xe4\x93\x02)"$/v4beta1/{parent=projects/*}/tenants:\x01*\xda\x41\rparent,tenant\x12\x94\x01\n\tGetTenant\x12-.google.cloud.talent.v4beta1.GetTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant"3\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa6\x01\n\x0cUpdateTenant\x12\x30.google.cloud.talent.v4beta1.UpdateTenantRequest\x1a#.google.cloud.talent.v4beta1.Tenant"?\x82\xd3\xe4\x93\x02\x30\x32+/v4beta1/{tenant.name=projects/*/tenants/*}:\x01*\xda\x41\x06tenant\x12\x8d\x01\n\x0c\x44\x65leteTenant\x12\x30.google.cloud.talent.v4beta1.DeleteTenantRequest\x1a\x16.google.protobuf.Empty"3\x82\xd3\xe4\x93\x02&*$/v4beta1/{name=projects/*/tenants/*}\xda\x41\x04name\x12\xa7\x01\n\x0bListTenants\x12/.google.cloud.talent.v4beta1.ListTenantsRequest\x1a\x30.google.cloud.talent.v4beta1.ListTenantsResponse"5\x82\xd3\xe4\x93\x02&\x12$/v4beta1/{parent=projects/*}/tenants\xda\x41\x06parent\x1al\xca\x41\x13jobs.googleapis.com\xd2\x41Shttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobsB\x80\x01\n\x1f\x63om.google.cloud.talent.v4beta1B\x12TenantServiceProtoP\x01ZAgoogle.golang.org/genproto/googleapis/cloud/talent/v4beta1;talent\xa2\x02\x03\x43TSb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2.DESCRIPTOR, - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - ], -) - - -_CREATETENANTREQUEST = _descriptor.Descriptor( - name="CreateTenantRequest", - full_name="google.cloud.talent.v4beta1.CreateTenantRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.CreateTenantRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tenant", - full_name="google.cloud.talent.v4beta1.CreateTenantRequest.tenant", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=362, - serialized_end=510, -) - - -_GETTENANTREQUEST = _descriptor.Descriptor( - name="GetTenantRequest", - full_name="google.cloud.talent.v4beta1.GetTenantRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.GetTenantRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\034\n\032jobs.googleapis.com/Tenant"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=512, - serialized_end=580, -) - - -_UPDATETENANTREQUEST = _descriptor.Descriptor( - name="UpdateTenantRequest", - full_name="google.cloud.talent.v4beta1.UpdateTenantRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="tenant", - full_name="google.cloud.talent.v4beta1.UpdateTenantRequest.tenant", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.talent.v4beta1.UpdateTenantRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=583, - serialized_end=711, -) - - -_DELETETENANTREQUEST = _descriptor.Descriptor( - name="DeleteTenantRequest", - full_name="google.cloud.talent.v4beta1.DeleteTenantRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.talent.v4beta1.DeleteTenantRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002\372A\034\n\032jobs.googleapis.com/Tenant"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=713, - serialized_end=784, -) - - -_LISTTENANTSREQUEST = _descriptor.Descriptor( - name="ListTenantsRequest", - full_name="google.cloud.talent.v4beta1.ListTenantsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.talent.v4beta1.ListTenantsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.talent.v4beta1.ListTenantsRequest.page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.talent.v4beta1.ListTenantsRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=787, - serialized_end=915, -) - - -_LISTTENANTSRESPONSE = _descriptor.Descriptor( - name="ListTenantsResponse", - full_name="google.cloud.talent.v4beta1.ListTenantsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="tenants", - full_name="google.cloud.talent.v4beta1.ListTenantsResponse.tenants", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.talent.v4beta1.ListTenantsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="metadata", - full_name="google.cloud.talent.v4beta1.ListTenantsResponse.metadata", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=918, - serialized_end=1083, -) - -_CREATETENANTREQUEST.fields_by_name[ - "tenant" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT -_UPDATETENANTREQUEST.fields_by_name[ - "tenant" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT -_UPDATETENANTREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_LISTTENANTSRESPONSE.fields_by_name[ - "tenants" -].message_type = google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT -_LISTTENANTSRESPONSE.fields_by_name[ - "metadata" -].message_type = ( - google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_common__pb2._RESPONSEMETADATA -) -DESCRIPTOR.message_types_by_name["CreateTenantRequest"] = _CREATETENANTREQUEST -DESCRIPTOR.message_types_by_name["GetTenantRequest"] = _GETTENANTREQUEST -DESCRIPTOR.message_types_by_name["UpdateTenantRequest"] = _UPDATETENANTREQUEST -DESCRIPTOR.message_types_by_name["DeleteTenantRequest"] = _DELETETENANTREQUEST -DESCRIPTOR.message_types_by_name["ListTenantsRequest"] = _LISTTENANTSREQUEST -DESCRIPTOR.message_types_by_name["ListTenantsResponse"] = _LISTTENANTSRESPONSE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -CreateTenantRequest = _reflection.GeneratedProtocolMessageType( - "CreateTenantRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATETENANTREQUEST, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""The Request of the CreateTenant method. - - - Attributes: - parent: - Required. Resource name of the project under which the tenant - is created. The format is "projects/{project\_id}", for - example, "projects/foo". - tenant: - Required. The tenant to be created. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.CreateTenantRequest) - ), -) -_sym_db.RegisterMessage(CreateTenantRequest) - -GetTenantRequest = _reflection.GeneratedProtocolMessageType( - "GetTenantRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETTENANTREQUEST, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""Request for getting a tenant by name. - - - Attributes: - name: - Required. The resource name of the tenant to be retrieved. - The format is "projects/{project\_id}/tenants/{tenant\_id}", - for example, "projects/foo/tenants/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.GetTenantRequest) - ), -) -_sym_db.RegisterMessage(GetTenantRequest) - -UpdateTenantRequest = _reflection.GeneratedProtocolMessageType( - "UpdateTenantRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATETENANTREQUEST, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""Request for updating a specified tenant. - - - Attributes: - tenant: - Required. The tenant resource to replace the current resource - in the system. - update_mask: - Strongly recommended for the best service experience. If [upd - ate\_mask][google.cloud.talent.v4beta1.UpdateTenantRequest.upd - ate\_mask] is provided, only the specified fields in [tenant][ - google.cloud.talent.v4beta1.UpdateTenantRequest.tenant] are - updated. Otherwise all the fields are updated. A field mask - to specify the tenant fields to be updated. Only top level - fields of [Tenant][google.cloud.talent.v4beta1.Tenant] are - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.UpdateTenantRequest) - ), -) -_sym_db.RegisterMessage(UpdateTenantRequest) - -DeleteTenantRequest = _reflection.GeneratedProtocolMessageType( - "DeleteTenantRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETETENANTREQUEST, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""Request to delete a tenant. - - - Attributes: - name: - Required. The resource name of the tenant to be deleted. The - format is "projects/{project\_id}/tenants/{tenant\_id}", for - example, "projects/foo/tenants/bar". - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.DeleteTenantRequest) - ), -) -_sym_db.RegisterMessage(DeleteTenantRequest) - -ListTenantsRequest = _reflection.GeneratedProtocolMessageType( - "ListTenantsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTENANTSREQUEST, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""List tenants for which the client has ACL visibility. - - - Attributes: - parent: - Required. Resource name of the project under which the tenant - is created. The format is "projects/{project\_id}", for - example, "projects/foo". - page_token: - The starting indicator from which to return results. - page_size: - The maximum number of tenants to be returned, at most 100. - Default is 100 if a non-positive number is provided. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListTenantsRequest) - ), -) -_sym_db.RegisterMessage(ListTenantsRequest) - -ListTenantsResponse = _reflection.GeneratedProtocolMessageType( - "ListTenantsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTENANTSRESPONSE, - __module__="google.cloud.talent_v4beta1.proto.tenant_service_pb2", - __doc__="""The List tenants response object. - - - Attributes: - tenants: - Tenants for the current client. - next_page_token: - A token to retrieve the next page of results. - metadata: - Additional information for the API invocation, such as the - request tracking id. - """, - # @@protoc_insertion_point(class_scope:google.cloud.talent.v4beta1.ListTenantsResponse) - ), -) -_sym_db.RegisterMessage(ListTenantsResponse) - - -DESCRIPTOR._options = None -_CREATETENANTREQUEST.fields_by_name["parent"]._options = None -_CREATETENANTREQUEST.fields_by_name["tenant"]._options = None -_GETTENANTREQUEST.fields_by_name["name"]._options = None -_UPDATETENANTREQUEST.fields_by_name["tenant"]._options = None -_DELETETENANTREQUEST.fields_by_name["name"]._options = None -_LISTTENANTSREQUEST.fields_by_name["parent"]._options = None - -_TENANTSERVICE = _descriptor.ServiceDescriptor( - name="TenantService", - full_name="google.cloud.talent.v4beta1.TenantService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\023jobs.googleapis.com\322AShttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/jobs" - ), - serialized_start=1086, - serialized_end=2014, - methods=[ - _descriptor.MethodDescriptor( - name="CreateTenant", - full_name="google.cloud.talent.v4beta1.TenantService.CreateTenant", - index=0, - containing_service=None, - input_type=_CREATETENANTREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT, - serialized_options=_b( - '\202\323\344\223\002)"$/v4beta1/{parent=projects/*}/tenants:\001*\332A\rparent,tenant' - ), - ), - _descriptor.MethodDescriptor( - name="GetTenant", - full_name="google.cloud.talent.v4beta1.TenantService.GetTenant", - index=1, - containing_service=None, - input_type=_GETTENANTREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT, - serialized_options=_b( - "\202\323\344\223\002&\022$/v4beta1/{name=projects/*/tenants/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateTenant", - full_name="google.cloud.talent.v4beta1.TenantService.UpdateTenant", - index=2, - containing_service=None, - input_type=_UPDATETENANTREQUEST, - output_type=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2._TENANT, - serialized_options=_b( - "\202\323\344\223\00202+/v4beta1/{tenant.name=projects/*/tenants/*}:\001*\332A\006tenant" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteTenant", - full_name="google.cloud.talent.v4beta1.TenantService.DeleteTenant", - index=3, - containing_service=None, - input_type=_DELETETENANTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002&*$/v4beta1/{name=projects/*/tenants/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListTenants", - full_name="google.cloud.talent.v4beta1.TenantService.ListTenants", - index=4, - containing_service=None, - input_type=_LISTTENANTSREQUEST, - output_type=_LISTTENANTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002&\022$/v4beta1/{parent=projects/*}/tenants\332A\006parent" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TENANTSERVICE) - -DESCRIPTOR.services_by_name["TenantService"] = _TENANTSERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2_grpc.py b/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2_grpc.py deleted file mode 100644 index 48dd6dbb7a7b..000000000000 --- a/talent/google/cloud/talent_v4beta1/proto/tenant_service_pb2_grpc.py +++ /dev/null @@ -1,121 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.talent_v4beta1.proto import ( - tenant_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2, -) -from google.cloud.talent_v4beta1.proto import ( - tenant_service_pb2 as google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class TenantServiceStub(object): - """A service that handles tenant management, including CRUD and enumeration. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateTenant = channel.unary_unary( - "/google.cloud.talent.v4beta1.TenantService/CreateTenant", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.CreateTenantRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.FromString, - ) - self.GetTenant = channel.unary_unary( - "/google.cloud.talent.v4beta1.TenantService/GetTenant", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.GetTenantRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.FromString, - ) - self.UpdateTenant = channel.unary_unary( - "/google.cloud.talent.v4beta1.TenantService/UpdateTenant", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.UpdateTenantRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.FromString, - ) - self.DeleteTenant = channel.unary_unary( - "/google.cloud.talent.v4beta1.TenantService/DeleteTenant", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.DeleteTenantRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListTenants = channel.unary_unary( - "/google.cloud.talent.v4beta1.TenantService/ListTenants", - request_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.ListTenantsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.ListTenantsResponse.FromString, - ) - - -class TenantServiceServicer(object): - """A service that handles tenant management, including CRUD and enumeration. - """ - - def CreateTenant(self, request, context): - """Creates a new tenant entity. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetTenant(self, request, context): - """Retrieves specified tenant. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateTenant(self, request, context): - """Updates specified tenant. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteTenant(self, request, context): - """Deletes specified tenant. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListTenants(self, request, context): - """Lists all tenants associated with the project. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TenantServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateTenant": grpc.unary_unary_rpc_method_handler( - servicer.CreateTenant, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.CreateTenantRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.SerializeToString, - ), - "GetTenant": grpc.unary_unary_rpc_method_handler( - servicer.GetTenant, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.GetTenantRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.SerializeToString, - ), - "UpdateTenant": grpc.unary_unary_rpc_method_handler( - servicer.UpdateTenant, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.UpdateTenantRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__pb2.Tenant.SerializeToString, - ), - "DeleteTenant": grpc.unary_unary_rpc_method_handler( - servicer.DeleteTenant, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.DeleteTenantRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListTenants": grpc.unary_unary_rpc_method_handler( - servicer.ListTenants, - request_deserializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.ListTenantsRequest.FromString, - response_serializer=google_dot_cloud_dot_talent__v4beta1_dot_proto_dot_tenant__service__pb2.ListTenantsResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.talent.v4beta1.TenantService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/talent/google/cloud/talent_v4beta1/types.py b/talent/google/cloud/talent_v4beta1/types.py deleted file mode 100644 index 359bce8ad1af..000000000000 --- a/talent/google/cloud/talent_v4beta1/types.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.cloud.talent_v4beta1.proto import completion_service_pb2 -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 -from google.cloud.talent_v4beta1.proto import filters_pb2 -from google.cloud.talent_v4beta1.proto import histogram_pb2 -from google.cloud.talent_v4beta1.proto import job_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2 -from google.cloud.talent_v4beta1.proto import profile_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2 -from google.cloud.talent_v4beta1.proto import tenant_pb2 -from google.cloud.talent_v4beta1.proto import tenant_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import date_pb2 -from google.type import latlng_pb2 -from google.type import money_pb2 -from google.type import postal_address_pb2 -from google.type import timeofday_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - duration_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - date_pb2, - latlng_pb2, - money_pb2, - postal_address_pb2, - timeofday_pb2, -] - -_local_modules = [ - application_pb2, - application_service_pb2, - common_pb2, - company_pb2, - company_service_pb2, - completion_service_pb2, - event_pb2, - event_service_pb2, - filters_pb2, - histogram_pb2, - job_pb2, - job_service_pb2, - profile_pb2, - profile_service_pb2, - tenant_pb2, - tenant_service_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.talent_v4beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/talent/noxfile.py b/talent/noxfile.py deleted file mode 100644 index 7949a4e3925a..000000000000 --- a/talent/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/talent/setup.cfg b/talent/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/talent/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/talent/setup.py b/talent/setup.py deleted file mode 100644 index 1889a4a69be7..000000000000 --- a/talent/setup.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2019 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 -# -# http://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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-talent" -description = "Google Cloud Talent Solution API client library" -version = "0.4.0" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 3 - Alpha" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/talent/synth.metadata b/talent/synth.metadata deleted file mode 100644 index bcefe501555d..000000000000 --- a/talent/synth.metadata +++ /dev/null @@ -1,366 +0,0 @@ -{ - "updateTime": "2020-01-29T13:28:19.462808Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "cf3b61102ed5f36b827bc82ec39be09525f018c8", - "internalRef": "292034635", - "log": "cf3b61102ed5f36b827bc82ec39be09525f018c8\n Fix to protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 292034635\n\n4e1cfaa7c0fede9e65d64213ca3da1b1255816c0\nUpdate the public proto to support UTF-8 encoded id for CatalogService API, increase the ListCatalogItems deadline to 300s and some minor documentation change\n\nPiperOrigin-RevId: 292030970\n\n9c483584f8fd5a1b862ae07973f4cc7bb3e46648\nasset: add annotations to v1p1beta1\n\nPiperOrigin-RevId: 292009868\n\ne19209fac29731d0baf6d9ac23da1164f7bdca24\nAdd the google.rpc.context.AttributeContext message to the open source\ndirectories.\n\nPiperOrigin-RevId: 291999930\n\nae5662960573f279502bf98a108a35ba1175e782\noslogin API: move file level option on top of the file to avoid protobuf.js bug.\n\nPiperOrigin-RevId: 291990506\n\neba3897fff7c49ed85d3c47fc96fe96e47f6f684\nAdd cc_proto_library and cc_grpc_library targets for Spanner and IAM protos.\n\nPiperOrigin-RevId: 291988651\n\n8e981acfd9b97ea2f312f11bbaa7b6c16e412dea\nBeta launch for PersonDetection and FaceDetection features.\n\nPiperOrigin-RevId: 291821782\n\n994e067fae3b21e195f7da932b08fff806d70b5d\nasset: add annotations to v1p2beta1\n\nPiperOrigin-RevId: 291815259\n\n244e1d2c89346ca2e0701b39e65552330d68545a\nAdd Playable Locations service\n\nPiperOrigin-RevId: 291806349\n\n909f8f67963daf45dd88d020877fb9029b76788d\nasset: add annotations to v1beta2\n\nPiperOrigin-RevId: 291805301\n\n3c39a1d6e23c1ef63c7fba4019c25e76c40dfe19\nKMS: add file-level message for CryptoKeyPath, it is defined in gapic yaml but not\nin proto files.\n\nPiperOrigin-RevId: 291420695\n\nc6f3f350b8387f8d1b85ed4506f30187ebaaddc3\ncontaineranalysis: update v1beta1 and bazel build with annotations\n\nPiperOrigin-RevId: 291401900\n\n92887d74b44e4e636252b7b8477d0d2570cd82db\nfix: fix the location of grpc config file.\n\nPiperOrigin-RevId: 291396015\n\ne26cab8afd19d396b929039dac5d874cf0b5336c\nexpr: add default_host and method_signature annotations to CelService\n\nPiperOrigin-RevId: 291240093\n\n06093ae3952441c34ec176d1f7431b8765cec0be\nirm: fix v1alpha2 bazel build by adding missing proto imports\n\nPiperOrigin-RevId: 291227940\n\na8a2514af326e4673063f9a3c9d0ef1091c87e6c\nAdd proto annotation for cloud/irm API\n\nPiperOrigin-RevId: 291217859\n\n8d16f76de065f530d395a4c7eabbf766d6a120fd\nGenerate Memcache v1beta2 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 291008516\n\n3af1dabd93df9a9f17bf3624d3b875c11235360b\ngrafeas: Add containeranalysis default_host to Grafeas service\n\nPiperOrigin-RevId: 290965849\n\nbe2663fa95e31cba67d0cd62611a6674db9f74b7\nfix(google/maps/roads): add missing opening bracket\n\nPiperOrigin-RevId: 290964086\n\nfacc26550a0af0696e0534bc9cae9df14275aa7c\nUpdating v2 protos with the latest inline documentation (in comments) and adding a per-service .yaml file.\n\nPiperOrigin-RevId: 290952261\n\ncda99c1f7dc5e4ca9b1caeae1dc330838cbc1461\nChange api_name to 'asset' for v1p1beta1\n\nPiperOrigin-RevId: 290800639\n\n94e9e90c303a820ce40643d9129e7f0d2054e8a1\nAdds Google Maps Road service\n\nPiperOrigin-RevId: 290795667\n\na3b23dcb2eaecce98c600c7d009451bdec52dbda\nrpc: new message ErrorInfo, other comment updates\n\nPiperOrigin-RevId: 290781668\n\n26420ef4e46c37f193c0fbe53d6ebac481de460e\nAdd proto definition for Org Policy v1.\n\nPiperOrigin-RevId: 290771923\n\n7f0dab8177cf371ae019a082e2512de7ac102888\nPublish Routes Preferred API v1 service definitions.\n\nPiperOrigin-RevId: 290326986\n\nad6e508d0728e1d1bca6e3f328cd562718cb772d\nFix: Qualify resource type references with \"jobs.googleapis.com/\"\n\nPiperOrigin-RevId: 290285762\n\n58e770d568a2b78168ddc19a874178fee8265a9d\ncts client library\n\nPiperOrigin-RevId: 290146169\n\naf9daa4c3b4c4a8b7133b81588dd9ffd37270af2\nAdd more programming language options to public proto\n\nPiperOrigin-RevId: 290144091\n\nd9f2bbf2df301ef84641d4cec7c828736a0bd907\ntalent: add missing resource.proto dep to Bazel build target\n\nPiperOrigin-RevId: 290143164\n\n3b3968237451d027b42471cd28884a5a1faed6c7\nAnnotate Talent API.\nAdd gRPC service config for retry.\nUpdate bazel file with google.api.resource dependency.\n\nPiperOrigin-RevId: 290125172\n\n0735b4b096872960568d1f366bfa75b7b0e1f1a3\nWeekly library update.\n\nPiperOrigin-RevId: 289939042\n\n8760d3d9a4543d7f9c0d1c7870aca08b116e4095\nWeekly library update.\n\nPiperOrigin-RevId: 289939020\n\n8607df842f782a901805187e02fff598145b0b0e\nChange Talent API timeout to 30s.\n\nPiperOrigin-RevId: 289912621\n\n908155991fe32570653bcb72ecfdcfc896642f41\nAdd Recommendations AI V1Beta1\n\nPiperOrigin-RevId: 289901914\n\n5c9a8c2bebd8b71aa66d1cc473edfaac837a2c78\nAdding no-arg method signatures for ListBillingAccounts and ListServices\n\nPiperOrigin-RevId: 289891136\n\n50b0e8286ac988b0593bd890eb31fef6ea2f5767\nlongrunning: add grpc service config and default_host annotation to operations.proto\n\nPiperOrigin-RevId: 289876944\n\n6cac27dabe51c54807b0401698c32d34998948a9\n Updating default deadline for Cloud Security Command Center's v1 APIs.\n\nPiperOrigin-RevId: 289875412\n\nd99df0d67057a233c711187e0689baa4f8e6333d\nFix: Correct spelling in C# namespace option\n\nPiperOrigin-RevId: 289709813\n\n2fa8d48165cc48e35b0c62e6f7bdade12229326c\nfeat: Publish Recommender v1 to GitHub.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289619243\n\n9118db63d1ab493a2e44a3b4973fde810a835c49\nfirestore: don't retry reads that fail with Aborted\n\nFor transaction reads that fail with ABORTED, we need to rollback and start a new transaction. Our current configuration makes it so that GAPIC retries ABORTED reads multiple times without making any progress. Instead, we should retry at the transaction level.\n\nPiperOrigin-RevId: 289532382\n\n1dbfd3fe4330790b1e99c0bb20beb692f1e20b8a\nFix bazel build\nAdd other langauges (Java was already there) for bigquery/storage/v1alpha2 api.\n\nPiperOrigin-RevId: 289519766\n\nc06599cdd7d11f8d3fd25f8d3249e5bb1a3d5d73\nInitial commit of google.cloud.policytroubleshooter API, The API helps in troubleshooting GCP policies. Refer https://cloud.google.com/iam/docs/troubleshooting-access for more information\n\nPiperOrigin-RevId: 289491444\n\nfce7d80fa16ea241e87f7bc33d68595422e94ecd\nDo not pass samples option for Artman config of recommender v1 API.\n\nPiperOrigin-RevId: 289477403\n\nef179e8c61436297e6bb124352e47e45c8c80cb1\nfix: Address missing Bazel dependency.\n\nBazel builds stopped working in 06ec6d5 because\nthe google/longrunning/operations.proto file took\nan import from google/api/client.proto, but that\nimport was not added to BUILD.bazel.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446074\n\n8841655b242c84fd691d77d7bcf21b61044f01ff\nMigrate Data Labeling v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289446026\n\n06ec6d5d053fff299eaa6eaa38afdd36c5e2fc68\nAdd annotations to google.longrunning.v1\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289413169\n\n0480cf40be1d3cc231f4268a2fdb36a8dd60e641\nMigrate IAM Admin v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289411084\n\n1017173e9adeb858587639af61889ad970c728b1\nSpecify a C# namespace for BigQuery Connection v1beta1\n\nPiperOrigin-RevId: 289396763\n\nb08714b378e8e5b0c4ecdde73f92c36d6303b4b6\nfix: Integrate latest proto-docs-plugin fix.\nFixes dialogflow v2\n\nPiperOrigin-RevId: 289189004\n\n51217a67e79255ee1f2e70a6a3919df082513327\nCreate BUILD file for recommender v1\n\nPiperOrigin-RevId: 289183234\n\nacacd87263c0a60e458561b8b8ce9f67c760552a\nGenerate recommender v1 API protos and gRPC ServiceConfig files\n\nPiperOrigin-RevId: 289177510\n\n9d2f7133b97720b1fa3601f6dcd30760ba6d8a1e\nFix kokoro build script\n\nPiperOrigin-RevId: 289166315\n\nc43a67530d2a47a0220cad20ca8de39b3fbaf2c5\ncloudtasks: replace missing RPC timeout config for v2beta2 and v2beta3\n\nPiperOrigin-RevId: 289162391\n\n4cefc229a9197236fc0adf02d69b71c0c5cf59de\nSynchronize new proto/yaml changes.\n\nPiperOrigin-RevId: 289158456\n\n56f263fe959c50786dab42e3c61402d32d1417bd\nCatalog API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 289149879\n\n4543762b23a57fc3c53d409efc3a9affd47b6ab3\nFix Bazel build\nbilling/v1 and dialogflow/v2 remain broken (not bazel-related issues).\nBilling has wrong configuration, dialogflow failure is caused by a bug in documentation plugin.\n\nPiperOrigin-RevId: 289140194\n\nc9dce519127b97e866ca133a01157f4ce27dcceb\nUpdate Bigtable docs\n\nPiperOrigin-RevId: 289114419\n\n802c5c5f2bf94c3facb011267d04e71942e0d09f\nMigrate DLP to proto annotations (but not GAPIC v2).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 289102579\n\n6357f30f2ec3cff1d8239d18b707ff9d438ea5da\nRemove gRPC configuration file that was in the wrong place.\n\nPiperOrigin-RevId: 289096111\n\n360a8792ed62f944109d7e22d613a04a010665b4\n Protos for v1p1beta1 release of Cloud Security Command Center\n\nPiperOrigin-RevId: 289011995\n\na79211c20c4f2807eec524d00123bf7c06ad3d6e\nRoll back containeranalysis v1 to GAPIC v1.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288999068\n\n9e60345ba603e03484a8aaa33ce5ffa19c1c652b\nPublish Routes Preferred API v1 proto definitions.\n\nPiperOrigin-RevId: 288941399\n\nd52885b642ad2aa1f42b132ee62dbf49a73e1e24\nMigrate the service management API to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288909426\n\n6ace586805c08896fef43e28a261337fcf3f022b\ncloudtasks: replace missing RPC timeout config\n\nPiperOrigin-RevId: 288783603\n\n51d906cabee4876b12497054b15b05d4a50ad027\nImport of Grafeas from Github.\n\nUpdate BUILD.bazel accordingly.\n\nPiperOrigin-RevId: 288783426\n\n5ef42bcd363ba0440f0ee65b3c80b499e9067ede\nMigrate Recommender v1beta1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288713066\n\n94f986afd365b7d7e132315ddcd43d7af0e652fb\nMigrate Container Analysis v1 to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288708382\n\n7a751a279184970d3b6ba90e4dd4d22a382a0747\nRemove Container Analysis v1alpha1 (nobody publishes it).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288707473\n\n3c0d9c71242e70474b2b640e15bb0a435fd06ff0\nRemove specious annotation from BigQuery Data Transfer before\nanyone accidentally does anything that uses it.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288701604\n\n1af307a4764bd415ef942ac5187fa1def043006f\nMigrate BigQuery Connection to GAPIC v2.\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 288698681\n\n08b488e0660c59842a7dee0e3e2b65d9e3a514a9\nExposing cloud_catalog.proto (This API is already available through REST)\n\nPiperOrigin-RevId: 288625007\n\na613482977e11ac09fa47687a5d1b5a01efcf794\nUpdate the OS Login v1beta API description to render better in the UI.\n\nPiperOrigin-RevId: 288547940\n\n5e182b8d9943f1b17008d69d4c7e865dc83641a7\nUpdate the OS Login API description to render better in the UI.\n\nPiperOrigin-RevId: 288546443\n\ncb79155f596e0396dd900da93872be7066f6340d\nFix: Add a resource annotation for Agent\nFix: Correct the service name in annotations for Intent and SessionEntityType\n\nPiperOrigin-RevId: 288441307\n\nf7f6e9daec3315fd47cb638789bd8415bf4a27cc\nAdded cloud asset api v1p1beta1\n\nPiperOrigin-RevId: 288427239\n\nf2880f5b342c6345f3dcaad24fcb3c6ca9483654\nBilling account API: Adding config necessary to build client libraries\n\nPiperOrigin-RevId: 288351810\n\ndc250ffe071729f8f8bef9d6fd0fbbeb0254c666\nFix: Remove incorrect resource annotations in requests\n\nPiperOrigin-RevId: 288321208\n\n91ef2d9dd69807b0b79555f22566fb2d81e49ff9\nAdd GAPIC annotations to Cloud KMS (but do not migrate the GAPIC config yet).\n\nCommitter: @lukesneeringer\nPiperOrigin-RevId: 287999179\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "talent", - "apiVersion": "v4beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/talent/artman_talent_v4beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v4beta1/api.rst" - }, - { - "path": "docs/gapic/v4beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/talent.py" - }, - { - "path": "google/cloud/talent_v4beta1/__init__.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/application_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/application_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/company_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/company_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/completion_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/completion_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/enums.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/event_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/event_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/job_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/job_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/profile_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/profile_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/tenant_service_client.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/tenant_service_client_config.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/application_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/company_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/completion_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/event_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/job_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/profile_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/gapic/transports/tenant_service_grpc_transport.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/__init__.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/application_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/batch.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/batch_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/batch_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/common.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/common_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/common_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/company_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/completion_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/completion_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/completion_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/event_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/filters.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/filters_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/filters_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/histogram.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/histogram_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/histogram_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/job_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/profile_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant_service.proto" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant_service_pb2.py" - }, - { - "path": "google/cloud/talent_v4beta1/proto/tenant_service_pb2_grpc.py" - }, - { - "path": "google/cloud/talent_v4beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_application_service_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_company_service_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_completion_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_event_service_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_job_service_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_profile_service_client_v4beta1.py" - }, - { - "path": "tests/unit/gapic/v4beta1/test_tenant_service_client_v4beta1.py" - } - ] -} \ No newline at end of file diff --git a/talent/synth.py b/talent/synth.py deleted file mode 100644 index 538917af1efb..000000000000 --- a/talent/synth.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import re - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v4beta1"] - -excludes = ["setup.py", "nox*.py", "README.rst", "docs/conf.py", "docs/index.rst"] -# ---------------------------------------------------------------------------- -# Generate speech GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("talent", version, include_protos=True,) - s.move(library, excludes=excludes) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/talent/tests/unit/gapic/v4beta1/test_application_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_application_service_client_v4beta1.py deleted file mode 100644 index f4b617e04b15..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_application_service_client_v4beta1.py +++ /dev/null @@ -1,314 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import application_pb2 -from google.cloud.talent_v4beta1.proto import application_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestApplicationServiceClient(object): - def test_create_application(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - profile = "profile-309425751" - job = "job105405" - company = "company950484093" - outcome_notes = "outcomeNotes-355961964" - job_title_snippet = "jobTitleSnippet-1100512972" - expected_response = { - "name": name, - "external_id": external_id, - "profile": profile, - "job": job, - "company": company, - "outcome_notes": outcome_notes, - "job_title_snippet": job_title_snippet, - } - expected_response = application_pb2.Application(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup Request - parent = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - application = {} - - response = client.create_application(parent, application) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = application_service_pb2.CreateApplicationRequest( - parent=parent, application=application - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_application_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup request - parent = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - application = {} - - with pytest.raises(CustomException): - client.create_application(parent, application) - - def test_get_application(self): - # Setup Expected Response - name_2 = "name2-1052831874" - external_id = "externalId-1153075697" - profile = "profile-309425751" - job = "job105405" - company = "company950484093" - outcome_notes = "outcomeNotes-355961964" - job_title_snippet = "jobTitleSnippet-1100512972" - expected_response = { - "name": name_2, - "external_id": external_id, - "profile": profile, - "job": job, - "company": company, - "outcome_notes": outcome_notes, - "job_title_snippet": job_title_snippet, - } - expected_response = application_pb2.Application(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup Request - name = client.application_path( - "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]" - ) - - response = client.get_application(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = application_service_pb2.GetApplicationRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_application_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup request - name = client.application_path( - "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]" - ) - - with pytest.raises(CustomException): - client.get_application(name) - - def test_update_application(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - profile = "profile-309425751" - job = "job105405" - company = "company950484093" - outcome_notes = "outcomeNotes-355961964" - job_title_snippet = "jobTitleSnippet-1100512972" - expected_response = { - "name": name, - "external_id": external_id, - "profile": profile, - "job": job, - "company": company, - "outcome_notes": outcome_notes, - "job_title_snippet": job_title_snippet, - } - expected_response = application_pb2.Application(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup Request - application = {} - - response = client.update_application(application) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = application_service_pb2.UpdateApplicationRequest( - application=application - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_application_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup request - application = {} - - with pytest.raises(CustomException): - client.update_application(application) - - def test_delete_application(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup Request - name = client.application_path( - "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]" - ) - - client.delete_application(name) - - assert len(channel.requests) == 1 - expected_request = application_service_pb2.DeleteApplicationRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_application_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup request - name = client.application_path( - "[PROJECT]", "[TENANT]", "[PROFILE]", "[APPLICATION]" - ) - - with pytest.raises(CustomException): - client.delete_application(name) - - def test_list_applications(self): - # Setup Expected Response - next_page_token = "" - applications_element = {} - applications = [applications_element] - expected_response = { - "next_page_token": next_page_token, - "applications": applications, - } - expected_response = application_service_pb2.ListApplicationsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup Request - parent = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - paged_list_response = client.list_applications(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.applications[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = application_service_pb2.ListApplicationsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_applications_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ApplicationServiceClient() - - # Setup request - parent = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - paged_list_response = client.list_applications(parent) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/talent/tests/unit/gapic/v4beta1/test_company_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_company_service_client_v4beta1.py deleted file mode 100644 index 0d2259a2d336..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_company_service_client_v4beta1.py +++ /dev/null @@ -1,317 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import company_pb2 -from google.cloud.talent_v4beta1.proto import company_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestCompanyServiceClient(object): - def test_create_company(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - external_id = "externalId-1153075697" - headquarters_address = "headquartersAddress-1879520036" - hiring_agency = False - eeo_text = "eeoText-1652097123" - website_uri = "websiteUri-2118185016" - career_site_uri = "careerSiteUri1223331861" - image_uri = "imageUri-877823864" - suspended = False - expected_response = { - "name": name, - "display_name": display_name, - "external_id": external_id, - "headquarters_address": headquarters_address, - "hiring_agency": hiring_agency, - "eeo_text": eeo_text, - "website_uri": website_uri, - "career_site_uri": career_site_uri, - "image_uri": image_uri, - "suspended": suspended, - } - expected_response = company_pb2.Company(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - company = {} - - response = client.create_company(parent, company) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = company_service_pb2.CreateCompanyRequest( - parent=parent, company=company - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_company_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - company = {} - - with pytest.raises(CustomException): - client.create_company(parent, company) - - def test_get_company(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - external_id = "externalId-1153075697" - headquarters_address = "headquartersAddress-1879520036" - hiring_agency = False - eeo_text = "eeoText-1652097123" - website_uri = "websiteUri-2118185016" - career_site_uri = "careerSiteUri1223331861" - image_uri = "imageUri-877823864" - suspended = False - expected_response = { - "name": name_2, - "display_name": display_name, - "external_id": external_id, - "headquarters_address": headquarters_address, - "hiring_agency": hiring_agency, - "eeo_text": eeo_text, - "website_uri": website_uri, - "career_site_uri": career_site_uri, - "image_uri": image_uri, - "suspended": suspended, - } - expected_response = company_pb2.Company(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup Request - name = client.company_path("[PROJECT]", "[TENANT]", "[COMPANY]") - - response = client.get_company(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = company_service_pb2.GetCompanyRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_company_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup request - name = client.company_path("[PROJECT]", "[TENANT]", "[COMPANY]") - - with pytest.raises(CustomException): - client.get_company(name) - - def test_update_company(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - external_id = "externalId-1153075697" - headquarters_address = "headquartersAddress-1879520036" - hiring_agency = False - eeo_text = "eeoText-1652097123" - website_uri = "websiteUri-2118185016" - career_site_uri = "careerSiteUri1223331861" - image_uri = "imageUri-877823864" - suspended = False - expected_response = { - "name": name, - "display_name": display_name, - "external_id": external_id, - "headquarters_address": headquarters_address, - "hiring_agency": hiring_agency, - "eeo_text": eeo_text, - "website_uri": website_uri, - "career_site_uri": career_site_uri, - "image_uri": image_uri, - "suspended": suspended, - } - expected_response = company_pb2.Company(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup Request - company = {} - - response = client.update_company(company) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = company_service_pb2.UpdateCompanyRequest(company=company) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_company_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup request - company = {} - - with pytest.raises(CustomException): - client.update_company(company) - - def test_delete_company(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup Request - name = client.company_path("[PROJECT]", "[TENANT]", "[COMPANY]") - - client.delete_company(name) - - assert len(channel.requests) == 1 - expected_request = company_service_pb2.DeleteCompanyRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_company_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup request - name = client.company_path("[PROJECT]", "[TENANT]", "[COMPANY]") - - with pytest.raises(CustomException): - client.delete_company(name) - - def test_list_companies(self): - # Setup Expected Response - next_page_token = "" - companies_element = {} - companies = [companies_element] - expected_response = {"next_page_token": next_page_token, "companies": companies} - expected_response = company_service_pb2.ListCompaniesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - - paged_list_response = client.list_companies(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.companies[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = company_service_pb2.ListCompaniesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_companies_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompanyServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - - paged_list_response = client.list_companies(parent) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/talent/tests/unit/gapic/v4beta1/test_completion_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_completion_client_v4beta1.py deleted file mode 100644 index 0e66aff09889..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_completion_client_v4beta1.py +++ /dev/null @@ -1,106 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import completion_service_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestCompletionClient(object): - def test_complete_query(self): - # Setup Expected Response - expected_response = {} - expected_response = completion_service_pb2.CompleteQueryResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompletionClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - query = "query107944136" - page_size = 883849137 - - response = client.complete_query(parent, query, page_size) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = completion_service_pb2.CompleteQueryRequest( - parent=parent, query=query, page_size=page_size - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_complete_query_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.CompletionClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - query = "query107944136" - page_size = 883849137 - - with pytest.raises(CustomException): - client.complete_query(parent, query, page_size) diff --git a/talent/tests/unit/gapic/v4beta1/test_event_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_event_service_client_v4beta1.py deleted file mode 100644 index ca2b4336582b..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_event_service_client_v4beta1.py +++ /dev/null @@ -1,110 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import event_pb2 -from google.cloud.talent_v4beta1.proto import event_service_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestEventServiceClient(object): - def test_create_client_event(self): - # Setup Expected Response - request_id = "requestId37109963" - event_id = "eventId278118624" - event_notes = "eventNotes445073628" - expected_response = { - "request_id": request_id, - "event_id": event_id, - "event_notes": event_notes, - } - expected_response = event_pb2.ClientEvent(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.EventServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - client_event = {} - - response = client.create_client_event(parent, client_event) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = event_service_pb2.CreateClientEventRequest( - parent=parent, client_event=client_event - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_client_event_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.EventServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - client_event = {} - - with pytest.raises(CustomException): - client.create_client_event(parent, client_event) diff --git a/talent/tests/unit/gapic/v4beta1/test_job_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_job_service_client_v4beta1.py deleted file mode 100644 index 98272c5d2959..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_job_service_client_v4beta1.py +++ /dev/null @@ -1,588 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import job_pb2 -from google.cloud.talent_v4beta1.proto import job_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestJobServiceClient(object): - def test_create_job(self): - # Setup Expected Response - name = "name3373707" - company = "company950484093" - requisition_id = "requisitionId980224926" - title = "title110371416" - description = "description-1724546052" - department = "department848184146" - incentives = "incentives-1262874520" - language_code = "languageCode-412800396" - promotion_value = 353413845 - qualifications = "qualifications1903501412" - responsibilities = "responsibilities-926952660" - company_display_name = "companyDisplayName1982424170" - expected_response = { - "name": name, - "company": company, - "requisition_id": requisition_id, - "title": title, - "description": description, - "department": department, - "incentives": incentives, - "language_code": language_code, - "promotion_value": promotion_value, - "qualifications": qualifications, - "responsibilities": responsibilities, - "company_display_name": company_display_name, - } - expected_response = job_pb2.Job(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - job = {} - - response = client.create_job(parent, job) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.CreateJobRequest(parent=parent, job=job) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - job = {} - - with pytest.raises(CustomException): - client.create_job(parent, job) - - def test_get_job(self): - # Setup Expected Response - name_2 = "name2-1052831874" - company = "company950484093" - requisition_id = "requisitionId980224926" - title = "title110371416" - description = "description-1724546052" - department = "department848184146" - incentives = "incentives-1262874520" - language_code = "languageCode-412800396" - promotion_value = 353413845 - qualifications = "qualifications1903501412" - responsibilities = "responsibilities-926952660" - company_display_name = "companyDisplayName1982424170" - expected_response = { - "name": name_2, - "company": company, - "requisition_id": requisition_id, - "title": title, - "description": description, - "department": department, - "incentives": incentives, - "language_code": language_code, - "promotion_value": promotion_value, - "qualifications": qualifications, - "responsibilities": responsibilities, - "company_display_name": company_display_name, - } - expected_response = job_pb2.Job(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - name = client.job_path("[PROJECT]", "[TENANT]", "[JOBS]") - - response = client.get_job(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.GetJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - name = client.job_path("[PROJECT]", "[TENANT]", "[JOBS]") - - with pytest.raises(CustomException): - client.get_job(name) - - def test_update_job(self): - # Setup Expected Response - name = "name3373707" - company = "company950484093" - requisition_id = "requisitionId980224926" - title = "title110371416" - description = "description-1724546052" - department = "department848184146" - incentives = "incentives-1262874520" - language_code = "languageCode-412800396" - promotion_value = 353413845 - qualifications = "qualifications1903501412" - responsibilities = "responsibilities-926952660" - company_display_name = "companyDisplayName1982424170" - expected_response = { - "name": name, - "company": company, - "requisition_id": requisition_id, - "title": title, - "description": description, - "department": department, - "incentives": incentives, - "language_code": language_code, - "promotion_value": promotion_value, - "qualifications": qualifications, - "responsibilities": responsibilities, - "company_display_name": company_display_name, - } - expected_response = job_pb2.Job(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - job = {} - - response = client.update_job(job) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.UpdateJobRequest(job=job) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - job = {} - - with pytest.raises(CustomException): - client.update_job(job) - - def test_delete_job(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - name = client.job_path("[PROJECT]", "[TENANT]", "[JOBS]") - - client.delete_job(name) - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.DeleteJobRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_job_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - name = client.job_path("[PROJECT]", "[TENANT]", "[JOBS]") - - with pytest.raises(CustomException): - client.delete_job(name) - - def test_list_jobs(self): - # Setup Expected Response - next_page_token = "" - jobs_element = {} - jobs = [jobs_element] - expected_response = {"next_page_token": next_page_token, "jobs": jobs} - expected_response = job_service_pb2.ListJobsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_jobs(parent, filter_) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.jobs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.ListJobsRequest( - parent=parent, filter=filter_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_jobs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - filter_ = "filter-1274492040" - - paged_list_response = client.list_jobs(parent, filter_) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_batch_delete_jobs(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - filter_ = "filter-1274492040" - - client.batch_delete_jobs(parent, filter_) - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.BatchDeleteJobsRequest( - parent=parent, filter=filter_ - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_delete_jobs_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - filter_ = "filter-1274492040" - - with pytest.raises(CustomException): - client.batch_delete_jobs(parent, filter_) - - def test_search_jobs(self): - # Setup Expected Response - next_page_token = "" - estimated_total_size = 1882144769 - total_size = 705419236 - broadened_query_jobs_count = 1432104658 - matching_jobs_element = {} - matching_jobs = [matching_jobs_element] - expected_response = { - "next_page_token": next_page_token, - "estimated_total_size": estimated_total_size, - "total_size": total_size, - "broadened_query_jobs_count": broadened_query_jobs_count, - "matching_jobs": matching_jobs, - } - expected_response = job_service_pb2.SearchJobsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_jobs(parent, request_metadata) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.matching_jobs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.SearchJobsRequest( - parent=parent, request_metadata=request_metadata - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_jobs_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_jobs(parent, request_metadata) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_search_jobs_for_alert(self): - # Setup Expected Response - next_page_token = "" - estimated_total_size = 1882144769 - total_size = 705419236 - broadened_query_jobs_count = 1432104658 - matching_jobs_element = {} - matching_jobs = [matching_jobs_element] - expected_response = { - "next_page_token": next_page_token, - "estimated_total_size": estimated_total_size, - "total_size": total_size, - "broadened_query_jobs_count": broadened_query_jobs_count, - "matching_jobs": matching_jobs, - } - expected_response = job_service_pb2.SearchJobsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_jobs_for_alert(parent, request_metadata) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.matching_jobs[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.SearchJobsRequest( - parent=parent, request_metadata=request_metadata - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_jobs_for_alert_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_jobs_for_alert(parent, request_metadata) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_batch_create_jobs(self): - # Setup Expected Response - expected_response = {} - expected_response = job_service_pb2.JobOperationResult(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_batch_create_jobs", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - jobs = [] - - response = client.batch_create_jobs(parent, jobs) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.BatchCreateJobsRequest( - parent=parent, jobs=jobs - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_create_jobs_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_create_jobs_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - jobs = [] - - response = client.batch_create_jobs(parent, jobs) - exception = response.exception() - assert exception.errors[0] == error - - def test_batch_update_jobs(self): - # Setup Expected Response - expected_response = {} - expected_response = job_service_pb2.JobOperationResult(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_batch_update_jobs", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - jobs = [] - - response = client.batch_update_jobs(parent, jobs) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = job_service_pb2.BatchUpdateJobsRequest( - parent=parent, jobs=jobs - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_update_jobs_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_batch_update_jobs_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.JobServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - jobs = [] - - response = client.batch_update_jobs(parent, jobs) - exception = response.exception() - assert exception.errors[0] == error diff --git a/talent/tests/unit/gapic/v4beta1/test_profile_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_profile_service_client_v4beta1.py deleted file mode 100644 index 5e7c15297af1..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_profile_service_client_v4beta1.py +++ /dev/null @@ -1,356 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import common_pb2 -from google.cloud.talent_v4beta1.proto import profile_pb2 -from google.cloud.talent_v4beta1.proto import profile_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestProfileServiceClient(object): - def test_list_profiles(self): - # Setup Expected Response - next_page_token = "" - profiles_element = {} - profiles = [profiles_element] - expected_response = {"next_page_token": next_page_token, "profiles": profiles} - expected_response = profile_service_pb2.ListProfilesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - - paged_list_response = client.list_profiles(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.profiles[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.ListProfilesRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_profiles_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - - paged_list_response = client.list_profiles(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_create_profile(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - source = "source-896505829" - uri = "uri116076" - group_id = "groupId506361563" - processed = True - keyword_snippet = "keywordSnippet1325317319" - expected_response = { - "name": name, - "external_id": external_id, - "source": source, - "uri": uri, - "group_id": group_id, - "processed": processed, - "keyword_snippet": keyword_snippet, - } - expected_response = profile_pb2.Profile(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - profile = {} - - response = client.create_profile(parent, profile) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.CreateProfileRequest( - parent=parent, profile=profile - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_profile_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - profile = {} - - with pytest.raises(CustomException): - client.create_profile(parent, profile) - - def test_get_profile(self): - # Setup Expected Response - name_2 = "name2-1052831874" - external_id = "externalId-1153075697" - source = "source-896505829" - uri = "uri116076" - group_id = "groupId506361563" - processed = True - keyword_snippet = "keywordSnippet1325317319" - expected_response = { - "name": name_2, - "external_id": external_id, - "source": source, - "uri": uri, - "group_id": group_id, - "processed": processed, - "keyword_snippet": keyword_snippet, - } - expected_response = profile_pb2.Profile(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - name = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - response = client.get_profile(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.GetProfileRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_profile_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - name = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - with pytest.raises(CustomException): - client.get_profile(name) - - def test_update_profile(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - source = "source-896505829" - uri = "uri116076" - group_id = "groupId506361563" - processed = True - keyword_snippet = "keywordSnippet1325317319" - expected_response = { - "name": name, - "external_id": external_id, - "source": source, - "uri": uri, - "group_id": group_id, - "processed": processed, - "keyword_snippet": keyword_snippet, - } - expected_response = profile_pb2.Profile(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - profile = {} - - response = client.update_profile(profile) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.UpdateProfileRequest(profile=profile) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_profile_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - profile = {} - - with pytest.raises(CustomException): - client.update_profile(profile) - - def test_delete_profile(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - name = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - client.delete_profile(name) - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.DeleteProfileRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_profile_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - name = client.profile_path("[PROJECT]", "[TENANT]", "[PROFILE]") - - with pytest.raises(CustomException): - client.delete_profile(name) - - def test_search_profiles(self): - # Setup Expected Response - estimated_total_size = 1882144769 - next_page_token = "" - result_set_id = "resultSetId-770306950" - summarized_profiles_element = {} - summarized_profiles = [summarized_profiles_element] - expected_response = { - "estimated_total_size": estimated_total_size, - "next_page_token": next_page_token, - "result_set_id": result_set_id, - "summarized_profiles": summarized_profiles, - } - expected_response = profile_service_pb2.SearchProfilesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup Request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_profiles(parent, request_metadata) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.summarized_profiles[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = profile_service_pb2.SearchProfilesRequest( - parent=parent, request_metadata=request_metadata - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_search_profiles_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.ProfileServiceClient() - - # Setup request - parent = client.tenant_path("[PROJECT]", "[TENANT]") - request_metadata = {} - - paged_list_response = client.search_profiles(parent, request_metadata) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/talent/tests/unit/gapic/v4beta1/test_tenant_service_client_v4beta1.py b/talent/tests/unit/gapic/v4beta1/test_tenant_service_client_v4beta1.py deleted file mode 100644 index 3ea8c09d39f4..000000000000 --- a/talent/tests/unit/gapic/v4beta1/test_tenant_service_client_v4beta1.py +++ /dev/null @@ -1,258 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import talent_v4beta1 -from google.cloud.talent_v4beta1.proto import tenant_pb2 -from google.cloud.talent_v4beta1.proto import tenant_service_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTenantServiceClient(object): - def test_create_tenant(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - expected_response = {"name": name, "external_id": external_id} - expected_response = tenant_pb2.Tenant(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - tenant = {} - - response = client.create_tenant(parent, tenant) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = tenant_service_pb2.CreateTenantRequest( - parent=parent, tenant=tenant - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_tenant_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - tenant = {} - - with pytest.raises(CustomException): - client.create_tenant(parent, tenant) - - def test_get_tenant(self): - # Setup Expected Response - name_2 = "name2-1052831874" - external_id = "externalId-1153075697" - expected_response = {"name": name_2, "external_id": external_id} - expected_response = tenant_pb2.Tenant(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup Request - name = client.tenant_path("[PROJECT]", "[TENANT]") - - response = client.get_tenant(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = tenant_service_pb2.GetTenantRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_tenant_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup request - name = client.tenant_path("[PROJECT]", "[TENANT]") - - with pytest.raises(CustomException): - client.get_tenant(name) - - def test_update_tenant(self): - # Setup Expected Response - name = "name3373707" - external_id = "externalId-1153075697" - expected_response = {"name": name, "external_id": external_id} - expected_response = tenant_pb2.Tenant(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup Request - tenant = {} - - response = client.update_tenant(tenant) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = tenant_service_pb2.UpdateTenantRequest(tenant=tenant) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_tenant_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup request - tenant = {} - - with pytest.raises(CustomException): - client.update_tenant(tenant) - - def test_delete_tenant(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup Request - name = client.tenant_path("[PROJECT]", "[TENANT]") - - client.delete_tenant(name) - - assert len(channel.requests) == 1 - expected_request = tenant_service_pb2.DeleteTenantRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_tenant_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup request - name = client.tenant_path("[PROJECT]", "[TENANT]") - - with pytest.raises(CustomException): - client.delete_tenant(name) - - def test_list_tenants(self): - # Setup Expected Response - next_page_token = "" - tenants_element = {} - tenants = [tenants_element] - expected_response = {"next_page_token": next_page_token, "tenants": tenants} - expected_response = tenant_service_pb2.ListTenantsResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup Request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_tenants(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.tenants[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = tenant_service_pb2.ListTenantsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_tenants_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = talent_v4beta1.TenantServiceClient() - - # Setup request - parent = client.project_path("[PROJECT]") - - paged_list_response = client.list_tenants(parent) - with pytest.raises(CustomException): - list(paged_list_response) diff --git a/trace/.coveragerc b/trace/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/trace/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/trace/.flake8 b/trace/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/trace/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/trace/.repo-metadata.json b/trace/.repo-metadata.json deleted file mode 100644 index cd282113f47a..000000000000 --- a/trace/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "cloudtrace", - "name_pretty": "Stackdriver Trace", - "product_documentation": "https://cloud.google.com/trace/docs", - "client_documentation": "https://googleapis.dev/python/cloudtrace/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/559776", - "release_level": "alpha", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-trace", - "api_id": "cloudtrace.googleapis.com", - "requires_billing": false -} \ No newline at end of file diff --git a/trace/CHANGELOG.md b/trace/CHANGELOG.md deleted file mode 100644 index adb6e946901c..000000000000 --- a/trace/CHANGELOG.md +++ /dev/null @@ -1,183 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-trace/#history - -## 0.23.0 - -10-15-2019 06:59 PDT - - -### Dependencies -- Pin 'google-cloud-core >= 1.0.3, < 2.0.0dev'. ([#9445](https://github.com/googleapis/google-cloud-python/pull/9445)) - -### Documentation -- Change requests intersphinx url (via synth). ([#9410](https://github.com/googleapis/google-cloud-python/pull/9410)) -- Fix intersphinx reference to requests ([#9294](https://github.com/googleapis/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/googleapis/google-cloud-python/pull/9085)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/googleapis/google-cloud-python/pull/9035)) - -## 0.22.1 - -08-12-2019 13:51 PDT - -### Implementation Changes -- Remove send/recv msg size limit (via synth). ([#8973](https://github.com/googleapis/google-cloud-python/pull/8973)) - -### Documentation -- Fix links to googleapis.dev ([#8998](https://github.com/googleapis/google-cloud-python/pull/8998)) -- Fix pip / usage examples in README.rst. ([#8833](https://github.com/googleapis/google-cloud-python/pull/8833)) -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.22.0 - -07-24-2019 17:50 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8408](https://github.com/googleapis/google-cloud-python/pull/8408)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8526](https://github.com/googleapis/google-cloud-python/pull/8526)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- All: Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8368](https://github.com/googleapis/google-cloud-python/pull/8368)) -- Add disclaimer to auto-generated template files (via synth). ([#8332](https://github.com/googleapis/google-cloud-python/pull/8332)) -- Fix coverage in 'types.py' (via synth). ([#8167](https://github.com/googleapis/google-cloud-python/pull/8167)) -- Add empty lines (via synth). ([#8075](https://github.com/googleapis/google-cloud-python/pull/8075)) - -## 0.21.0 - -05-16-2019 12:58 PDT - - -### Implementation Changes -- Add routing header to method metadata (via synth). ([#7602](https://github.com/googleapis/google-cloud-python/pull/7602)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Add `client_info` support to clients. ([#7899](https://github.com/googleapis/google-cloud-python/pull/7899)) - -### Dependencies -- Pin `google-cloud-core >= 1.0.0, < 2.0dev`. ([#7993](https://github.com/googleapis/google-cloud-python/pull/7993)) - -### Documentation -- Update docstring for `page_size` (via synth). ([#7688](https://github.com/googleapis/google-cloud-python/pull/7688)) -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Pick up stub docstring fix in GAPIC generator. ([#6985](https://github.com/googleapis/google-cloud-python/pull/6985)) - -### Internal / Testing Changes -- Add nox session `docs`, reorder methods (via synth). ([#7783](https://github.com/googleapis/google-cloud-python/pull/7783)) and ([#7784](https://github.com/googleapis/google-cloud-python/pull/7784)) -- Copy lintified proto files (via synth). ([#7455](https://github.com/googleapis/google-cloud-python/pull/7455)) -- Add clarifying comment to blacken nox target. ([#7406](https://github.com/googleapis/google-cloud-python/pull/7406)) -- Remove unused message exports (via synth). ([#7278](https://github.com/googleapis/google-cloud-python/pull/7278)) -- Copy proto files alongside protoc versions ([#7254](https://github.com/googleapis/google-cloud-python/pull/7254)) -- Trivial gapic-generator change. ([#7236](https://github.com/googleapis/google-cloud-python/pull/7236)) -- Add protos as an artifact to library ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) -- Update copyright headers (via synth). ([#7161](https://github.com/googleapis/google-cloud-python/pull/7161)) -- Protoc-generated serialization update. ([#7098](https://github.com/googleapis/google-cloud-python/pull/7098)) - -## 0.20.2 - -12-17-2018 17:06 PST - - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) - -## 0.20.1 - -12-07-2018 16:06 PST - -### Implementation Changes -- Fix trace client memory leak ([#6856](https://github.com/googleapis/google-cloud-python/pull/6856)) - -### Dependencies -- Update version of google-cloud-core ([#6858](https://github.com/googleapis/google-cloud-python/pull/6858)) - -### Internal / Testing Changes -- Add baseline for synth.metadata - -## 0.20.0 - -12-05-2018 13:16 PST - - -### Implementation Changes -- Use moved iam.policy now at google.api_core.iam.policy ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Pick up fixes to GAPIC generator. ([#6577](https://github.com/googleapis/google-cloud-python/pull/6577)) -- Fix client_info bug, update docstrings and timeouts. ([#6424](https://github.com/googleapis/google-cloud-python/pull/6424)) -- Pass credentials into TraceServiceClient ([#5596](https://github.com/googleapis/google-cloud-python/pull/5596)) -- Avoid overwriting '__module__' of messages from shared modules. ([#5364](https://github.com/googleapis/google-cloud-python/pull/5364)) - -### New Features -- Add 'synth.py'. ([#6083](https://github.com/googleapis/google-cloud-python/pull/6083)) - -### Dependencies -- Bump minimum 'api_core' version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Normalize use of support level badges ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Add static HTML redirect page for 'trace/starting.html'. ([#6142](https://github.com/googleapis/google-cloud-python/pull/6142)) -- Prep docs for repo split. ([#6024](https://github.com/googleapis/google-cloud-python/pull/6024)) -- Replace links to '/stable/' with '/latest/'. ([#5901](https://github.com/googleapis/google-cloud-python/pull/5901)) - -### Internal / Testing Changes -- Updates to noxfile and other templates. Start Blackening. ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)), - ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)), - ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)), - ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)), - ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) -- Use new Nox ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) -- Add kokoro for trace, remove trace from CircleCI ([#6112](https://github.com/googleapis/google-cloud-python/pull/6112)) -- Use inplace installs ([#5865](https://github.com/googleapis/google-cloud-python/pull/5865)) -- Add Test runs for Python 3.7 and remove 3.4 ([#5295](https://github.com/googleapis/google-cloud-python/pull/5295)) -- Fix bad trove classifier -- Move unit test from gax to gapic ([#4988](https://github.com/googleapis/google-cloud-python/pull/4988)) - -## 0.19.0 - -### Dependencies - -- The minimum version for `google-api-core` has been updated to version 1.0.0. This may cause some incompatibility with older google-cloud libraries, you will need to update those libraries if you have a dependency conflict. (#4944, #4946) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) - -## 0.18.0 - -### Breaking changes - -- The underlying autogenerated client library was re-generated to pick up new - features and resolve bugs, this may change the exceptions raised from various - methods. (#4799) - -## 0.17.0 - -### Notable Implementation Changes - -- Default to use Stackdriver Trace V2 API if calling `from google.cloud import trace`. - Using V1 API needs to be explicitly specified in the import.(#4437) - -PyPI: https://pypi.org/project/google-cloud-trace/0.17.0/ - -## 0.16.0 - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) - -PyPI: https://pypi.org/project/google-cloud-trace/0.16.0/ diff --git a/trace/LICENSE b/trace/LICENSE deleted file mode 100644 index 724a8807144b..000000000000 --- a/trace/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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 - - http://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. diff --git a/trace/MANIFEST.in b/trace/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/trace/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/trace/PUBLISHING.rst b/trace/PUBLISHING.rst deleted file mode 100644 index a6d81225248b..000000000000 --- a/trace/PUBLISHING.rst +++ /dev/null @@ -1,46 +0,0 @@ -PUBLISHING ----------- - -Note: This folder has been generated by the GAPIC code generator. - -The instructions assumes that no changes have been made to folder and its -contents since it was created. - -PREREQUISITES -------------- - -- Python must installed -- [tox](https://testrun.org/tox/latest/) must be installed - - -TO PUBLISH ----------- - -- Make sure you have `an account`_ on pypi_. -- Publish your package using tox. -- *tox must be used here or the uploaded package will be invalid!!* - - :: - - tox -e upload-package - - -TO PUBLISH THE DOCS -------------------- - -- Create the docs - - :: - - tox -e docs - -- Publish them to pythonhosted.org - - :: - - tox -e upload-docs - - -_`Packaging and Distributing projects`: https://packaging.python.org/en/latest/distributing.html#uploading-your-project-to-pypi -_`an account`: https://pypi.python.org/pypi?%3Aaction=register_form -_pypi: http://pypi.python.org diff --git a/trace/README.rst b/trace/README.rst deleted file mode 100644 index 71642c975dbf..000000000000 --- a/trace/README.rst +++ /dev/null @@ -1,112 +0,0 @@ -Python Client for Stackdriver Trace API -======================================= - -|alpha| |pypi| |versions| - -The `Stackdriver Trace API`_ sends application trace data to Stackdriver Trace -for viewing. Trace data is collected for all App Engine applications by -default. Trace data from other applications can be provided using this API. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |alpha| image:: https://img.shields.io/badge/support-alpha-orange.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#alpha-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-trace.svg - :target: https://pypi.org/project/google-cloud-trace/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-trace.svg - :target: https://pypi.org/project/google-cloud-trace/ -.. _Stackdriver Trace API: https://cloud.google.com/trace -.. _Client Library Documentation: https://googleapis.dev/python/cloudtrace/latest -.. _Product Documentation: https://cloud.google.com/trace - - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable the trace API.`_ -3. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable the trace API.: https://cloud.google.com/trace -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing -system install permissions, and without clashing with the installed system -dependencies. - -.. _virtualenv: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-trace - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-trace - -For more information on setting up your Python development environment, -such as installing ``pip`` and ``virtualenv`` on your system, please refer -to `Python Development Environment Setup Guide`_ for Google Cloud Platform. - -.. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup - - -Example Usage -~~~~~~~~~~~~~ - -.. code-block:: python - - from google.cloud.trace import trace_service_client - - client = trace_service_client.TraceServiceClient() - project_id = 'your-project-123' - - # Iterate over all results - for element in client.list_traces(project_id): - # process element - pass - - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Stackdriver Trace API - to see other available methods on the client. -- Read the `Product documentation`_ to learn more about the product and see - How-to Guides. diff --git a/trace/docs/README.rst b/trace/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/trace/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/trace/docs/_static/custom.css b/trace/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/trace/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/trace/docs/_templates/layout.html b/trace/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/trace/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/trace/docs/changelog.md b/trace/docs/changelog.md deleted file mode 120000 index 04c99a55caae..000000000000 --- a/trace/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../CHANGELOG.md \ No newline at end of file diff --git a/trace/docs/conf.py b/trace/docs/conf.py deleted file mode 100644 index 7e5c9d1b4f87..000000000000 --- a/trace/docs/conf.py +++ /dev/null @@ -1,357 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-trace documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-trace" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-trace-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-trace.tex", - u"google-cloud-trace Documentation", - author, - "manual", - ), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - (master_doc, "google-cloud-trace", u"google-cloud-trace Documentation", [author], 1) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-trace", - u"google-cloud-trace Documentation", - author, - "google-cloud-trace", - "GAPIC library for the {metadata.shortName} v2 service", - "APIs", - ), -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/trace/docs/gapic/v1/api.rst b/trace/docs/gapic/v1/api.rst deleted file mode 100644 index 2de320c95966..000000000000 --- a/trace/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Stackdriver Trace API -================================ - -.. automodule:: google.cloud.trace_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/trace/docs/gapic/v1/types.rst b/trace/docs/gapic/v1/types.rst deleted file mode 100644 index e2c1a9b972b5..000000000000 --- a/trace/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Stackdriver Trace API Client -====================================== - -.. automodule:: google.cloud.trace_v1.types - :members: \ No newline at end of file diff --git a/trace/docs/gapic/v2/api.rst b/trace/docs/gapic/v2/api.rst deleted file mode 100644 index 48f0d58d6308..000000000000 --- a/trace/docs/gapic/v2/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Stackdriver Trace API -================================ - -.. automodule:: google.cloud.trace_v2 - :members: - :inherited-members: \ No newline at end of file diff --git a/trace/docs/gapic/v2/types.rst b/trace/docs/gapic/v2/types.rst deleted file mode 100644 index 071d7a5ad279..000000000000 --- a/trace/docs/gapic/v2/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Stackdriver Trace API Client -====================================== - -.. automodule:: google.cloud.trace_v2.types - :members: \ No newline at end of file diff --git a/trace/docs/index.rst b/trace/docs/index.rst deleted file mode 100644 index 576afb6c154e..000000000000 --- a/trace/docs/index.rst +++ /dev/null @@ -1,34 +0,0 @@ -.. include:: README.rst - - -API Reference -------------- - -The current version of the API is ``v2``: - -.. toctree:: - :maxdepth: 2 - - gapic/v2/api - gapic/v2/types - -Support for the previous API release, ``v1``, is provided for code previously -written against it. In order to use this release, you will want to import from -e.g. ``google.cloud.trace_v1`` in lieu of ``google.cloud.trace_v2``. - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - - -Changelog ---------- - -For a list of all ``google-cloud-trace`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/trace/docs/starting.html b/trace/docs/starting.html deleted file mode 100644 index 9b81d6976cda..000000000000 --- a/trace/docs/starting.html +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - diff --git a/trace/google/__init__.py b/trace/google/__init__.py deleted file mode 100644 index 5284146ebf2b..000000000000 --- a/trace/google/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__("pkg_resources").declare_namespace(__name__) diff --git a/trace/google/cloud/__init__.py b/trace/google/cloud/__init__.py deleted file mode 100644 index 5284146ebf2b..000000000000 --- a/trace/google/cloud/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__("pkg_resources").declare_namespace(__name__) diff --git a/trace/google/cloud/trace.py b/trace/google/cloud/trace.py deleted file mode 100644 index 376119a3034a..000000000000 --- a/trace/google/cloud/trace.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - -from google.cloud.trace_v2 import TraceServiceClient -from google.cloud.trace_v2 import enums -from google.cloud.trace_v2 import types - -__all__ = ("enums", "types", "TraceServiceClient") diff --git a/trace/google/cloud/trace/__init__.py b/trace/google/cloud/trace/__init__.py deleted file mode 100644 index 697ae1671777..000000000000 --- a/trace/google/cloud/trace/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -from __future__ import absolute_import - -from pkg_resources import get_distribution - -__version__ = get_distribution("google-cloud-trace").version - -from google.cloud.trace.client import Client -from google.cloud.trace_v2 import types -from google.cloud.trace_v2.gapic import enums -from google.cloud.trace_v2.gapic import trace_service_client - - -class TraceServiceClient(trace_service_client.TraceServiceClient): - __doc__ = trace_service_client.TraceServiceClient.__doc__ - enums = enums - - -__all__ = ("__version__", "enums", "types", "TraceServiceClient", "Client", "SCOPE") - -SCOPE = Client.SCOPE diff --git a/trace/google/cloud/trace/_gapic.py b/trace/google/cloud/trace/_gapic.py deleted file mode 100644 index 00ac94d336d4..000000000000 --- a/trace/google/cloud/trace/_gapic.py +++ /dev/null @@ -1,321 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""Wrapper for interacting with the Stackdriver Trace API.""" - -from google.api_core.gapic_v1 import method -from google.cloud._helpers import _datetime_to_pb_timestamp -from google.cloud.trace_v2.gapic import trace_service_client -from google.cloud.trace_v2.proto import trace_pb2 -from google.protobuf.json_format import ParseDict -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 - - -class _TraceAPI(object): - """ - Wrapper to help mapping trace-related APIs. - - See - https://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools. - cloudtrace.v2 - - Args: - gapic (~google.cloud.trace_v2.gapic.trace_service_client. - TraceServiceClient): Required. API object used to make RPCs. - - client (~google.cloud.trace_v2.client.Client): Required. The - client that owns this API object. - """ - - def __init__(self, gapic_api, client): - self._gapic_api = gapic_api - self.client = client - - def batch_write_spans( - self, name, spans, retry=method.DEFAULT, timeout=method.DEFAULT - ): - """ - Sends new spans to Stackdriver Trace or updates existing traces. If the - name of a trace that you send matches that of an existing trace, new - spans are added to the existing trace. Attempt to update existing spans - results undefined behavior. If the name does not match, a new trace is - created with given set of spans. - - Args: - name (str): Required. Name of the project where the spans belong. - The format is ``projects/PROJECT_ID``. - spans (list[Union[dict, ~google.cloud.trace_v2.types.Span]]): A - collection of spans. If a dict is provided, it must be of the - same form as the protobuf message - :class:`~google.cloud.trace_v2.types.Span` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - spans_pb_list = [] - - for span_mapping in spans["spans"]: - span_pb = _dict_mapping_to_pb(span_mapping, "Span") - spans_pb_list.append(span_pb) - - self._gapic_api.batch_write_spans( - name=name, spans=spans_pb_list, retry=retry, timeout=timeout - ) - - def create_span( - self, - name, - span_id, - display_name, - start_time, - end_time, - parent_span_id=None, - attributes=None, - stack_trace=None, - time_events=None, - links=None, - status=None, - same_process_as_parent_span=None, - child_span_count=None, - retry=method.DEFAULT, - timeout=method.DEFAULT, - ): - """ - Creates a new Span. - - Example: - >>> from google.cloud import trace_v2 - >>> - >>> client = trace_v2.TraceServiceClient() - >>> - >>> name = client.span_path('[PROJECT]', '[TRACE]', '[SPAN]') - >>> span_id = '' - >>> display_name = {} - >>> start_time = {} - >>> end_time = {} - >>> - >>> response = client.create_span(name, span_id, display_name, - start_time, end_time) - - Args: - name (str): The resource name of the span in the following format: - - :: - - projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] - - [TRACE_ID] is a unique identifier for a trace within a project. - [SPAN_ID] is a unique identifier for a span within a trace, - assigned when the span is created. - span_id (str): The [SPAN_ID] portion of the span's resource name. - The ID is a 16-character hexadecimal encoding of an 8-byte - array. - display_name (dict): A description of the span's operation - (up to 128 bytes). Stackdriver Trace displays the description - in the {% dynamic print site_values.console_name %}. - For example, the display name can be a qualified method name - or a file name and a line number where the operation is called. - A best practice is to use the same display name within an - application and at the same call point. This makes it easier to - correlate spans in different traces. - Contains two fields, value is the truncated name, - truncatedByteCount is the number of bytes removed from the - original string. If 0, then the string was not shortened. - start_time (:class:`~datetime.datetime`): - The start time of the span. On the client side, this is the - time kept by the local machine where the span execution starts. - On the server side, this is the time when the server's - application handler starts running. - end_time (:class:`~datetime.datetime`): - The end time of the span. On the client side, this is the time - kept by the local machine where the span execution ends. On the - server side, this is the time when the server application - handler stops running. - parent_span_id (str): The [SPAN_ID] of this span's parent span. - If this is a root span, then this field must be empty. - attributes (dict): A set of attributes on the span. There is a - limit of 32 attributes per span. - stack_trace (dict): - Stack trace captured at the start of the span. - Contains two fields, stackFrames is a list of stack frames in - this call stack, a maximum of 128 frames are allowed per - StackFrame; stackTraceHashId is used to conserve network - bandwidth for duplicate stack traces within a single trace. - time_events (dict): - The included time events. There can be up to 32 annotations - and 128 message events per span. - links (dict): A maximum of 128 links are allowed per Span. - status (dict): An optional final status for this span. - same_process_as_parent_span (bool): A highly recommended but not - required flag that identifies when a trace crosses a process - boundary. True when the parent_span belongs to the same process - as the current span. - child_span_count (int): An optional number of child spans that were - generated while this span was active. If set, allows - implementation to detect missing child spans. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Returns: - A :class:`~google.cloud.trace_v2.types.Span` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Convert the dict type parameters to protobuf - display_name = _dict_mapping_to_pb(display_name, "TruncatableString") - start_time = _datetime_to_pb_timestamp(start_time) - end_time = _datetime_to_pb_timestamp(end_time) - - if attributes is not None: - attributes = _span_attrs_to_pb(attributes, "Attributes") - - if stack_trace is not None: - stack_trace = _dict_mapping_to_pb(stack_trace, "StackTrace") - - if time_events is not None: - time_events = _span_attrs_to_pb(time_events, "TimeEvents") - - if links is not None: - links = _span_attrs_to_pb(links, "Links") - - if status is not None: - status = _status_mapping_to_pb(status) - - if same_process_as_parent_span is not None: - same_process_as_parent_span = _value_to_pb( - same_process_as_parent_span, "BoolValue" - ) - - if child_span_count is not None: - child_span_count = _value_to_pb(child_span_count, "Int32Value") - - return self._gapic_api.create_span( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - parent_span_id=parent_span_id, - attributes=attributes, - stack_trace=stack_trace, - time_events=time_events, - links=links, - status=status, - same_process_as_parent_span=same_process_as_parent_span, - child_span_count=child_span_count, - ) - - -def _dict_mapping_to_pb(mapping, proto_type): - """ - Convert a dict to protobuf. - - Args: - mapping (dict): A dict that needs to be converted to protobuf. - proto_type (str): The type of the Protobuf. - - Returns: - An instance of the specified protobuf. - """ - converted_pb = getattr(trace_pb2, proto_type)() - ParseDict(mapping, converted_pb) - return converted_pb - - -def _span_attrs_to_pb(span_attr, proto_type): - """ - Convert a span attribute dict to protobuf, including Links, Attributes, - TimeEvents. - - Args: - span_attr (dict): A dict that needs to be converted to protobuf. - proto_type (str): The type of the Protobuf. - - Returns: - An instance of the specified protobuf. - """ - attr_pb = getattr(trace_pb2.Span, proto_type)() - ParseDict(span_attr, attr_pb) - return attr_pb - - -def _status_mapping_to_pb(status): - """ - Convert a status dict to protobuf. - - Args: - status (dict): A status that needs to be converted to protobuf. - - Returns: - An instance of the specified protobuf. - """ - status_pb = google_dot_rpc_dot_status__pb2.Status() - ParseDict(status, status_pb) - return status_pb - - -def _value_to_pb(value, proto_type): - """ - Convert a value to protobuf. e.g. BoolValue, Int32Value. - - Args: - value (dict): A dict that needs to be converted to protobuf. - proto_type (str): The type of the Protobuf. - - Returns: - An instance of the specified protobuf. - """ - data_type_pb = getattr(google_dot_protobuf_dot_wrappers__pb2, proto_type)() - ParseDict(value, data_type_pb) - return data_type_pb - - -def make_trace_api(client): - """ - Create an instance of the gapic Trace API. - - Args: - client (:class:`~google.cloud.trace_v2.client.Client`): The client - that holds configuration details. - - Returns: - A :class:`~google.cloud.trace_v2._gapic._TraceAPI` instance with the - proper configurations. - """ - generated = trace_service_client.TraceServiceClient( - credentials=client._credentials, - client_info=client._client_info, - client_options=client._client_options, - ) - return _TraceAPI(generated, client) diff --git a/trace/google/cloud/trace/client.py b/trace/google/cloud/trace/client.py deleted file mode 100644 index 90ddd7134c85..000000000000 --- a/trace/google/cloud/trace/client.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""Client for interacting with the Stackdriver Trace API.""" - -from google.api_core.gapic_v1 import client_info -from google.cloud.client import ClientWithProject -from google.cloud.trace import __version__ -from google.cloud.trace._gapic import make_trace_api - - -_CLIENT_INFO = client_info.ClientInfo(client_library_version=__version__) - - -class Client(ClientWithProject): - """ - Client to bundle configuration needed for API requests. - - Args: - project (str): The project which the client acts on behalf of. - If not passed, falls back to the default inferred from - the environment. - credentials (Optional[:class:`~google.auth.credentials.Credentials`]): - The OAuth2 Credentials to use for this client. If not passed, - falls back to the default inferred from the environment. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with API - requests. If ``None``, then default info will be used. Generally, - you only need to set this if you're developing your own library - or partner tool. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - - SCOPE = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append", - ) - """The scopes required for authenticating as a Trace consumer.""" - - _trace_api = None - - def __init__( - self, - project=None, - credentials=None, - client_info=_CLIENT_INFO, - client_options=None, - ): - super(Client, self).__init__(project=project, credentials=credentials) - self._client_info = client_info - self._client_options = client_options - - @property - def trace_api(self): - """ - Helper for trace-related API calls. - - See - https://cloud.google.com/trace/docs/reference/v2/rpc/google.devtools. - cloudtrace.v2 - """ - if self._trace_api is None: - self._trace_api = make_trace_api(self) - return self._trace_api - - def batch_write_spans(self, name, spans, retry=None, timeout=None): - """ - Sends new spans to Stackdriver Trace or updates existing traces. If the - name of a trace that you send matches that of an existing trace, new - spans are added to the existing trace. Attempt to update existing spans - results undefined behavior. If the name does not match, a new trace is - created with given set of spans. - - Example: - >>> from google.cloud import trace_v2 - >>> - >>> client = trace_v2.Client() - >>> - >>> name = 'projects/[PROJECT_ID]' - >>> spans = {'spans': [{'endTime': '2017-11-21T23:50:58.890768Z', - 'spanId': [SPAN_ID], - 'startTime': '2017-11-21T23:50:58.890763Z', - 'name': 'projects/[PROJECT_ID]/traces/ - [TRACE_ID]/spans/[SPAN_ID]', - 'displayName': {'value': 'sample span'}}]} - >>> - >>> client.batch_write_spans(name, spans) - - Args: - name (str): Optional. Name of the project where the spans belong. - The format is ``projects/PROJECT_ID``. - spans (dict): A collection of spans. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - self.trace_api.batch_write_spans( - name=name, spans=spans, retry=retry, timeout=timeout - ) - - def create_span( - self, - name, - span_id, - display_name, - start_time, - end_time, - parent_span_id=None, - attributes=None, - stack_trace=None, - time_events=None, - links=None, - status=None, - same_process_as_parent_span=None, - child_span_count=None, - retry=None, - timeout=None, - ): - """ - Creates a new Span. - - Example: - >>> from google.cloud import trace_v2 - >>> - >>> client = trace_v2.Client() - >>> - >>> name = 'projects/{project}/traces/{trace_id}/spans/{span_id}'. - format('[PROJECT]', '[TRACE_ID]', '[SPAN_ID]') - >>> span_id = '[SPAN_ID]' - >>> display_name = {} - >>> start_time = {} - >>> end_time = {} - >>> - >>> response = client.create_span(name, span_id, display_name, - start_time, end_time) - - Args: - name (str): The resource name of the span in the following format: - - :: - - projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] - - [TRACE_ID] is a unique identifier for a trace within a project. - [SPAN_ID] is a unique identifier for a span within a trace, - assigned when the span is created. - span_id (str): The [SPAN_ID] portion of the span's resource name. - The ID is a 16-character hexadecimal encoding of an 8-byte - array. - display_name (dict): A description of the span's operation - (up to 128 bytes). Stackdriver Trace displays the description - in the {% dynamic print site_values.console_name %}. - For example, the display name can be a qualified method name - or a file name and a line number where the operation is called. - A best practice is to use the same display name within an - application and at the same call point. This makes it easier to - correlate spans in different traces. - Contains two fields, value is the truncated name, - truncatedByteCount is the number of bytes removed from the - original string. If 0, then the string was not shortened. - start_time (:class:`~datetime.datetime`): - The start time of the span. On the client side, this is the - time kept by the local machine where the span execution starts. - On the server side, this is the time when the server's - application handler starts running. - end_time (:class:`~datetime.datetime`): - The end time of the span. On the client side, this is the time - kept by the local machine where the span execution ends. On the - server side, this is the time when the server application - handler stops running. - parent_span_id (str): The [SPAN_ID] of this span's parent span. - If this is a root span, then this field must be empty. - attributes (dict): A set of attributes on the span. There is a - limit of 32 attributes per span. - stack_trace (dict): - Stack trace captured at the start of the span. - Contains two fields, stackFrames is a list of stack frames in - this call stack, a maximum of 128 frames are allowed per - StackFrame; stackTraceHashId is used to conserve network - bandwidth for duplicate stack traces within a single trace. - time_events (dict): - The included time events. There can be up to 32 annotations - and 128 message events per span. - links (dict): A maximum of 128 links are allowed per Span. - status (dict): An optional final status for this span. - same_process_as_parent_span (bool): A highly recommended but not - required flag that identifies when a trace crosses a process - boundary. True when the parent_span belongs to the same process - as the current span. - child_span_count (int): An optional number of child spans that were - generated while this span was active. If set, allows - implementation to detect missing child spans. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Returns: - A :class:`~google.cloud.trace_v2.types.Span` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - return self.trace_api.create_span( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - parent_span_id=parent_span_id, - attributes=attributes, - stack_trace=stack_trace, - time_events=time_events, - links=links, - status=status, - same_process_as_parent_span=same_process_as_parent_span, - child_span_count=child_span_count, - ) diff --git a/trace/google/cloud/trace/v1/__init__.py b/trace/google/cloud/trace/v1/__init__.py deleted file mode 100644 index 4c6bd18dd38a..000000000000 --- a/trace/google/cloud/trace/v1/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -from google.cloud.trace.v1.client import Client - - -__all__ = ["Client", "SCOPE"] - - -SCOPE = Client.SCOPE diff --git a/trace/google/cloud/trace/v1/_gapic.py b/trace/google/cloud/trace/v1/_gapic.py deleted file mode 100644 index a5f5b2f7f0ab..000000000000 --- a/trace/google/cloud/trace/v1/_gapic.py +++ /dev/null @@ -1,200 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""Wrapper for interacting with the Stackdriver Trace API.""" - -from google.api_core.gapic_v1 import client_info -from google.cloud.trace import __version__ -from google.cloud.trace_v1.gapic import trace_service_client -from google.cloud.trace_v1.proto import trace_pb2 -from google.protobuf.json_format import MessageToDict -from google.protobuf.json_format import ParseDict - - -_CLIENT_INFO = client_info.ClientInfo(client_library_version=__version__) - - -class _TraceAPI(object): - """ - Wrapper to help mapping trace-related APIs. - - See - https://cloud.google.com/trace/docs/reference/v1/rpc/google.devtools. - cloudtrace.v1 - - Args: - gapic_api (~google.cloud.trace_v1.gapic.trace_service_client. - TraceServiceClient): Required. API object used to make RPCs. - client (~google.cloud.trace.client.Client): The client that owns this - API object. - """ - - def __init__(self, gapic_api, client): - self._gapic_api = gapic_api - self.client = client - - def patch_traces(self, project_id, traces): - """ - Sends new traces to Stackdriver Trace or updates existing traces. - - Args: - project_id (Optional[str]): ID of the Cloud project where the trace - data is stored. - traces (dict): Required. The traces to be patched in the API call. - """ - traces_pb = _traces_mapping_to_pb(traces) - self._gapic_api.patch_traces(project_id, traces_pb) - - def get_trace(self, project_id, trace_id): - """ - Gets a single trace by its ID. - - Args: - trace_id (str): ID of the trace to return. - project_id (str): Required. ID of the Cloud project where the trace - data is stored. - - Returns: - A Trace dict. - """ - trace_pb = self._gapic_api.get_trace(project_id, trace_id) - trace_mapping = _parse_trace_pb(trace_pb) - return trace_mapping - - def list_traces( - self, - project_id, - view=None, - page_size=None, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - page_token=None, - ): - """ - Returns of a list of traces that match the filter conditions. - - Args: - project_id (Optional[str]): ID of the Cloud project where the trace - data is stored. - - view (Optional[~google.cloud.trace_v1.gapic.enums. - ListTracesRequest.ViewType]): Type of data returned for traces - in the list. Default is ``MINIMAL``. - - page_size (Optional[int]): Maximum number of traces to return. If - not specified or <= 0, the implementation selects a reasonable - value. The implementation may return fewer traces than the - requested page size. - - start_time (Optional[~datetime.datetime]): Start of the time - interval (inclusive) during which the trace data was collected - from the application. - - end_time (Optional[~datetime.datetime]): End of the time interval - (inclusive) during which the trace data was collected from the - application. - - filter_ (Optional[str]): An optional filter for the request. - - order_by (Optional[str]): Field used to sort the returned traces. - - page_token (Optional[str]): opaque marker for the next "page" of - entries. If not passed, the API will return the first page of - entries. - - Returns: - A :class:`~google.api_core.page_iterator.Iterator` of traces that - match the specified filter conditions. - """ - page_iter = self._gapic_api.list_traces( - project_id=project_id, - view=view, - page_size=page_size, - start_time=start_time, - end_time=end_time, - filter_=filter_, - order_by=order_by, - ) - page_iter.item_to_value = _item_to_mapping - page_iter.next_page_token = page_token - return page_iter - - -def _parse_trace_pb(trace_pb): - """ - Parse a ``Trace`` protobuf to a dictionary. - - Args: - trace_pb (~google.cloud.trace_v1.proto.trace_pb2.Trace): A trace - protobuf instance. - - Returns: - The converted trace dict. - """ - try: - return MessageToDict(trace_pb) - except TypeError: - raise - - -def _item_to_mapping(iterator, trace_pb): - """ - Helper callable function for the page iterator - - Args: - iterator(~google.api_core.page_iterator.Iterator): The iterator that is - currently in use. - - trace_pb(~google.cloud.trace_v1.proto.trace_pb2.Trace): A trace - protobuf instance. - """ - mapping = _parse_trace_pb(trace_pb) - return mapping - - -def make_trace_api(client): - """ - Create an instance of the gapic Trace API. - - Args: - client (~google.cloud.trace.client.Client): The client that holds - configuration details. - - Returns: - A :class:`~google.cloud.trace._gapic._TraceAPI` instance with the - proper configurations. - """ - generated = trace_service_client.TraceServiceClient( - credentials=client._credentials, - client_info=client._client_info, - client_options=client._client_options, - ) - return _TraceAPI(generated, client) - - -def _traces_mapping_to_pb(traces_mapping): - """ - Convert a trace dict to protobuf. - - Args: - traces_mapping (dict): A trace mapping. - - Returns: - The converted protobuf type traces. - """ - traces_pb = trace_pb2.Traces() - ParseDict(traces_mapping, traces_pb) - return traces_pb diff --git a/trace/google/cloud/trace/v1/client.py b/trace/google/cloud/trace/v1/client.py deleted file mode 100644 index 2b79773078a4..000000000000 --- a/trace/google/cloud/trace/v1/client.py +++ /dev/null @@ -1,177 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""Client for interacting with the Stackdriver Trace API.""" - -from google.api_core.gapic_v1 import client_info -from google.cloud._helpers import _datetime_to_pb_timestamp -from google.cloud.client import ClientWithProject -from google.cloud.trace import __version__ -from google.cloud.trace.v1._gapic import make_trace_api - - -_CLIENT_INFO = client_info.ClientInfo(client_library_version=__version__) - - -class Client(ClientWithProject): - """ - Client to bundle configuration needed for API requests. - - Args: - project (str): Required. The project which the client acts on behalf - of. If not passed, falls back to the default inferred - from the environment. - credentials (Optional[~google.auth.credentials.Credentials]): - The OAuth2 Credentials to use for this client. If not - passed, falls back to the default inferred from the - environment. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with API - requests. If ``None``, then default info will be used. Generally, - you only need to set this if you're developing your own library - or partner tool. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - - SCOPE = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append", - ) - """The scopes required for authenticating as a Trace consumer.""" - - _trace_api = None - - def __init__( - self, - project=None, - credentials=None, - client_info=_CLIENT_INFO, - client_options=None, - ): - super(Client, self).__init__(project=project, credentials=credentials) - self._client_info = client_info - self._client_options = client_options - - @property - def trace_api(self): - """Helper for trace-related API calls. - - See - https://cloud.google.com/trace/docs/reference/v1/rpc/google.devtools. - cloudtrace.v1 - """ - if self._trace_api is None: - self._trace_api = make_trace_api(self) - return self._trace_api - - def patch_traces(self, traces, project_id=None): - """Sends new traces to Stackdriver Trace or updates existing traces. - - Args: - traces (dict): Required. The traces to be patched in the API call. - - project_id (Optional[str]): ID of the Cloud project where the trace - data is stored. - """ - if project_id is None: - project_id = self.project - - self.trace_api.patch_traces(project_id=project_id, traces=traces) - - def get_trace(self, trace_id, project_id=None): - """ - Gets a single trace by its ID. - - Args: - trace_id (str): ID of the trace to return. - - project_id (str): Required. ID of the Cloud project where the trace - data is stored. - - Returns: - A Trace dict. - """ - if project_id is None: - project_id = self.project - - return self.trace_api.get_trace(project_id=project_id, trace_id=trace_id) - - def list_traces( - self, - project_id=None, - view=None, - page_size=None, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - page_token=None, - ): - """ - Returns of a list of traces that match the filter conditions. - - Args: - project_id (Optional[str]): ID of the Cloud project where the trace - data is stored. - - view (Optional[~google.cloud.trace_v1.gapic.enums. - ListTracesRequest.ViewType]): Type of data returned for traces - in the list. Default is ``MINIMAL``. - - page_size (Optional[int]): Maximum number of traces to return. If - not specified or <= 0, the implementation selects a reasonable - value. The implementation may return fewer traces than the - requested page size. - - start_time (Optional[~datetime.datetime]): Start of the time - interval (inclusive) during which the trace data was collected - from the application. - - end_time (Optional[~datetime.datetime]): End of the time interval - (inclusive) during which the trace data was collected from the - application. - - filter_ (Optional[str]): An optional filter for the request. - - order_by (Optional[str]): Field used to sort the returned traces. - - page_token (Optional[str]): opaque marker for the next "page" of - entries. If not passed, the API will return the first page of - entries. - - Returns: - A :class:`~google.api_core.page_iterator.Iterator` of traces that - match the specified filter conditions. - """ - if project_id is None: - project_id = self.project - - if start_time is not None: - start_time = _datetime_to_pb_timestamp(start_time) - - if end_time is not None: - end_time = _datetime_to_pb_timestamp(end_time) - - return self.trace_api.list_traces( - project_id=project_id, - view=view, - page_size=page_size, - start_time=start_time, - end_time=end_time, - filter_=filter_, - order_by=order_by, - page_token=page_token, - ) diff --git a/trace/google/cloud/trace_v1/__init__.py b/trace/google/cloud/trace_v1/__init__.py deleted file mode 100644 index 85a41797cf86..000000000000 --- a/trace/google/cloud/trace_v1/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.trace_v1 import types -from google.cloud.trace_v1.gapic import enums -from google.cloud.trace_v1.gapic import trace_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TraceServiceClient(trace_service_client.TraceServiceClient): - __doc__ = trace_service_client.TraceServiceClient.__doc__ - enums = enums - - -__all__ = ( - "enums", - "types", - "TraceServiceClient", -) diff --git a/trace/google/cloud/trace_v1/gapic/__init__.py b/trace/google/cloud/trace_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v1/gapic/enums.py b/trace/google/cloud/trace_v1/gapic/enums.py deleted file mode 100644 index 0f4f3f9c01ef..000000000000 --- a/trace/google/cloud/trace_v1/gapic/enums.py +++ /dev/null @@ -1,60 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class ListTracesRequest(object): - class ViewType(enum.IntEnum): - """ - Type of data returned for traces in the list. - - Attributes: - VIEW_TYPE_UNSPECIFIED (int): Default is ``MINIMAL`` if unspecified. - MINIMAL (int): Minimal view of the trace record that contains only the project - and trace IDs. - ROOTSPAN (int): Root span view of the trace record that returns the root spans along - with the minimal trace data. - COMPLETE (int): Complete view of the trace record that contains the actual trace data. - This is equivalent to calling the REST ``get`` or RPC ``GetTrace`` - method using the ID of each listed trace. - """ - - VIEW_TYPE_UNSPECIFIED = 0 - MINIMAL = 1 - ROOTSPAN = 2 - COMPLETE = 3 - - -class TraceSpan(object): - class SpanKind(enum.IntEnum): - """ - Type of span. Can be used to specify additional relationships between spans - in addition to a parent/child relationship. - - Attributes: - SPAN_KIND_UNSPECIFIED (int): Unspecified. - RPC_SERVER (int): Indicates that the span covers server-side handling of an RPC or other - remote network request. - RPC_CLIENT (int): Indicates that the span covers the client-side wrapper around an RPC or - other remote request. - """ - - SPAN_KIND_UNSPECIFIED = 0 - RPC_SERVER = 1 - RPC_CLIENT = 2 diff --git a/trace/google/cloud/trace_v1/gapic/trace_service_client.py b/trace/google/cloud/trace_v1/gapic/trace_service_client.py deleted file mode 100644 index 96799342c43a..000000000000 --- a/trace/google/cloud/trace_v1/gapic/trace_service_client.py +++ /dev/null @@ -1,503 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.devtools.cloudtrace.v1 TraceService API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.page_iterator -import grpc - -from google.cloud.trace_v1.gapic import enums -from google.cloud.trace_v1.gapic import trace_service_client_config -from google.cloud.trace_v1.gapic.transports import trace_service_grpc_transport -from google.cloud.trace_v1.proto import trace_pb2 -from google.cloud.trace_v1.proto import trace_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-trace",).version - - -class TraceServiceClient(object): - """ - This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. Spans for a single trace - may span multiple services. - """ - - SERVICE_ADDRESS = "cloudtrace.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.devtools.cloudtrace.v1.TraceService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TraceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TraceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.TraceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = trace_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=trace_service_grpc_transport.TraceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = trace_service_grpc_transport.TraceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials, - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME], - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def list_traces( - self, - project_id, - view=None, - page_size=None, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Returns of a list of traces that match the specified filter conditions. - - Example: - >>> from google.cloud import trace_v1 - >>> - >>> client = trace_v1.TraceServiceClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # Iterate over all results - >>> for element in client.list_traces(project_id): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_traces(project_id).pages: - ... for element in page: - ... # process element - ... pass - - Args: - project_id (str): Required. ID of the Cloud project where the trace data is stored. - view (~google.cloud.trace_v1.types.ViewType): Optional. Type of data returned for traces in the list. Default is - ``MINIMAL``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - start_time (Union[dict, ~google.cloud.trace_v1.types.Timestamp]): Start of the time interval (inclusive) during which the trace data was - collected from the application. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v1.types.Timestamp` - end_time (Union[dict, ~google.cloud.trace_v1.types.Timestamp]): End of the time interval (inclusive) during which the trace data was - collected from the application. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v1.types.Timestamp` - filter_ (str): Optional. A filter against labels for the request. - - By default, searches use prefix matching. To specify exact match, - prepend a plus symbol (``+``) to the search term. Multiple terms are - ANDed. Syntax: - - - ``root:NAME_PREFIX`` or ``NAME_PREFIX``: Return traces where any root - span starts with ``NAME_PREFIX``. - - ``+root:NAME`` or ``+NAME``: Return traces where any root span's name - is exactly ``NAME``. - - ``span:NAME_PREFIX``: Return traces where any span starts with - ``NAME_PREFIX``. - - ``+span:NAME``: Return traces where any span's name is exactly - ``NAME``. - - ``latency:DURATION``: Return traces whose overall latency is greater - or equal to than ``DURATION``. Accepted units are nanoseconds - (``ns``), milliseconds (``ms``), and seconds (``s``). Default is - ``ms``. For example, ``latency:24ms`` returns traces whose overall - latency is greater than or equal to 24 milliseconds. - - ``label:LABEL_KEY``: Return all traces containing the specified label - key (exact match, case-sensitive) regardless of the key:value pair's - value (including empty values). - - ``LABEL_KEY:VALUE_PREFIX``: Return all traces containing the - specified label key (exact match, case-sensitive) whose value starts - with ``VALUE_PREFIX``. Both a key and a value must be specified. - - ``+LABEL_KEY:VALUE``: Return all traces containing a key:value pair - exactly matching the specified text. Both a key and a value must be - specified. - - ``method:VALUE``: Equivalent to ``/http/method:VALUE``. - - ``url:VALUE``: Equivalent to ``/http/url:VALUE``. - order_by (str): Optional. Field used to sort the returned traces. Can be one of the - following: - - - ``trace_id`` - - ``name`` (``name`` field of root span in the trace) - - ``duration`` (difference between ``end_time`` and ``start_time`` - fields of the root span) - - ``start`` (``start_time`` field of the root span) - - Descending order can be specified by appending ``desc`` to the sort - field (for example, ``name desc``). - - Only one sort field is permitted. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.trace_v1.types.Trace` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_traces" not in self._inner_api_calls: - self._inner_api_calls[ - "list_traces" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_traces, - default_retry=self._method_configs["ListTraces"].retry, - default_timeout=self._method_configs["ListTraces"].timeout, - client_info=self._client_info, - ) - - request = trace_pb2.ListTracesRequest( - project_id=project_id, - view=view, - page_size=page_size, - start_time=start_time, - end_time=end_time, - filter=filter_, - order_by=order_by, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_traces"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="traces", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_trace( - self, - project_id, - trace_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets a single trace by its ID. - - Example: - >>> from google.cloud import trace_v1 - >>> - >>> client = trace_v1.TraceServiceClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `trace_id`: - >>> trace_id = '' - >>> - >>> response = client.get_trace(project_id, trace_id) - - Args: - project_id (str): Required. ID of the Cloud project where the trace data is stored. - trace_id (str): Required. ID of the trace to return. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.trace_v1.types.Trace` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_trace" not in self._inner_api_calls: - self._inner_api_calls[ - "get_trace" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_trace, - default_retry=self._method_configs["GetTrace"].retry, - default_timeout=self._method_configs["GetTrace"].timeout, - client_info=self._client_info, - ) - - request = trace_pb2.GetTraceRequest(project_id=project_id, trace_id=trace_id,) - return self._inner_api_calls["get_trace"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def patch_traces( - self, - project_id, - traces, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sends new traces to Stackdriver Trace or updates existing traces. If the ID - of a trace that you send matches that of an existing trace, any fields - in the existing trace and its spans are overwritten by the provided values, - and any new fields provided are merged with the existing trace data. If the - ID does not match, a new trace is created. - - Example: - >>> from google.cloud import trace_v1 - >>> - >>> client = trace_v1.TraceServiceClient() - >>> - >>> # TODO: Initialize `project_id`: - >>> project_id = '' - >>> - >>> # TODO: Initialize `traces`: - >>> traces = {} - >>> - >>> client.patch_traces(project_id, traces) - - Args: - project_id (str): Required. ID of the Cloud project where the trace data is stored. - traces (Union[dict, ~google.cloud.trace_v1.types.Traces]): Required. The body of the message. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v1.types.Traces` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "patch_traces" not in self._inner_api_calls: - self._inner_api_calls[ - "patch_traces" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.patch_traces, - default_retry=self._method_configs["PatchTraces"].retry, - default_timeout=self._method_configs["PatchTraces"].timeout, - client_info=self._client_info, - ) - - request = trace_pb2.PatchTracesRequest(project_id=project_id, traces=traces,) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("project_id", project_id)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["patch_traces"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/trace/google/cloud/trace_v1/gapic/trace_service_client_config.py b/trace/google/cloud/trace_v1/gapic/trace_service_client_config.py deleted file mode 100644 index 023c8e66c788..000000000000 --- a/trace/google/cloud/trace_v1/gapic/trace_service_client_config.py +++ /dev/null @@ -1,38 +0,0 @@ -config = { - "interfaces": { - "google.devtools.cloudtrace.v1.TraceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "ListTraces": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetTrace": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "PatchTraces": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/trace/google/cloud/trace_v1/gapic/transports/__init__.py b/trace/google/cloud/trace_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v1/gapic/transports/trace_service_grpc_transport.py b/trace/google/cloud/trace_v1/gapic/transports/trace_service_grpc_transport.py deleted file mode 100644 index 9359bbc2171f..000000000000 --- a/trace/google/cloud/trace_v1/gapic/transports/trace_service_grpc_transport.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.trace_v1.proto import trace_pb2_grpc - - -class TraceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.devtools.cloudtrace.v1 TraceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append", - "https://www.googleapis.com/auth/trace.readonly", - ) - - def __init__( - self, channel=None, credentials=None, address="cloudtrace.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive.", - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "trace_service_stub": trace_pb2_grpc.TraceServiceStub(channel), - } - - @classmethod - def create_channel( - cls, address="cloudtrace.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def list_traces(self): - """Return the gRPC stub for :meth:`TraceServiceClient.list_traces`. - - Returns of a list of traces that match the specified filter conditions. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["trace_service_stub"].ListTraces - - @property - def get_trace(self): - """Return the gRPC stub for :meth:`TraceServiceClient.get_trace`. - - Gets a single trace by its ID. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["trace_service_stub"].GetTrace - - @property - def patch_traces(self): - """Return the gRPC stub for :meth:`TraceServiceClient.patch_traces`. - - Sends new traces to Stackdriver Trace or updates existing traces. If the ID - of a trace that you send matches that of an existing trace, any fields - in the existing trace and its spans are overwritten by the provided values, - and any new fields provided are merged with the existing trace data. If the - ID does not match, a new trace is created. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["trace_service_stub"].PatchTraces diff --git a/trace/google/cloud/trace_v1/proto/__init__.py b/trace/google/cloud/trace_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v1/proto/trace.proto b/trace/google/cloud/trace_v1/proto/trace.proto deleted file mode 100644 index 00cc14db309e..000000000000 --- a/trace/google/cloud/trace_v1/proto/trace.proto +++ /dev/null @@ -1,304 +0,0 @@ -// Copyright 2019 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 -// -// http://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. - -syntax = "proto3"; - -package google.devtools.cloudtrace.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Trace.V1"; -option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v1;cloudtrace"; -option java_multiple_files = true; -option java_outer_classname = "TraceProto"; -option java_package = "com.google.devtools.cloudtrace.v1"; -option php_namespace = "Google\\Cloud\\Trace\\V1"; - -// This file describes an API for collecting and viewing traces and spans -// within a trace. A Trace is a collection of spans corresponding to a single -// operation or set of operations for an application. A span is an individual -// timed event which forms a node of the trace tree. Spans for a single trace -// may span multiple services. -service TraceService { - option (google.api.default_host) = "cloudtrace.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/trace.append," - "https://www.googleapis.com/auth/trace.readonly"; - - // Returns of a list of traces that match the specified filter conditions. - rpc ListTraces(ListTracesRequest) returns (ListTracesResponse) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/traces" - }; - option (google.api.method_signature) = "project_id"; - } - - // Gets a single trace by its ID. - rpc GetTrace(GetTraceRequest) returns (Trace) { - option (google.api.http) = { - get: "/v1/projects/{project_id}/traces/{trace_id}" - }; - option (google.api.method_signature) = "project_id,trace_id"; - } - - // Sends new traces to Stackdriver Trace or updates existing traces. If the ID - // of a trace that you send matches that of an existing trace, any fields - // in the existing trace and its spans are overwritten by the provided values, - // and any new fields provided are merged with the existing trace data. If the - // ID does not match, a new trace is created. - rpc PatchTraces(PatchTracesRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - patch: "/v1/projects/{project_id}/traces" - body: "traces" - }; - option (google.api.method_signature) = "project_id,traces"; - } -} - -// A trace describes how long it takes for an application to perform an -// operation. It consists of a set of spans, each of which represent a single -// timed event within the operation. -message Trace { - // Project ID of the Cloud project where the trace data is stored. - string project_id = 1; - - // Globally unique identifier for the trace. This identifier is a 128-bit - // numeric value formatted as a 32-byte hex string. For example, - // `382d4f4c6b7bb2f4a972559d9085001d`. - string trace_id = 2; - - // Collection of spans in the trace. - repeated TraceSpan spans = 3; -} - -// List of new or updated traces. -message Traces { - // List of traces. - repeated Trace traces = 1; -} - -// A span represents a single timed event within a trace. Spans can be nested -// and form a trace tree. Often, a trace contains a root span that describes the -// end-to-end latency of an operation and, optionally, one or more subspans for -// its suboperations. Spans do not need to be contiguous. There may be gaps -// between spans in a trace. -message TraceSpan { - // Type of span. Can be used to specify additional relationships between spans - // in addition to a parent/child relationship. - enum SpanKind { - // Unspecified. - SPAN_KIND_UNSPECIFIED = 0; - - // Indicates that the span covers server-side handling of an RPC or other - // remote network request. - RPC_SERVER = 1; - - // Indicates that the span covers the client-side wrapper around an RPC or - // other remote request. - RPC_CLIENT = 2; - } - - // Identifier for the span. Must be a 64-bit integer other than 0 and - // unique within a trace. For example, `2205310701640571284`. - fixed64 span_id = 1; - - // Distinguishes between spans generated in a particular context. For example, - // two spans with the same name may be distinguished using `RPC_CLIENT` - // and `RPC_SERVER` to identify queueing latency associated with the span. - SpanKind kind = 2; - - // Name of the span. Must be less than 128 bytes. The span name is sanitized - // and displayed in the Stackdriver Trace tool in the - // Google Cloud Platform Console. - // The name may be a method name or some other per-call site name. - // For the same executable and the same call point, a best practice is - // to use a consistent name, which makes it easier to correlate - // cross-trace spans. - string name = 3; - - // Start time of the span in nanoseconds from the UNIX epoch. - google.protobuf.Timestamp start_time = 4; - - // End time of the span in nanoseconds from the UNIX epoch. - google.protobuf.Timestamp end_time = 5; - - // Optional. ID of the parent span, if any. - fixed64 parent_span_id = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Collection of labels associated with the span. Label keys must be less than - // 128 bytes. Label values must be less than 16 kilobytes (10MB for - // `/stacktrace` values). - // - // Some predefined label keys exist, or you may create your own. When creating - // your own, we recommend the following formats: - // - // * `/category/product/key` for agents of well-known products (e.g. - // `/db/mongodb/read_size`). - // * `short_host/path/key` for domain-specific keys (e.g. - // `foo.com/myproduct/bar`) - // - // Predefined labels include: - // - // * `/agent` - // * `/component` - // * `/error/message` - // * `/error/name` - // * `/http/client_city` - // * `/http/client_country` - // * `/http/client_protocol` - // * `/http/client_region` - // * `/http/host` - // * `/http/method` - // * `/http/path` - // * `/http/redirected_url` - // * `/http/request/size` - // * `/http/response/size` - // * `/http/route` - // * `/http/status_code` - // * `/http/url` - // * `/http/user_agent` - // * `/pid` - // * `/stacktrace` - // * `/tid` - map labels = 7; -} - -// The request message for the `ListTraces` method. All fields are required -// unless specified. -message ListTracesRequest { - // Type of data returned for traces in the list. - enum ViewType { - // Default is `MINIMAL` if unspecified. - VIEW_TYPE_UNSPECIFIED = 0; - - // Minimal view of the trace record that contains only the project - // and trace IDs. - MINIMAL = 1; - - // Root span view of the trace record that returns the root spans along - // with the minimal trace data. - ROOTSPAN = 2; - - // Complete view of the trace record that contains the actual trace data. - // This is equivalent to calling the REST `get` or RPC `GetTrace` method - // using the ID of each listed trace. - COMPLETE = 3; - } - - // Required. ID of the Cloud project where the trace data is stored. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Type of data returned for traces in the list. Default is - // `MINIMAL`. - ViewType view = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Maximum number of traces to return. If not specified or <= 0, the - // implementation selects a reasonable value. The implementation may - // return fewer traces than the requested page size. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Token identifying the page of results to return. If provided, use the - // value of the `next_page_token` field from a previous request. - string page_token = 4; - - // Start of the time interval (inclusive) during which the trace data was - // collected from the application. - google.protobuf.Timestamp start_time = 5; - - // End of the time interval (inclusive) during which the trace data was - // collected from the application. - google.protobuf.Timestamp end_time = 6; - - // Optional. A filter against labels for the request. - // - // By default, searches use prefix matching. To specify exact match, prepend - // a plus symbol (`+`) to the search term. - // Multiple terms are ANDed. Syntax: - // - // * `root:NAME_PREFIX` or `NAME_PREFIX`: Return traces where any root - // span starts with `NAME_PREFIX`. - // * `+root:NAME` or `+NAME`: Return traces where any root span's name is - // exactly `NAME`. - // * `span:NAME_PREFIX`: Return traces where any span starts with - // `NAME_PREFIX`. - // * `+span:NAME`: Return traces where any span's name is exactly - // `NAME`. - // * `latency:DURATION`: Return traces whose overall latency is - // greater or equal to than `DURATION`. Accepted units are nanoseconds - // (`ns`), milliseconds (`ms`), and seconds (`s`). Default is `ms`. For - // example, `latency:24ms` returns traces whose overall latency - // is greater than or equal to 24 milliseconds. - // * `label:LABEL_KEY`: Return all traces containing the specified - // label key (exact match, case-sensitive) regardless of the key:value - // pair's value (including empty values). - // * `LABEL_KEY:VALUE_PREFIX`: Return all traces containing the specified - // label key (exact match, case-sensitive) whose value starts with - // `VALUE_PREFIX`. Both a key and a value must be specified. - // * `+LABEL_KEY:VALUE`: Return all traces containing a key:value pair - // exactly matching the specified text. Both a key and a value must be - // specified. - // * `method:VALUE`: Equivalent to `/http/method:VALUE`. - // * `url:VALUE`: Equivalent to `/http/url:VALUE`. - string filter = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field used to sort the returned traces. - // Can be one of the following: - // - // * `trace_id` - // * `name` (`name` field of root span in the trace) - // * `duration` (difference between `end_time` and `start_time` fields of - // the root span) - // * `start` (`start_time` field of the root span) - // - // Descending order can be specified by appending `desc` to the sort field - // (for example, `name desc`). - // - // Only one sort field is permitted. - string order_by = 8 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for the `ListTraces` method. -message ListTracesResponse { - // List of trace records as specified by the view parameter. - repeated Trace traces = 1; - - // If defined, indicates that there are more traces that match the request - // and that this value should be passed to the next request to continue - // retrieving additional traces. - string next_page_token = 2; -} - -// The request message for the `GetTrace` method. -message GetTraceRequest { - // Required. ID of the Cloud project where the trace data is stored. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. ID of the trace to return. - string trace_id = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// The request message for the `PatchTraces` method. -message PatchTracesRequest { - // Required. ID of the Cloud project where the trace data is stored. - string project_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The body of the message. - Traces traces = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/trace/google/cloud/trace_v1/proto/trace_pb2.py b/trace/google/cloud/trace_v1/proto/trace_pb2.py deleted file mode 100644 index 7963c9f71677..000000000000 --- a/trace/google/cloud/trace_v1/proto/trace_pb2.py +++ /dev/null @@ -1,1108 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace_v1/proto/trace.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/devtools/cloudtrace_v1/proto/trace.proto", - package="google.devtools.cloudtrace.v1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.devtools.cloudtrace.v1B\nTraceProtoP\001ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v1;cloudtrace\252\002\025Google.Cloud.Trace.V1\312\002\025Google\\Cloud\\Trace\\V1" - ), - serialized_pb=_b( - '\n/google/devtools/cloudtrace_v1/proto/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto"f\n\x05Trace\x12\x12\n\nproject_id\x18\x01 \x01(\t\x12\x10\n\x08trace_id\x18\x02 \x01(\t\x12\x37\n\x05spans\x18\x03 \x03(\x0b\x32(.google.devtools.cloudtrace.v1.TraceSpan">\n\x06Traces\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace"\xa2\x03\n\tTraceSpan\x12\x0f\n\x07span_id\x18\x01 \x01(\x06\x12?\n\x04kind\x18\x02 \x01(\x0e\x32\x31.google.devtools.cloudtrace.v1.TraceSpan.SpanKind\x12\x0c\n\x04name\x18\x03 \x01(\t\x12.\n\nstart_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x0eparent_span_id\x18\x06 \x01(\x06\x42\x03\xe0\x41\x01\x12\x44\n\x06labels\x18\x07 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01"E\n\x08SpanKind\x12\x19\n\x15SPAN_KIND_UNSPECIFIED\x10\x00\x12\x0e\n\nRPC_SERVER\x10\x01\x12\x0e\n\nRPC_CLIENT\x10\x02"\x80\x03\n\x11ListTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12L\n\x04view\x18\x02 \x01(\x0e\x32\x39.google.devtools.cloudtrace.v1.ListTracesRequest.ViewTypeB\x03\xe0\x41\x01\x12\x16\n\tpage_size\x18\x03 \x01(\x05\x42\x03\xe0\x41\x01\x12\x12\n\npage_token\x18\x04 \x01(\t\x12.\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x06\x66ilter\x18\x07 \x01(\tB\x03\xe0\x41\x01\x12\x15\n\x08order_by\x18\x08 \x01(\tB\x03\xe0\x41\x01"N\n\x08ViewType\x12\x19\n\x15VIEW_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07MINIMAL\x10\x01\x12\x0c\n\x08ROOTSPAN\x10\x02\x12\x0c\n\x08\x43OMPLETE\x10\x03"c\n\x12ListTracesResponse\x12\x34\n\x06traces\x18\x01 \x03(\x0b\x32$.google.devtools.cloudtrace.v1.Trace\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"A\n\x0fGetTraceRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x15\n\x08trace_id\x18\x02 \x01(\tB\x03\xe0\x41\x02"i\n\x12PatchTracesRequest\x12\x17\n\nproject_id\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12:\n\x06traces\x18\x02 \x01(\x0b\x32%.google.devtools.cloudtrace.v1.TracesB\x03\xe0\x41\x02\x32\xb5\x05\n\x0cTraceService\x12\xa8\x01\n\nListTraces\x12\x30.google.devtools.cloudtrace.v1.ListTracesRequest\x1a\x31.google.devtools.cloudtrace.v1.ListTracesResponse"5\x82\xd3\xe4\x93\x02"\x12 /v1/projects/{project_id}/traces\xda\x41\nproject_id\x12\xab\x01\n\x08GetTrace\x12..google.devtools.cloudtrace.v1.GetTraceRequest\x1a$.google.devtools.cloudtrace.v1.Trace"I\x82\xd3\xe4\x93\x02-\x12+/v1/projects/{project_id}/traces/{trace_id}\xda\x41\x13project_id,trace_id\x12\x9e\x01\n\x0bPatchTraces\x12\x31.google.devtools.cloudtrace.v1.PatchTracesRequest\x1a\x16.google.protobuf.Empty"D\x82\xd3\xe4\x93\x02*2 /v1/projects/{project_id}/traces:\x06traces\xda\x41\x11project_id,traces\x1a\xaa\x01\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41\x8a\x01https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/trace.readonlyB\xaa\x01\n!com.google.devtools.cloudtrace.v1B\nTraceProtoP\x01ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v1;cloudtrace\xaa\x02\x15Google.Cloud.Trace.V1\xca\x02\x15Google\\Cloud\\Trace\\V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_TRACESPAN_SPANKIND = _descriptor.EnumDescriptor( - name="SpanKind", - full_name="google.devtools.cloudtrace.v1.TraceSpan.SpanKind", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="SPAN_KIND_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RPC_SERVER", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RPC_CLIENT", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=777, - serialized_end=846, -) -_sym_db.RegisterEnumDescriptor(_TRACESPAN_SPANKIND) - -_LISTTRACESREQUEST_VIEWTYPE = _descriptor.EnumDescriptor( - name="ViewType", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.ViewType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="VIEW_TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MINIMAL", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="ROOTSPAN", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="COMPLETE", index=3, number=3, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1155, - serialized_end=1233, -) -_sym_db.RegisterEnumDescriptor(_LISTTRACESREQUEST_VIEWTYPE) - - -_TRACE = _descriptor.Descriptor( - name="Trace", - full_name="google.devtools.cloudtrace.v1.Trace", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudtrace.v1.Trace.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trace_id", - full_name="google.devtools.cloudtrace.v1.Trace.trace_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spans", - full_name="google.devtools.cloudtrace.v1.Trace.spans", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=259, - serialized_end=361, -) - - -_TRACES = _descriptor.Descriptor( - name="Traces", - full_name="google.devtools.cloudtrace.v1.Traces", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="traces", - full_name="google.devtools.cloudtrace.v1.Traces.traces", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=363, - serialized_end=425, -) - - -_TRACESPAN_LABELSENTRY = _descriptor.Descriptor( - name="LabelsEntry", - full_name="google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=730, - serialized_end=775, -) - -_TRACESPAN = _descriptor.Descriptor( - name="TraceSpan", - full_name="google.devtools.cloudtrace.v1.TraceSpan", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="span_id", - full_name="google.devtools.cloudtrace.v1.TraceSpan.span_id", - index=0, - number=1, - type=6, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="kind", - full_name="google.devtools.cloudtrace.v1.TraceSpan.kind", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudtrace.v1.TraceSpan.name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.devtools.cloudtrace.v1.TraceSpan.start_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.devtools.cloudtrace.v1.TraceSpan.end_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent_span_id", - full_name="google.devtools.cloudtrace.v1.TraceSpan.parent_span_id", - index=5, - number=6, - type=6, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="labels", - full_name="google.devtools.cloudtrace.v1.TraceSpan.labels", - index=6, - number=7, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_TRACESPAN_LABELSENTRY,], - enum_types=[_TRACESPAN_SPANKIND,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=428, - serialized_end=846, -) - - -_LISTTRACESREQUEST = _descriptor.Descriptor( - name="ListTracesRequest", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="view", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.view", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.page_size", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.page_token", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.start_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.end_time", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.filter", - index=6, - number=7, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="order_by", - full_name="google.devtools.cloudtrace.v1.ListTracesRequest.order_by", - index=7, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_LISTTRACESREQUEST_VIEWTYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=849, - serialized_end=1233, -) - - -_LISTTRACESRESPONSE = _descriptor.Descriptor( - name="ListTracesResponse", - full_name="google.devtools.cloudtrace.v1.ListTracesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="traces", - full_name="google.devtools.cloudtrace.v1.ListTracesResponse.traces", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.devtools.cloudtrace.v1.ListTracesResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1235, - serialized_end=1334, -) - - -_GETTRACEREQUEST = _descriptor.Descriptor( - name="GetTraceRequest", - full_name="google.devtools.cloudtrace.v1.GetTraceRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudtrace.v1.GetTraceRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="trace_id", - full_name="google.devtools.cloudtrace.v1.GetTraceRequest.trace_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1336, - serialized_end=1401, -) - - -_PATCHTRACESREQUEST = _descriptor.Descriptor( - name="PatchTracesRequest", - full_name="google.devtools.cloudtrace.v1.PatchTracesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="project_id", - full_name="google.devtools.cloudtrace.v1.PatchTracesRequest.project_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="traces", - full_name="google.devtools.cloudtrace.v1.PatchTracesRequest.traces", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1403, - serialized_end=1508, -) - -_TRACE.fields_by_name["spans"].message_type = _TRACESPAN -_TRACES.fields_by_name["traces"].message_type = _TRACE -_TRACESPAN_LABELSENTRY.containing_type = _TRACESPAN -_TRACESPAN.fields_by_name["kind"].enum_type = _TRACESPAN_SPANKIND -_TRACESPAN.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TRACESPAN.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_TRACESPAN.fields_by_name["labels"].message_type = _TRACESPAN_LABELSENTRY -_TRACESPAN_SPANKIND.containing_type = _TRACESPAN -_LISTTRACESREQUEST.fields_by_name["view"].enum_type = _LISTTRACESREQUEST_VIEWTYPE -_LISTTRACESREQUEST.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LISTTRACESREQUEST.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_LISTTRACESREQUEST_VIEWTYPE.containing_type = _LISTTRACESREQUEST -_LISTTRACESRESPONSE.fields_by_name["traces"].message_type = _TRACE -_PATCHTRACESREQUEST.fields_by_name["traces"].message_type = _TRACES -DESCRIPTOR.message_types_by_name["Trace"] = _TRACE -DESCRIPTOR.message_types_by_name["Traces"] = _TRACES -DESCRIPTOR.message_types_by_name["TraceSpan"] = _TRACESPAN -DESCRIPTOR.message_types_by_name["ListTracesRequest"] = _LISTTRACESREQUEST -DESCRIPTOR.message_types_by_name["ListTracesResponse"] = _LISTTRACESRESPONSE -DESCRIPTOR.message_types_by_name["GetTraceRequest"] = _GETTRACEREQUEST -DESCRIPTOR.message_types_by_name["PatchTracesRequest"] = _PATCHTRACESREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Trace = _reflection.GeneratedProtocolMessageType( - "Trace", - (_message.Message,), - dict( - DESCRIPTOR=_TRACE, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""A trace describes how long it takes for an application to - perform an operation. It consists of a set of spans, each of which - represent a single timed event within the operation. - - - Attributes: - project_id: - Project ID of the Cloud project where the trace data is - stored. - trace_id: - Globally unique identifier for the trace. This identifier is a - 128-bit numeric value formatted as a 32-byte hex string. For - example, ``382d4f4c6b7bb2f4a972559d9085001d``. - spans: - Collection of spans in the trace. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.Trace) - ), -) -_sym_db.RegisterMessage(Trace) - -Traces = _reflection.GeneratedProtocolMessageType( - "Traces", - (_message.Message,), - dict( - DESCRIPTOR=_TRACES, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""List of new or updated traces. - - - Attributes: - traces: - List of traces. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.Traces) - ), -) -_sym_db.RegisterMessage(Traces) - -TraceSpan = _reflection.GeneratedProtocolMessageType( - "TraceSpan", - (_message.Message,), - dict( - LabelsEntry=_reflection.GeneratedProtocolMessageType( - "LabelsEntry", - (_message.Message,), - dict( - DESCRIPTOR=_TRACESPAN_LABELSENTRY, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.TraceSpan.LabelsEntry) - ), - ), - DESCRIPTOR=_TRACESPAN, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""A span represents a single timed event within a trace. - Spans can be nested and form a trace tree. Often, a trace contains a - root span that describes the end-to-end latency of an operation and, - optionally, one or more subspans for its suboperations. Spans do not - need to be contiguous. There may be gaps between spans in a trace. - - - Attributes: - span_id: - Identifier for the span. Must be a 64-bit integer other than 0 - and unique within a trace. For example, - ``2205310701640571284``. - kind: - Distinguishes between spans generated in a particular context. - For example, two spans with the same name may be distinguished - using ``RPC_CLIENT`` and ``RPC_SERVER`` to identify queueing - latency associated with the span. - name: - Name of the span. Must be less than 128 bytes. The span name - is sanitized and displayed in the Stackdriver Trace tool in - the Google Cloud Platform Console. The name may be a method - name or some other per-call site name. For the same executable - and the same call point, a best practice is to use a - consistent name, which makes it easier to correlate cross- - trace spans. - start_time: - Start time of the span in nanoseconds from the UNIX epoch. - end_time: - End time of the span in nanoseconds from the UNIX epoch. - parent_span_id: - Optional. ID of the parent span, if any. - labels: - Collection of labels associated with the span. Label keys must - be less than 128 bytes. Label values must be less than 16 - kilobytes (10MB for ``/stacktrace`` values). Some predefined - label keys exist, or you may create your own. When creating - your own, we recommend the following formats: - - ``/category/product/key`` for agents of well-known products - (e.g. ``/db/mongodb/read_size``). - - ``short_host/path/key`` for domain-specific keys (e.g. - ``foo.com/myproduct/bar``) Predefined labels include: - - ``/agent`` - ``/component`` - ``/error/message`` - - ``/error/name`` - ``/http/client_city`` - - ``/http/client_country`` - ``/http/client_protocol`` - - ``/http/client_region`` - ``/http/host`` - ``/http/method`` - - ``/http/path`` - ``/http/redirected_url`` - - ``/http/request/size`` - ``/http/response/size`` - - ``/http/route`` - ``/http/status_code`` - ``/http/url`` - - ``/http/user_agent`` - ``/pid`` - ``/stacktrace`` - - ``/tid`` - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.TraceSpan) - ), -) -_sym_db.RegisterMessage(TraceSpan) -_sym_db.RegisterMessage(TraceSpan.LabelsEntry) - -ListTracesRequest = _reflection.GeneratedProtocolMessageType( - "ListTracesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTRACESREQUEST, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""The request message for the ``ListTraces`` method. All - fields are required unless specified. - - - Attributes: - project_id: - Required. ID of the Cloud project where the trace data is - stored. - view: - Optional. Type of data returned for traces in the list. - Default is ``MINIMAL``. - page_size: - Optional. Maximum number of traces to return. If not specified - or <= 0, the implementation selects a reasonable value. The - implementation may return fewer traces than the requested page - size. - page_token: - Token identifying the page of results to return. If provided, - use the value of the ``next_page_token`` field from a previous - request. - start_time: - Start of the time interval (inclusive) during which the trace - data was collected from the application. - end_time: - End of the time interval (inclusive) during which the trace - data was collected from the application. - filter: - Optional. A filter against labels for the request. By - default, searches use prefix matching. To specify exact match, - prepend a plus symbol (``+``) to the search term. Multiple - terms are ANDed. Syntax: - ``root:NAME_PREFIX`` or - ``NAME_PREFIX``: Return traces where any root span starts - with ``NAME_PREFIX``. - ``+root:NAME`` or ``+NAME``: Return - traces where any root span's name is exactly ``NAME``. - - ``span:NAME_PREFIX``: Return traces where any span starts with - ``NAME_PREFIX``. - ``+span:NAME``: Return traces where any - span's name is exactly ``NAME``. - ``latency:DURATION``: - Return traces whose overall latency is greater or equal to - than ``DURATION``. Accepted units are nanoseconds (``ns``), - milliseconds (``ms``), and seconds (``s``). Default is - ``ms``. For example, ``latency:24ms`` returns traces whose - overall latency is greater than or equal to 24 - milliseconds. - ``label:LABEL_KEY``: Return all traces - containing the specified label key (exact match, case- - sensitive) regardless of the key:value pair's value - (including empty values). - ``LABEL_KEY:VALUE_PREFIX``: - Return all traces containing the specified label key (exact - match, case-sensitive) whose value starts with - ``VALUE_PREFIX``. Both a key and a value must be specified. - - ``+LABEL_KEY:VALUE``: Return all traces containing a key:value - pair exactly matching the specified text. Both a key and a - value must be specified. - ``method:VALUE``: Equivalent to - ``/http/method:VALUE``. - ``url:VALUE``: Equivalent to - ``/http/url:VALUE``. - order_by: - Optional. Field used to sort the returned traces. Can be one - of the following: - ``trace_id`` - ``name`` (``name`` field - of root span in the trace) - ``duration`` (difference between - ``end_time`` and ``start_time`` fields of the root span) - - ``start`` (``start_time`` field of the root span) Descending - order can be specified by appending ``desc`` to the sort field - (for example, ``name desc``). Only one sort field is - permitted. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.ListTracesRequest) - ), -) -_sym_db.RegisterMessage(ListTracesRequest) - -ListTracesResponse = _reflection.GeneratedProtocolMessageType( - "ListTracesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTTRACESRESPONSE, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""The response message for the ``ListTraces`` method. - - - Attributes: - traces: - List of trace records as specified by the view parameter. - next_page_token: - If defined, indicates that there are more traces that match - the request and that this value should be passed to the next - request to continue retrieving additional traces. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.ListTracesResponse) - ), -) -_sym_db.RegisterMessage(ListTracesResponse) - -GetTraceRequest = _reflection.GeneratedProtocolMessageType( - "GetTraceRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETTRACEREQUEST, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""The request message for the ``GetTrace`` method. - - - Attributes: - project_id: - Required. ID of the Cloud project where the trace data is - stored. - trace_id: - Required. ID of the trace to return. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.GetTraceRequest) - ), -) -_sym_db.RegisterMessage(GetTraceRequest) - -PatchTracesRequest = _reflection.GeneratedProtocolMessageType( - "PatchTracesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PATCHTRACESREQUEST, - __module__="google.devtools.cloudtrace_v1.proto.trace_pb2", - __doc__="""The request message for the ``PatchTraces`` method. - - - Attributes: - project_id: - Required. ID of the Cloud project where the trace data is - stored. - traces: - Required. The body of the message. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v1.PatchTracesRequest) - ), -) -_sym_db.RegisterMessage(PatchTracesRequest) - - -DESCRIPTOR._options = None -_TRACESPAN_LABELSENTRY._options = None -_TRACESPAN.fields_by_name["parent_span_id"]._options = None -_LISTTRACESREQUEST.fields_by_name["project_id"]._options = None -_LISTTRACESREQUEST.fields_by_name["view"]._options = None -_LISTTRACESREQUEST.fields_by_name["page_size"]._options = None -_LISTTRACESREQUEST.fields_by_name["filter"]._options = None -_LISTTRACESREQUEST.fields_by_name["order_by"]._options = None -_GETTRACEREQUEST.fields_by_name["project_id"]._options = None -_GETTRACEREQUEST.fields_by_name["trace_id"]._options = None -_PATCHTRACESREQUEST.fields_by_name["project_id"]._options = None -_PATCHTRACESREQUEST.fields_by_name["traces"]._options = None - -_TRACESERVICE = _descriptor.ServiceDescriptor( - name="TraceService", - full_name="google.devtools.cloudtrace.v1.TraceService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\031cloudtrace.googleapis.com\322A\212\001https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.append,https://www.googleapis.com/auth/trace.readonly" - ), - serialized_start=1511, - serialized_end=2204, - methods=[ - _descriptor.MethodDescriptor( - name="ListTraces", - full_name="google.devtools.cloudtrace.v1.TraceService.ListTraces", - index=0, - containing_service=None, - input_type=_LISTTRACESREQUEST, - output_type=_LISTTRACESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002"\022 /v1/projects/{project_id}/traces\332A\nproject_id' - ), - ), - _descriptor.MethodDescriptor( - name="GetTrace", - full_name="google.devtools.cloudtrace.v1.TraceService.GetTrace", - index=1, - containing_service=None, - input_type=_GETTRACEREQUEST, - output_type=_TRACE, - serialized_options=_b( - "\202\323\344\223\002-\022+/v1/projects/{project_id}/traces/{trace_id}\332A\023project_id,trace_id" - ), - ), - _descriptor.MethodDescriptor( - name="PatchTraces", - full_name="google.devtools.cloudtrace.v1.TraceService.PatchTraces", - index=2, - containing_service=None, - input_type=_PATCHTRACESREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002*2 /v1/projects/{project_id}/traces:\006traces\332A\021project_id,traces" - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TRACESERVICE) - -DESCRIPTOR.services_by_name["TraceService"] = _TRACESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/trace/google/cloud/trace_v1/proto/trace_pb2_grpc.py b/trace/google/cloud/trace_v1/proto/trace_pb2_grpc.py deleted file mode 100644 index e15c63100fd0..000000000000 --- a/trace/google/cloud/trace_v1/proto/trace_pb2_grpc.py +++ /dev/null @@ -1,96 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.trace_v1.proto import ( - trace_pb2 as google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class TraceServiceStub(object): - """This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. Spans for a single trace - may span multiple services. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.ListTraces = channel.unary_unary( - "/google.devtools.cloudtrace.v1.TraceService/ListTraces", - request_serializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.ListTracesRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.ListTracesResponse.FromString, - ) - self.GetTrace = channel.unary_unary( - "/google.devtools.cloudtrace.v1.TraceService/GetTrace", - request_serializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.GetTraceRequest.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.Trace.FromString, - ) - self.PatchTraces = channel.unary_unary( - "/google.devtools.cloudtrace.v1.TraceService/PatchTraces", - request_serializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.PatchTracesRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - - -class TraceServiceServicer(object): - """This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. Spans for a single trace - may span multiple services. - """ - - def ListTraces(self, request, context): - """Returns of a list of traces that match the specified filter conditions. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetTrace(self, request, context): - """Gets a single trace by its ID. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def PatchTraces(self, request, context): - """Sends new traces to Stackdriver Trace or updates existing traces. If the ID - of a trace that you send matches that of an existing trace, any fields - in the existing trace and its spans are overwritten by the provided values, - and any new fields provided are merged with the existing trace data. If the - ID does not match, a new trace is created. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TraceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "ListTraces": grpc.unary_unary_rpc_method_handler( - servicer.ListTraces, - request_deserializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.ListTracesRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.ListTracesResponse.SerializeToString, - ), - "GetTrace": grpc.unary_unary_rpc_method_handler( - servicer.GetTrace, - request_deserializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.GetTraceRequest.FromString, - response_serializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.Trace.SerializeToString, - ), - "PatchTraces": grpc.unary_unary_rpc_method_handler( - servicer.PatchTraces, - request_deserializer=google_dot_devtools_dot_cloudtrace__v1_dot_proto_dot_trace__pb2.PatchTracesRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.devtools.cloudtrace.v1.TraceService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/trace/google/cloud/trace_v1/proto/tracing.proto b/trace/google/cloud/trace_v1/proto/tracing.proto deleted file mode 100644 index fd4f3e027771..000000000000 --- a/trace/google/cloud/trace_v1/proto/tracing.proto +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.devtools.cloudtrace.v2; - -import "google/api/annotations.proto"; -import "google/devtools/cloudtrace/v2/trace.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Trace.V2"; -option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace"; -option java_multiple_files = true; -option java_outer_classname = "TracingProto"; -option java_package = "com.google.devtools.cloudtrace.v2"; -option php_namespace = "Google\\Cloud\\Trace\\V2"; - - -// This file describes an API for collecting and viewing traces and spans -// within a trace. A Trace is a collection of spans corresponding to a single -// operation or set of operations for an application. A span is an individual -// timed event which forms a node of the trace tree. A single trace may -// contain span(s) from multiple services. -service TraceService { - // Sends new spans to new or existing traces. You cannot update - // existing spans. - rpc BatchWriteSpans(BatchWriteSpansRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { post: "/v2/{name=projects/*}/traces:batchWrite" body: "*" }; - } - - // Creates a new span. - rpc CreateSpan(Span) returns (Span) { - option (google.api.http) = { post: "/v2/{name=projects/*/traces/*}/spans" body: "*" }; - } -} - -// The request message for the `BatchWriteSpans` method. -message BatchWriteSpansRequest { - // Required. The name of the project where the spans belong. The format is - // `projects/[PROJECT_ID]`. - string name = 1; - - // A list of new spans. The span names must not match existing - // spans, or the results are undefined. - repeated Span spans = 2; -} diff --git a/trace/google/cloud/trace_v1/types.py b/trace/google/cloud/trace_v1/types.py deleted file mode 100644 index 07c3af3b65c6..000000000000 --- a/trace/google/cloud/trace_v1/types.py +++ /dev/null @@ -1,50 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.trace_v1.proto import trace_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 - - -_shared_modules = [ - empty_pb2, - timestamp_pb2, -] - -_local_modules = [ - trace_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.trace_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/trace/google/cloud/trace_v2/__init__.py b/trace/google/cloud/trace_v2/__init__.py deleted file mode 100644 index 3b8c71c2f08f..000000000000 --- a/trace/google/cloud/trace_v2/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys -import warnings - -from google.cloud.trace_v2 import types -from google.cloud.trace_v2.gapic import enums -from google.cloud.trace_v2.gapic import trace_service_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class TraceServiceClient(trace_service_client.TraceServiceClient): - __doc__ = trace_service_client.TraceServiceClient.__doc__ - enums = enums - - -__all__ = ( - "enums", - "types", - "TraceServiceClient", -) diff --git a/trace/google/cloud/trace_v2/gapic/__init__.py b/trace/google/cloud/trace_v2/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v2/gapic/enums.py b/trace/google/cloud/trace_v2/gapic/enums.py deleted file mode 100644 index 7f811f4c1ff6..000000000000 --- a/trace/google/cloud/trace_v2/gapic/enums.py +++ /dev/null @@ -1,53 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Span(object): - class TimeEvent(object): - class MessageEvent(object): - class Type(enum.IntEnum): - """ - Indicates whether the message was sent or received. - - Attributes: - TYPE_UNSPECIFIED (int): Unknown event type. - SENT (int): Indicates a sent message. - RECEIVED (int): Indicates a received message. - """ - - TYPE_UNSPECIFIED = 0 - SENT = 1 - RECEIVED = 2 - - class Link(object): - class Type(enum.IntEnum): - """ - The relationship of the current span relative to the linked span: child, - parent, or unspecified. - - Attributes: - TYPE_UNSPECIFIED (int): The relationship of the two spans is unknown. - CHILD_LINKED_SPAN (int): The linked span is a child of the current span. - PARENT_LINKED_SPAN (int): The linked span is a parent of the current span. - """ - - TYPE_UNSPECIFIED = 0 - CHILD_LINKED_SPAN = 1 - PARENT_LINKED_SPAN = 2 diff --git a/trace/google/cloud/trace_v2/gapic/trace_service_client.py b/trace/google/cloud/trace_v2/gapic/trace_service_client.py deleted file mode 100644 index ba3400d82b05..000000000000 --- a/trace/google/cloud/trace_v2/gapic/trace_service_client.py +++ /dev/null @@ -1,464 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.devtools.cloudtrace.v2 TraceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.path_template -import grpc - -from google.cloud.trace_v2.gapic import enums -from google.cloud.trace_v2.gapic import trace_service_client_config -from google.cloud.trace_v2.gapic.transports import trace_service_grpc_transport -from google.cloud.trace_v2.proto import trace_pb2 -from google.cloud.trace_v2.proto import tracing_pb2 -from google.cloud.trace_v2.proto import tracing_pb2_grpc -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-trace",).version - - -class TraceServiceClient(object): - """ - This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. A single trace may - contain span(s) from multiple services. - """ - - SERVICE_ADDRESS = "cloudtrace.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.devtools.cloudtrace.v2.TraceService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - TraceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def project_path(cls, project): - """Return a fully-qualified project string.""" - return google.api_core.path_template.expand( - "projects/{project}", project=project, - ) - - @classmethod - def span_path(cls, project, trace, span): - """Return a fully-qualified span string.""" - return google.api_core.path_template.expand( - "projects/{project}/traces/{trace}/spans/{span}", - project=project, - trace=trace, - span=span, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.TraceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.TraceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = trace_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=trace_service_grpc_transport.TraceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = trace_service_grpc_transport.TraceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials, - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME], - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_write_spans( - self, - name, - spans, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sends new spans to new or existing traces. You cannot update - existing spans. - - Example: - >>> from google.cloud import trace_v2 - >>> - >>> client = trace_v2.TraceServiceClient() - >>> - >>> name = client.project_path('[PROJECT]') - >>> - >>> # TODO: Initialize `spans`: - >>> spans = [] - >>> - >>> client.batch_write_spans(name, spans) - - Args: - name (str): Required. The name of the project where the spans belong. The format is - ``projects/[PROJECT_ID]``. - spans (list[Union[dict, ~google.cloud.trace_v2.types.Span]]): Required. A list of new spans. The span names must not match existing - spans, or the results are undefined. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Span` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_write_spans" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_write_spans" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_write_spans, - default_retry=self._method_configs["BatchWriteSpans"].retry, - default_timeout=self._method_configs["BatchWriteSpans"].timeout, - client_info=self._client_info, - ) - - request = tracing_pb2.BatchWriteSpansRequest(name=name, spans=spans,) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["batch_write_spans"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_span( - self, - name, - span_id, - display_name, - start_time, - end_time, - parent_span_id=None, - attributes=None, - stack_trace=None, - time_events=None, - links=None, - status=None, - same_process_as_parent_span=None, - child_span_count=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates a new span. - - Example: - >>> from google.cloud import trace_v2 - >>> - >>> client = trace_v2.TraceServiceClient() - >>> - >>> name = client.span_path('[PROJECT]', '[TRACE]', '[SPAN]') - >>> - >>> # TODO: Initialize `span_id`: - >>> span_id = '' - >>> - >>> # TODO: Initialize `display_name`: - >>> display_name = {} - >>> - >>> # TODO: Initialize `start_time`: - >>> start_time = {} - >>> - >>> # TODO: Initialize `end_time`: - >>> end_time = {} - >>> - >>> response = client.create_span(name, span_id, display_name, start_time, end_time) - - Args: - name (str): The resource name of the span in the following format: - - :: - - projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] - - [TRACE\_ID] is a unique identifier for a trace within a project; it is a - 32-character hexadecimal encoding of a 16-byte array. - - [SPAN\_ID] is a unique identifier for a span within a trace; it is a - 16-character hexadecimal encoding of an 8-byte array. - span_id (str): The [SPAN\_ID] portion of the span's resource name. - display_name (Union[dict, ~google.cloud.trace_v2.types.TruncatableString]): A description of the span's operation (up to 128 bytes). - Stackdriver Trace displays the description in the - Google Cloud Platform Console. - For example, the display name can be a qualified method name or a file name - and a line number where the operation is called. A best practice is to use - the same display name within an application and at the same call point. - This makes it easier to correlate spans in different traces. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.TruncatableString` - start_time (Union[dict, ~google.cloud.trace_v2.types.Timestamp]): The start time of the span. On the client side, this is the time kept by - the local machine where the span execution starts. On the server side, this - is the time when the server's application handler starts running. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Timestamp` - end_time (Union[dict, ~google.cloud.trace_v2.types.Timestamp]): The end time of the span. On the client side, this is the time kept by - the local machine where the span execution ends. On the server side, this - is the time when the server application handler stops running. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Timestamp` - parent_span_id (str): The [SPAN\_ID] of this span's parent span. If this is a root span, then - this field must be empty. - attributes (Union[dict, ~google.cloud.trace_v2.types.Attributes]): A set of attributes on the span. You can have up to 32 attributes per - span. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Attributes` - stack_trace (Union[dict, ~google.cloud.trace_v2.types.StackTrace]): Stack trace captured at the start of the span. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.StackTrace` - time_events (Union[dict, ~google.cloud.trace_v2.types.TimeEvents]): A set of time events. You can have up to 32 annotations and 128 message - events per span. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.TimeEvents` - links (Union[dict, ~google.cloud.trace_v2.types.Links]): Links associated with the span. You can have up to 128 links per Span. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Links` - status (Union[dict, ~google.cloud.trace_v2.types.Status]): Optional. The final status for this span. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Status` - same_process_as_parent_span (Union[dict, ~google.cloud.trace_v2.types.BoolValue]): Optional. Set this parameter to indicate whether this span is in - the same process as its parent. If you do not set this parameter, - Stackdriver Trace is unable to take advantage of this helpful - information. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.BoolValue` - child_span_count (Union[dict, ~google.cloud.trace_v2.types.Int32Value]): Optional. The number of child spans that were generated while this span - was active. If set, allows implementation to detect missing child spans. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.trace_v2.types.Int32Value` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.trace_v2.types.Span` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_span" not in self._inner_api_calls: - self._inner_api_calls[ - "create_span" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_span, - default_retry=self._method_configs["CreateSpan"].retry, - default_timeout=self._method_configs["CreateSpan"].timeout, - client_info=self._client_info, - ) - - request = trace_pb2.Span( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - parent_span_id=parent_span_id, - attributes=attributes, - stack_trace=stack_trace, - time_events=time_events, - links=links, - status=status, - same_process_as_parent_span=same_process_as_parent_span, - child_span_count=child_span_count, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_span"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/trace/google/cloud/trace_v2/gapic/trace_service_client_config.py b/trace/google/cloud/trace_v2/gapic/trace_service_client_config.py deleted file mode 100644 index c785a1e475f4..000000000000 --- a/trace/google/cloud/trace_v2/gapic/trace_service_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.devtools.cloudtrace.v2.TraceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchWriteSpans": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "CreateSpan": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/trace/google/cloud/trace_v2/gapic/transports/__init__.py b/trace/google/cloud/trace_v2/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py b/trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py deleted file mode 100644 index 31953ace3579..000000000000 --- a/trace/google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py +++ /dev/null @@ -1,138 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.trace_v2.proto import tracing_pb2_grpc - - -class TraceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.devtools.cloudtrace.v2 TraceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/trace.append", - ) - - def __init__( - self, channel=None, credentials=None, address="cloudtrace.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive.", - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "trace_service_stub": tracing_pb2_grpc.TraceServiceStub(channel), - } - - @classmethod - def create_channel( - cls, address="cloudtrace.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_write_spans(self): - """Return the gRPC stub for :meth:`TraceServiceClient.batch_write_spans`. - - Sends new spans to new or existing traces. You cannot update - existing spans. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["trace_service_stub"].BatchWriteSpans - - @property - def create_span(self): - """Return the gRPC stub for :meth:`TraceServiceClient.create_span`. - - Creates a new span. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["trace_service_stub"].CreateSpan diff --git a/trace/google/cloud/trace_v2/proto/__init__.py b/trace/google/cloud/trace_v2/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/trace/google/cloud/trace_v2/proto/trace.proto b/trace/google/cloud/trace_v2/proto/trace.proto deleted file mode 100644 index f5e628329b3c..000000000000 --- a/trace/google/cloud/trace_v2/proto/trace.proto +++ /dev/null @@ -1,344 +0,0 @@ -// Copyright 2019 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 -// -// http://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. - -syntax = "proto3"; - -package google.devtools.cloudtrace.v2; - -import "google/api/annotations.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.Trace.V2"; -option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace"; -option java_multiple_files = true; -option java_outer_classname = "TraceProto"; -option java_package = "com.google.devtools.cloudtrace.v2"; -option php_namespace = "Google\\Cloud\\Trace\\V2"; - -// A span represents a single operation within a trace. Spans can be -// nested to form a trace tree. Often, a trace contains a root span -// that describes the end-to-end latency, and one or more subspans for -// its sub-operations. A trace can also contain multiple root spans, -// or none at all. Spans do not need to be contiguous—there may be -// gaps or overlaps between spans in a trace. -message Span { - option (google.api.resource) = { - type: "cloudtrace.googleapis.com/Span" - pattern: "projects/{project}/traces/{trace}/spans/{span}" - }; - - // A set of attributes, each in the format `[KEY]:[VALUE]`. - message Attributes { - // The set of attributes. Each attribute's key can be up to 128 bytes - // long. The value can be a string up to 256 bytes, a signed 64-bit integer, - // or the Boolean values `true` and `false`. For example: - // - // "/instance_id": "my-instance" - // "/http/user_agent": "" - // "/http/request_bytes": 300 - // "abc.com/myattribute": true - map attribute_map = 1; - - // The number of attributes that were discarded. Attributes can be discarded - // because their keys are too long or because there are too many attributes. - // If this value is 0 then all attributes are valid. - int32 dropped_attributes_count = 2; - } - - // A time-stamped annotation or message event in the Span. - message TimeEvent { - // Text annotation with a set of attributes. - message Annotation { - // A user-supplied message describing the event. The maximum length for - // the description is 256 bytes. - TruncatableString description = 1; - - // A set of attributes on the annotation. You can have up to 4 attributes - // per Annotation. - Attributes attributes = 2; - } - - // An event describing a message sent/received between Spans. - message MessageEvent { - // Indicates whether the message was sent or received. - enum Type { - // Unknown event type. - TYPE_UNSPECIFIED = 0; - - // Indicates a sent message. - SENT = 1; - - // Indicates a received message. - RECEIVED = 2; - } - - // Type of MessageEvent. Indicates whether the message was sent or - // received. - Type type = 1; - - // An identifier for the MessageEvent's message that can be used to match - // SENT and RECEIVED MessageEvents. It is recommended to be unique within - // a Span. - int64 id = 2; - - // The number of uncompressed bytes sent or received. - int64 uncompressed_size_bytes = 3; - - // The number of compressed bytes sent or received. If missing assumed to - // be the same size as uncompressed. - int64 compressed_size_bytes = 4; - } - - // The timestamp indicating the time the event occurred. - google.protobuf.Timestamp time = 1; - - // A `TimeEvent` can contain either an `Annotation` object or a - // `MessageEvent` object, but not both. - oneof value { - // Text annotation with a set of attributes. - Annotation annotation = 2; - - // An event describing a message sent/received between Spans. - MessageEvent message_event = 3; - } - } - - // A collection of `TimeEvent`s. A `TimeEvent` is a time-stamped annotation - // on the span, consisting of either user-supplied key:value pairs, or - // details of a message sent/received between Spans. - message TimeEvents { - // A collection of `TimeEvent`s. - repeated TimeEvent time_event = 1; - - // The number of dropped annotations in all the included time events. - // If the value is 0, then no annotations were dropped. - int32 dropped_annotations_count = 2; - - // The number of dropped message events in all the included time events. - // If the value is 0, then no message events were dropped. - int32 dropped_message_events_count = 3; - } - - // A pointer from the current span to another span in the same trace or in a - // different trace. For example, this can be used in batching operations, - // where a single batch handler processes multiple requests from different - // traces or when the handler receives a request from a different project. - message Link { - // The relationship of the current span relative to the linked span: child, - // parent, or unspecified. - enum Type { - // The relationship of the two spans is unknown. - TYPE_UNSPECIFIED = 0; - - // The linked span is a child of the current span. - CHILD_LINKED_SPAN = 1; - - // The linked span is a parent of the current span. - PARENT_LINKED_SPAN = 2; - } - - // The [TRACE_ID] for a trace within a project. - string trace_id = 1; - - // The [SPAN_ID] for a span within a trace. - string span_id = 2; - - // The relationship of the current span relative to the linked span. - Type type = 3; - - // A set of attributes on the link. You have have up to 32 attributes per - // link. - Attributes attributes = 4; - } - - // A collection of links, which are references from this span to a span - // in the same or different trace. - message Links { - // A collection of links. - repeated Link link = 1; - - // The number of dropped links after the maximum size was enforced. If - // this value is 0, then no links were dropped. - int32 dropped_links_count = 2; - } - - // The resource name of the span in the following format: - // - // projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] - // - // [TRACE_ID] is a unique identifier for a trace within a project; - // it is a 32-character hexadecimal encoding of a 16-byte array. - // - // [SPAN_ID] is a unique identifier for a span within a trace; it - // is a 16-character hexadecimal encoding of an 8-byte array. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // The [SPAN_ID] portion of the span's resource name. - string span_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // The [SPAN_ID] of this span's parent span. If this is a root span, - // then this field must be empty. - string parent_span_id = 3; - - // A description of the span's operation (up to 128 bytes). - // Stackdriver Trace displays the description in the - // Google Cloud Platform Console. - // For example, the display name can be a qualified method name or a file name - // and a line number where the operation is called. A best practice is to use - // the same display name within an application and at the same call point. - // This makes it easier to correlate spans in different traces. - TruncatableString display_name = 4 [(google.api.field_behavior) = REQUIRED]; - - // The start time of the span. On the client side, this is the time kept by - // the local machine where the span execution starts. On the server side, this - // is the time when the server's application handler starts running. - google.protobuf.Timestamp start_time = 5 - [(google.api.field_behavior) = REQUIRED]; - - // The end time of the span. On the client side, this is the time kept by - // the local machine where the span execution ends. On the server side, this - // is the time when the server application handler stops running. - google.protobuf.Timestamp end_time = 6 - [(google.api.field_behavior) = REQUIRED]; - - // A set of attributes on the span. You can have up to 32 attributes per - // span. - Attributes attributes = 7; - - // Stack trace captured at the start of the span. - StackTrace stack_trace = 8; - - // A set of time events. You can have up to 32 annotations and 128 message - // events per span. - TimeEvents time_events = 9; - - // Links associated with the span. You can have up to 128 links per Span. - Links links = 10; - - // Optional. The final status for this span. - google.rpc.Status status = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Set this parameter to indicate whether this span is in - // the same process as its parent. If you do not set this parameter, - // Stackdriver Trace is unable to take advantage of this helpful - // information. - google.protobuf.BoolValue same_process_as_parent_span = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of child spans that were generated while this span - // was active. If set, allows implementation to detect missing child spans. - google.protobuf.Int32Value child_span_count = 13 [(google.api.field_behavior) = OPTIONAL]; -} - -// The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute. -message AttributeValue { - // The type of the value. - oneof value { - // A string up to 256 bytes long. - TruncatableString string_value = 1; - - // A 64-bit signed integer. - int64 int_value = 2; - - // A Boolean value represented by `true` or `false`. - bool bool_value = 3; - } -} - -// A call stack appearing in a trace. -message StackTrace { - // Represents a single stack frame in a stack trace. - message StackFrame { - // The fully-qualified name that uniquely identifies the function or - // method that is active in this frame (up to 1024 bytes). - TruncatableString function_name = 1; - - // An un-mangled function name, if `function_name` is - // [mangled](http://www.avabodh.com/cxxin/namemangling.html). The name can - // be fully-qualified (up to 1024 bytes). - TruncatableString original_function_name = 2; - - // The name of the source file where the function call appears (up to 256 - // bytes). - TruncatableString file_name = 3; - - // The line number in `file_name` where the function call appears. - int64 line_number = 4; - - // The column number where the function call appears, if available. - // This is important in JavaScript because of its anonymous functions. - int64 column_number = 5; - - // The binary module from where the code was loaded. - Module load_module = 6; - - // The version of the deployed source code (up to 128 bytes). - TruncatableString source_version = 7; - } - - // A collection of stack frames, which can be truncated. - message StackFrames { - // Stack frames in this call stack. - repeated StackFrame frame = 1; - - // The number of stack frames that were dropped because there - // were too many stack frames. - // If this value is 0, then no stack frames were dropped. - int32 dropped_frames_count = 2; - } - - // Stack frames in this stack trace. A maximum of 128 frames are allowed. - StackFrames stack_frames = 1; - - // The hash ID is used to conserve network bandwidth for duplicate - // stack traces within a single trace. - // - // Often multiple spans will have identical stack traces. - // The first occurrence of a stack trace should contain both the - // `stackFrame` content and a value in `stackTraceHashId`. - // - // Subsequent spans within the same request can refer - // to that stack trace by only setting `stackTraceHashId`. - int64 stack_trace_hash_id = 2; -} - -// Binary module. -message Module { - // For example: main binary, kernel modules, and dynamic libraries - // such as libc.so, sharedlib.so (up to 256 bytes). - TruncatableString module = 1; - - // A unique identifier for the module, usually a hash of its - // contents (up to 128 bytes). - TruncatableString build_id = 2; -} - -// Represents a string that might be shortened to a specified length. -message TruncatableString { - // The shortened string. For example, if the original string is 500 - // bytes long and the limit of the string is 128 bytes, then - // `value` contains the first 128 bytes of the 500-byte string. - // - // Truncation always happens on a UTF8 character boundary. If there - // are multi-byte characters in the string, then the length of the - // shortened string might be less than the size limit. - string value = 1; - - // The number of bytes removed from the original string. If this - // value is 0, then the string was not shortened. - int32 truncated_byte_count = 2; -} diff --git a/trace/google/cloud/trace_v2/proto/trace_pb2.py b/trace/google/cloud/trace_v2/proto/trace_pb2.py deleted file mode 100644 index 73351c0f3458..000000000000 --- a/trace/google/cloud/trace_v2/proto/trace_pb2.py +++ /dev/null @@ -1,1926 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace_v2/proto/trace.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/devtools/cloudtrace_v2/proto/trace.proto", - package="google.devtools.cloudtrace.v2", - syntax="proto3", - serialized_options=_b( - "\n!com.google.devtools.cloudtrace.v2B\nTraceProtoP\001ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace\252\002\025Google.Cloud.Trace.V2\312\002\025Google\\Cloud\\Trace\\V2" - ), - serialized_pb=_b( - '\n/google/devtools/cloudtrace_v2/proto/trace.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x17google/rpc/status.proto"\xc2\x10\n\x04Span\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x14\n\x07span_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\x0eparent_span_id\x18\x03 \x01(\t\x12K\n\x0c\x64isplay_name\x18\x04 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringB\x03\xe0\x41\x02\x12\x33\n\nstart_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x31\n\x08\x65nd_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x02\x12\x42\n\nattributes\x18\x07 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x12>\n\x0bstack_trace\x18\x08 \x01(\x0b\x32).google.devtools.cloudtrace.v2.StackTrace\x12\x43\n\x0btime_events\x18\t \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.TimeEvents\x12\x38\n\x05links\x18\n \x01(\x0b\x32).google.devtools.cloudtrace.v2.Span.Links\x12\'\n\x06status\x18\x0b \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x01\x12\x44\n\x1bsame_process_as_parent_span\x18\x0c \x01(\x0b\x32\x1a.google.protobuf.BoolValueB\x03\xe0\x41\x01\x12:\n\x10\x63hild_span_count\x18\r \x01(\x0b\x32\x1b.google.protobuf.Int32ValueB\x03\xe0\x41\x01\x1a\xeb\x01\n\nAttributes\x12W\n\rattribute_map\x18\x01 \x03(\x0b\x32@.google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry\x12 \n\x18\x64ropped_attributes_count\x18\x02 \x01(\x05\x1a\x62\n\x11\x41ttributeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12<\n\x05value\x18\x02 \x01(\x0b\x32-.google.devtools.cloudtrace.v2.AttributeValue:\x02\x38\x01\x1a\xdf\x04\n\tTimeEvent\x12(\n\x04time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12N\n\nannotation\x18\x02 \x01(\x0b\x32\x38.google.devtools.cloudtrace.v2.Span.TimeEvent.AnnotationH\x00\x12S\n\rmessage_event\x18\x03 \x01(\x0b\x32:.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEventH\x00\x1a\x97\x01\n\nAnnotation\x12\x45\n\x0b\x64\x65scription\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\nattributes\x18\x02 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes\x1a\xdf\x01\n\x0cMessageEvent\x12M\n\x04type\x18\x01 \x01(\x0e\x32?.google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type\x12\n\n\x02id\x18\x02 \x01(\x03\x12\x1f\n\x17uncompressed_size_bytes\x18\x03 \x01(\x03\x12\x1d\n\x15\x63ompressed_size_bytes\x18\x04 \x01(\x03"4\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x08\n\x04SENT\x10\x01\x12\x0c\n\x08RECEIVED\x10\x02\x42\x07\n\x05value\x1a\x98\x01\n\nTimeEvents\x12\x41\n\ntime_event\x18\x01 \x03(\x0b\x32-.google.devtools.cloudtrace.v2.Span.TimeEvent\x12!\n\x19\x64ropped_annotations_count\x18\x02 \x01(\x05\x12$\n\x1c\x64ropped_message_events_count\x18\x03 \x01(\x05\x1a\xf7\x01\n\x04Link\x12\x10\n\x08trace_id\x18\x01 \x01(\t\x12\x0f\n\x07span_id\x18\x02 \x01(\t\x12;\n\x04type\x18\x03 \x01(\x0e\x32-.google.devtools.cloudtrace.v2.Span.Link.Type\x12\x42\n\nattributes\x18\x04 \x01(\x0b\x32..google.devtools.cloudtrace.v2.Span.Attributes"K\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43HILD_LINKED_SPAN\x10\x01\x12\x16\n\x12PARENT_LINKED_SPAN\x10\x02\x1a\\\n\x05Links\x12\x36\n\x04link\x18\x01 \x03(\x0b\x32(.google.devtools.cloudtrace.v2.Span.Link\x12\x1b\n\x13\x64ropped_links_count\x18\x02 \x01(\x05:S\xea\x41P\n\x1e\x63loudtrace.googleapis.com/Span\x12.projects/{project}/traces/{trace}/spans/{span}"\x8e\x01\n\x0e\x41ttributeValue\x12H\n\x0cstring_value\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableStringH\x00\x12\x13\n\tint_value\x18\x02 \x01(\x03H\x00\x12\x14\n\nbool_value\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value"\x89\x05\n\nStackTrace\x12K\n\x0cstack_frames\x18\x01 \x01(\x0b\x32\x35.google.devtools.cloudtrace.v2.StackTrace.StackFrames\x12\x1b\n\x13stack_trace_hash_id\x18\x02 \x01(\x03\x1a\x9e\x03\n\nStackFrame\x12G\n\rfunction_name\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12P\n\x16original_function_name\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x43\n\tfile_name\x18\x03 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x13\n\x0bline_number\x18\x04 \x01(\x03\x12\x15\n\rcolumn_number\x18\x05 \x01(\x03\x12:\n\x0bload_module\x18\x06 \x01(\x0b\x32%.google.devtools.cloudtrace.v2.Module\x12H\n\x0esource_version\x18\x07 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x1ap\n\x0bStackFrames\x12\x43\n\x05\x66rame\x18\x01 \x03(\x0b\x32\x34.google.devtools.cloudtrace.v2.StackTrace.StackFrame\x12\x1c\n\x14\x64ropped_frames_count\x18\x02 \x01(\x05"\x8e\x01\n\x06Module\x12@\n\x06module\x18\x01 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString\x12\x42\n\x08\x62uild_id\x18\x02 \x01(\x0b\x32\x30.google.devtools.cloudtrace.v2.TruncatableString"@\n\x11TruncatableString\x12\r\n\x05value\x18\x01 \x01(\t\x12\x1c\n\x14truncated_byte_count\x18\x02 \x01(\x05\x42\xaa\x01\n!com.google.devtools.cloudtrace.v2B\nTraceProtoP\x01ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_SPAN_TIMEEVENT_MESSAGEEVENT_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SENT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RECEIVED", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1732, - serialized_end=1784, -) -_sym_db.RegisterEnumDescriptor(_SPAN_TIMEEVENT_MESSAGEEVENT_TYPE) - -_SPAN_LINK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.devtools.cloudtrace.v2.Span.Link.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHILD_LINKED_SPAN", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PARENT_LINKED_SPAN", - index=2, - number=2, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2123, - serialized_end=2198, -) -_sym_db.RegisterEnumDescriptor(_SPAN_LINK_TYPE) - - -_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY = _descriptor.Descriptor( - name="AttributeMapEntry", - full_name="google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry.value", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b("8\001"), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1085, - serialized_end=1183, -) - -_SPAN_ATTRIBUTES = _descriptor.Descriptor( - name="Attributes", - full_name="google.devtools.cloudtrace.v2.Span.Attributes", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="attribute_map", - full_name="google.devtools.cloudtrace.v2.Span.Attributes.attribute_map", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dropped_attributes_count", - full_name="google.devtools.cloudtrace.v2.Span.Attributes.dropped_attributes_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=948, - serialized_end=1183, -) - -_SPAN_TIMEEVENT_ANNOTATION = _descriptor.Descriptor( - name="Annotation", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="description", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.description", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation.attributes", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1407, - serialized_end=1558, -) - -_SPAN_TIMEEVENT_MESSAGEEVENT = _descriptor.Descriptor( - name="MessageEvent", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="id", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.id", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uncompressed_size_bytes", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.uncompressed_size_bytes", - index=2, - number=3, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="compressed_size_bytes", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent.compressed_size_bytes", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SPAN_TIMEEVENT_MESSAGEEVENT_TYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1561, - serialized_end=1784, -) - -_SPAN_TIMEEVENT = _descriptor.Descriptor( - name="TimeEvent", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.annotation", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="message_event", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.message_event", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_SPAN_TIMEEVENT_ANNOTATION, _SPAN_TIMEEVENT_MESSAGEEVENT,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="value", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvent.value", - index=0, - containing_type=None, - fields=[], - ), - ], - serialized_start=1186, - serialized_end=1793, -) - -_SPAN_TIMEEVENTS = _descriptor.Descriptor( - name="TimeEvents", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvents", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_event", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvents.time_event", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dropped_annotations_count", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvents.dropped_annotations_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dropped_message_events_count", - full_name="google.devtools.cloudtrace.v2.Span.TimeEvents.dropped_message_events_count", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1796, - serialized_end=1948, -) - -_SPAN_LINK = _descriptor.Descriptor( - name="Link", - full_name="google.devtools.cloudtrace.v2.Span.Link", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="trace_id", - full_name="google.devtools.cloudtrace.v2.Span.Link.trace_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="span_id", - full_name="google.devtools.cloudtrace.v2.Span.Link.span_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="type", - full_name="google.devtools.cloudtrace.v2.Span.Link.type", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.devtools.cloudtrace.v2.Span.Link.attributes", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_SPAN_LINK_TYPE,], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1951, - serialized_end=2198, -) - -_SPAN_LINKS = _descriptor.Descriptor( - name="Links", - full_name="google.devtools.cloudtrace.v2.Span.Links", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="link", - full_name="google.devtools.cloudtrace.v2.Span.Links.link", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dropped_links_count", - full_name="google.devtools.cloudtrace.v2.Span.Links.dropped_links_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2200, - serialized_end=2292, -) - -_SPAN = _descriptor.Descriptor( - name="Span", - full_name="google.devtools.cloudtrace.v2.Span", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudtrace.v2.Span.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="span_id", - full_name="google.devtools.cloudtrace.v2.Span.span_id", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent_span_id", - full_name="google.devtools.cloudtrace.v2.Span.parent_span_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.devtools.cloudtrace.v2.Span.display_name", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.devtools.cloudtrace.v2.Span.start_time", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.devtools.cloudtrace.v2.Span.end_time", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.devtools.cloudtrace.v2.Span.attributes", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stack_trace", - full_name="google.devtools.cloudtrace.v2.Span.stack_trace", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_events", - full_name="google.devtools.cloudtrace.v2.Span.time_events", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="links", - full_name="google.devtools.cloudtrace.v2.Span.links", - index=9, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="status", - full_name="google.devtools.cloudtrace.v2.Span.status", - index=10, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="same_process_as_parent_span", - full_name="google.devtools.cloudtrace.v2.Span.same_process_as_parent_span", - index=11, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="child_span_count", - full_name="google.devtools.cloudtrace.v2.Span.child_span_count", - index=12, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _SPAN_ATTRIBUTES, - _SPAN_TIMEEVENT, - _SPAN_TIMEEVENTS, - _SPAN_LINK, - _SPAN_LINKS, - ], - enum_types=[], - serialized_options=_b( - "\352AP\n\036cloudtrace.googleapis.com/Span\022.projects/{project}/traces/{trace}/spans/{span}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=263, - serialized_end=2377, -) - - -_ATTRIBUTEVALUE = _descriptor.Descriptor( - name="AttributeValue", - full_name="google.devtools.cloudtrace.v2.AttributeValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="string_value", - full_name="google.devtools.cloudtrace.v2.AttributeValue.string_value", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="int_value", - full_name="google.devtools.cloudtrace.v2.AttributeValue.int_value", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bool_value", - full_name="google.devtools.cloudtrace.v2.AttributeValue.bool_value", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="value", - full_name="google.devtools.cloudtrace.v2.AttributeValue.value", - index=0, - containing_type=None, - fields=[], - ), - ], - serialized_start=2380, - serialized_end=2522, -) - - -_STACKTRACE_STACKFRAME = _descriptor.Descriptor( - name="StackFrame", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="function_name", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.function_name", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="original_function_name", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.original_function_name", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="file_name", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.file_name", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="line_number", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.line_number", - index=3, - number=4, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="column_number", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.column_number", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="load_module", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.load_module", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source_version", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrame.source_version", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2646, - serialized_end=3060, -) - -_STACKTRACE_STACKFRAMES = _descriptor.Descriptor( - name="StackFrames", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrames", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frame", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrames.frame", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="dropped_frames_count", - full_name="google.devtools.cloudtrace.v2.StackTrace.StackFrames.dropped_frames_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3062, - serialized_end=3174, -) - -_STACKTRACE = _descriptor.Descriptor( - name="StackTrace", - full_name="google.devtools.cloudtrace.v2.StackTrace", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="stack_frames", - full_name="google.devtools.cloudtrace.v2.StackTrace.stack_frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stack_trace_hash_id", - full_name="google.devtools.cloudtrace.v2.StackTrace.stack_trace_hash_id", - index=1, - number=2, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_STACKTRACE_STACKFRAME, _STACKTRACE_STACKFRAMES,], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2525, - serialized_end=3174, -) - - -_MODULE = _descriptor.Descriptor( - name="Module", - full_name="google.devtools.cloudtrace.v2.Module", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="module", - full_name="google.devtools.cloudtrace.v2.Module.module", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="build_id", - full_name="google.devtools.cloudtrace.v2.Module.build_id", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3177, - serialized_end=3319, -) - - -_TRUNCATABLESTRING = _descriptor.Descriptor( - name="TruncatableString", - full_name="google.devtools.cloudtrace.v2.TruncatableString", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="value", - full_name="google.devtools.cloudtrace.v2.TruncatableString.value", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="truncated_byte_count", - full_name="google.devtools.cloudtrace.v2.TruncatableString.truncated_byte_count", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3321, - serialized_end=3385, -) - -_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY.fields_by_name[ - "value" -].message_type = _ATTRIBUTEVALUE -_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY.containing_type = _SPAN_ATTRIBUTES -_SPAN_ATTRIBUTES.fields_by_name[ - "attribute_map" -].message_type = _SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY -_SPAN_ATTRIBUTES.containing_type = _SPAN -_SPAN_TIMEEVENT_ANNOTATION.fields_by_name[ - "description" -].message_type = _TRUNCATABLESTRING -_SPAN_TIMEEVENT_ANNOTATION.fields_by_name["attributes"].message_type = _SPAN_ATTRIBUTES -_SPAN_TIMEEVENT_ANNOTATION.containing_type = _SPAN_TIMEEVENT -_SPAN_TIMEEVENT_MESSAGEEVENT.fields_by_name[ - "type" -].enum_type = _SPAN_TIMEEVENT_MESSAGEEVENT_TYPE -_SPAN_TIMEEVENT_MESSAGEEVENT.containing_type = _SPAN_TIMEEVENT -_SPAN_TIMEEVENT_MESSAGEEVENT_TYPE.containing_type = _SPAN_TIMEEVENT_MESSAGEEVENT -_SPAN_TIMEEVENT.fields_by_name[ - "time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SPAN_TIMEEVENT.fields_by_name["annotation"].message_type = _SPAN_TIMEEVENT_ANNOTATION -_SPAN_TIMEEVENT.fields_by_name[ - "message_event" -].message_type = _SPAN_TIMEEVENT_MESSAGEEVENT -_SPAN_TIMEEVENT.containing_type = _SPAN -_SPAN_TIMEEVENT.oneofs_by_name["value"].fields.append( - _SPAN_TIMEEVENT.fields_by_name["annotation"] -) -_SPAN_TIMEEVENT.fields_by_name[ - "annotation" -].containing_oneof = _SPAN_TIMEEVENT.oneofs_by_name["value"] -_SPAN_TIMEEVENT.oneofs_by_name["value"].fields.append( - _SPAN_TIMEEVENT.fields_by_name["message_event"] -) -_SPAN_TIMEEVENT.fields_by_name[ - "message_event" -].containing_oneof = _SPAN_TIMEEVENT.oneofs_by_name["value"] -_SPAN_TIMEEVENTS.fields_by_name["time_event"].message_type = _SPAN_TIMEEVENT -_SPAN_TIMEEVENTS.containing_type = _SPAN -_SPAN_LINK.fields_by_name["type"].enum_type = _SPAN_LINK_TYPE -_SPAN_LINK.fields_by_name["attributes"].message_type = _SPAN_ATTRIBUTES -_SPAN_LINK.containing_type = _SPAN -_SPAN_LINK_TYPE.containing_type = _SPAN_LINK -_SPAN_LINKS.fields_by_name["link"].message_type = _SPAN_LINK -_SPAN_LINKS.containing_type = _SPAN -_SPAN.fields_by_name["display_name"].message_type = _TRUNCATABLESTRING -_SPAN.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SPAN.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_SPAN.fields_by_name["attributes"].message_type = _SPAN_ATTRIBUTES -_SPAN.fields_by_name["stack_trace"].message_type = _STACKTRACE -_SPAN.fields_by_name["time_events"].message_type = _SPAN_TIMEEVENTS -_SPAN.fields_by_name["links"].message_type = _SPAN_LINKS -_SPAN.fields_by_name["status"].message_type = google_dot_rpc_dot_status__pb2._STATUS -_SPAN.fields_by_name[ - "same_process_as_parent_span" -].message_type = google_dot_protobuf_dot_wrappers__pb2._BOOLVALUE -_SPAN.fields_by_name[ - "child_span_count" -].message_type = google_dot_protobuf_dot_wrappers__pb2._INT32VALUE -_ATTRIBUTEVALUE.fields_by_name["string_value"].message_type = _TRUNCATABLESTRING -_ATTRIBUTEVALUE.oneofs_by_name["value"].fields.append( - _ATTRIBUTEVALUE.fields_by_name["string_value"] -) -_ATTRIBUTEVALUE.fields_by_name[ - "string_value" -].containing_oneof = _ATTRIBUTEVALUE.oneofs_by_name["value"] -_ATTRIBUTEVALUE.oneofs_by_name["value"].fields.append( - _ATTRIBUTEVALUE.fields_by_name["int_value"] -) -_ATTRIBUTEVALUE.fields_by_name[ - "int_value" -].containing_oneof = _ATTRIBUTEVALUE.oneofs_by_name["value"] -_ATTRIBUTEVALUE.oneofs_by_name["value"].fields.append( - _ATTRIBUTEVALUE.fields_by_name["bool_value"] -) -_ATTRIBUTEVALUE.fields_by_name[ - "bool_value" -].containing_oneof = _ATTRIBUTEVALUE.oneofs_by_name["value"] -_STACKTRACE_STACKFRAME.fields_by_name["function_name"].message_type = _TRUNCATABLESTRING -_STACKTRACE_STACKFRAME.fields_by_name[ - "original_function_name" -].message_type = _TRUNCATABLESTRING -_STACKTRACE_STACKFRAME.fields_by_name["file_name"].message_type = _TRUNCATABLESTRING -_STACKTRACE_STACKFRAME.fields_by_name["load_module"].message_type = _MODULE -_STACKTRACE_STACKFRAME.fields_by_name[ - "source_version" -].message_type = _TRUNCATABLESTRING -_STACKTRACE_STACKFRAME.containing_type = _STACKTRACE -_STACKTRACE_STACKFRAMES.fields_by_name["frame"].message_type = _STACKTRACE_STACKFRAME -_STACKTRACE_STACKFRAMES.containing_type = _STACKTRACE -_STACKTRACE.fields_by_name["stack_frames"].message_type = _STACKTRACE_STACKFRAMES -_MODULE.fields_by_name["module"].message_type = _TRUNCATABLESTRING -_MODULE.fields_by_name["build_id"].message_type = _TRUNCATABLESTRING -DESCRIPTOR.message_types_by_name["Span"] = _SPAN -DESCRIPTOR.message_types_by_name["AttributeValue"] = _ATTRIBUTEVALUE -DESCRIPTOR.message_types_by_name["StackTrace"] = _STACKTRACE -DESCRIPTOR.message_types_by_name["Module"] = _MODULE -DESCRIPTOR.message_types_by_name["TruncatableString"] = _TRUNCATABLESTRING -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Span = _reflection.GeneratedProtocolMessageType( - "Span", - (_message.Message,), - dict( - Attributes=_reflection.GeneratedProtocolMessageType( - "Attributes", - (_message.Message,), - dict( - AttributeMapEntry=_reflection.GeneratedProtocolMessageType( - "AttributeMapEntry", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2" - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Attributes.AttributeMapEntry) - ), - ), - DESCRIPTOR=_SPAN_ATTRIBUTES, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A set of attributes, each in the format ``[KEY]:[VALUE]``. - - - Attributes: - attribute_map: - The set of attributes. Each attribute's key can be up to 128 - bytes long. The value can be a string up to 256 bytes, a - signed 64-bit integer, or the Boolean values ``true`` and - ``false``. For example: :: "/instance_id": "my-instance" - "/http/user_agent": "" "/http/request_bytes": 300 - "abc.com/myattribute": true - dropped_attributes_count: - The number of attributes that were discarded. Attributes can - be discarded because their keys are too long or because there - are too many attributes. If this value is 0 then all - attributes are valid. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Attributes) - ), - ), - TimeEvent=_reflection.GeneratedProtocolMessageType( - "TimeEvent", - (_message.Message,), - dict( - Annotation=_reflection.GeneratedProtocolMessageType( - "Annotation", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_TIMEEVENT_ANNOTATION, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""Text annotation with a set of attributes. - - - Attributes: - description: - A user-supplied message describing the event. The maximum - length for the description is 256 bytes. - attributes: - A set of attributes on the annotation. You can have up to 4 - attributes per Annotation. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.Annotation) - ), - ), - MessageEvent=_reflection.GeneratedProtocolMessageType( - "MessageEvent", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_TIMEEVENT_MESSAGEEVENT, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""An event describing a message sent/received between Spans. - - - Attributes: - type: - Type of MessageEvent. Indicates whether the message was sent - or received. - id: - An identifier for the MessageEvent's message that can be used - to match SENT and RECEIVED MessageEvents. It is recommended to - be unique within a Span. - uncompressed_size_bytes: - The number of uncompressed bytes sent or received. - compressed_size_bytes: - The number of compressed bytes sent or received. If missing - assumed to be the same size as uncompressed. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent.MessageEvent) - ), - ), - DESCRIPTOR=_SPAN_TIMEEVENT, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A time-stamped annotation or message event in the Span. - - - Attributes: - time: - The timestamp indicating the time the event occurred. - value: - A ``TimeEvent`` can contain either an ``Annotation`` object or - a ``MessageEvent`` object, but not both. - annotation: - Text annotation with a set of attributes. - message_event: - An event describing a message sent/received between Spans. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvent) - ), - ), - TimeEvents=_reflection.GeneratedProtocolMessageType( - "TimeEvents", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_TIMEEVENTS, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A collection of ``TimeEvent``\ s. A ``TimeEvent`` is a - time-stamped annotation on the span, consisting of either user-supplied - key:value pairs, or details of a message sent/received between Spans. - - - Attributes: - time_event: - A collection of ``TimeEvent``\ s. - dropped_annotations_count: - The number of dropped annotations in all the included time - events. If the value is 0, then no annotations were dropped. - dropped_message_events_count: - The number of dropped message events in all the included time - events. If the value is 0, then no message events were - dropped. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.TimeEvents) - ), - ), - Link=_reflection.GeneratedProtocolMessageType( - "Link", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_LINK, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A pointer from the current span to another span in the - same trace or in a different trace. For example, this can be used in - batching operations, where a single batch handler processes multiple - requests from different traces or when the handler receives a request - from a different project. - - - Attributes: - trace_id: - The [TRACE\_ID] for a trace within a project. - span_id: - The [SPAN\_ID] for a span within a trace. - type: - The relationship of the current span relative to the linked - span. - attributes: - A set of attributes on the link. You have have up to 32 - attributes per link. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Link) - ), - ), - Links=_reflection.GeneratedProtocolMessageType( - "Links", - (_message.Message,), - dict( - DESCRIPTOR=_SPAN_LINKS, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A collection of links, which are references from this span - to a span in the same or different trace. - - - Attributes: - link: - A collection of links. - dropped_links_count: - The number of dropped links after the maximum size was - enforced. If this value is 0, then no links were dropped. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span.Links) - ), - ), - DESCRIPTOR=_SPAN, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A span represents a single operation within a trace. Spans - can be nested to form a trace tree. Often, a trace contains a root span - that describes the end-to-end latency, and one or more subspans for its - sub-operations. A trace can also contain multiple root spans, or none at - all. Spans do not need to be contiguous—there may be gaps or overlaps - between spans in a trace. - - - Attributes: - name: - The resource name of the span in the following format: :: - projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID] - [TRACE\_ID] is a unique identifier for a trace within a - project; it is a 32-character hexadecimal encoding of a - 16-byte array. [SPAN\_ID] is a unique identifier for a span - within a trace; it is a 16-character hexadecimal encoding of - an 8-byte array. - span_id: - The [SPAN\_ID] portion of the span's resource name. - parent_span_id: - The [SPAN\_ID] of this span's parent span. If this is a root - span, then this field must be empty. - display_name: - A description of the span's operation (up to 128 bytes). - Stackdriver Trace displays the description in the Google Cloud - Platform Console. For example, the display name can be a - qualified method name or a file name and a line number where - the operation is called. A best practice is to use the same - display name within an application and at the same call point. - This makes it easier to correlate spans in different traces. - start_time: - The start time of the span. On the client side, this is the - time kept by the local machine where the span execution - starts. On the server side, this is the time when the server's - application handler starts running. - end_time: - The end time of the span. On the client side, this is the time - kept by the local machine where the span execution ends. On - the server side, this is the time when the server application - handler stops running. - attributes: - A set of attributes on the span. You can have up to 32 - attributes per span. - stack_trace: - Stack trace captured at the start of the span. - time_events: - A set of time events. You can have up to 32 annotations and - 128 message events per span. - links: - Links associated with the span. You can have up to 128 links - per Span. - status: - Optional. The final status for this span. - same_process_as_parent_span: - Optional. Set this parameter to indicate whether this span is - in the same process as its parent. If you do not set this - parameter, Stackdriver Trace is unable to take advantage of - this helpful information. - child_span_count: - Optional. The number of child spans that were generated while - this span was active. If set, allows implementation to detect - missing child spans. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Span) - ), -) -_sym_db.RegisterMessage(Span) -_sym_db.RegisterMessage(Span.Attributes) -_sym_db.RegisterMessage(Span.Attributes.AttributeMapEntry) -_sym_db.RegisterMessage(Span.TimeEvent) -_sym_db.RegisterMessage(Span.TimeEvent.Annotation) -_sym_db.RegisterMessage(Span.TimeEvent.MessageEvent) -_sym_db.RegisterMessage(Span.TimeEvents) -_sym_db.RegisterMessage(Span.Link) -_sym_db.RegisterMessage(Span.Links) - -AttributeValue = _reflection.GeneratedProtocolMessageType( - "AttributeValue", - (_message.Message,), - dict( - DESCRIPTOR=_ATTRIBUTEVALUE, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""The allowed types for [VALUE] in a ``[KEY]:[VALUE]`` - attribute. - - - Attributes: - value: - The type of the value. - string_value: - A string up to 256 bytes long. - int_value: - A 64-bit signed integer. - bool_value: - A Boolean value represented by ``true`` or ``false``. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.AttributeValue) - ), -) -_sym_db.RegisterMessage(AttributeValue) - -StackTrace = _reflection.GeneratedProtocolMessageType( - "StackTrace", - (_message.Message,), - dict( - StackFrame=_reflection.GeneratedProtocolMessageType( - "StackFrame", - (_message.Message,), - dict( - DESCRIPTOR=_STACKTRACE_STACKFRAME, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""Represents a single stack frame in a stack trace. - - - Attributes: - function_name: - The fully-qualified name that uniquely identifies the function - or method that is active in this frame (up to 1024 bytes). - original_function_name: - An un-mangled function name, if ``function_name`` is `mangled - `__. The name - can be fully-qualified (up to 1024 bytes). - file_name: - The name of the source file where the function call appears - (up to 256 bytes). - line_number: - The line number in ``file_name`` where the function call - appears. - column_number: - The column number where the function call appears, if - available. This is important in JavaScript because of its - anonymous functions. - load_module: - The binary module from where the code was loaded. - source_version: - The version of the deployed source code (up to 128 bytes). - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.StackTrace.StackFrame) - ), - ), - StackFrames=_reflection.GeneratedProtocolMessageType( - "StackFrames", - (_message.Message,), - dict( - DESCRIPTOR=_STACKTRACE_STACKFRAMES, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A collection of stack frames, which can be truncated. - - - Attributes: - frame: - Stack frames in this call stack. - dropped_frames_count: - The number of stack frames that were dropped because there - were too many stack frames. If this value is 0, then no stack - frames were dropped. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.StackTrace.StackFrames) - ), - ), - DESCRIPTOR=_STACKTRACE, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""A call stack appearing in a trace. - - - Attributes: - stack_frames: - Stack frames in this stack trace. A maximum of 128 frames are - allowed. - stack_trace_hash_id: - The hash ID is used to conserve network bandwidth for - duplicate stack traces within a single trace. Often multiple - spans will have identical stack traces. The first occurrence - of a stack trace should contain both the ``stackFrame`` - content and a value in ``stackTraceHashId``. Subsequent spans - within the same request can refer to that stack trace by only - setting ``stackTraceHashId``. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.StackTrace) - ), -) -_sym_db.RegisterMessage(StackTrace) -_sym_db.RegisterMessage(StackTrace.StackFrame) -_sym_db.RegisterMessage(StackTrace.StackFrames) - -Module = _reflection.GeneratedProtocolMessageType( - "Module", - (_message.Message,), - dict( - DESCRIPTOR=_MODULE, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""Binary module. - - - Attributes: - module: - For example: main binary, kernel modules, and dynamic - libraries such as libc.so, sharedlib.so (up to 256 bytes). - build_id: - A unique identifier for the module, usually a hash of its - contents (up to 128 bytes). - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.Module) - ), -) -_sym_db.RegisterMessage(Module) - -TruncatableString = _reflection.GeneratedProtocolMessageType( - "TruncatableString", - (_message.Message,), - dict( - DESCRIPTOR=_TRUNCATABLESTRING, - __module__="google.devtools.cloudtrace_v2.proto.trace_pb2", - __doc__="""Represents a string that might be shortened to a specified - length. - - - Attributes: - value: - The shortened string. For example, if the original string is - 500 bytes long and the limit of the string is 128 bytes, then - ``value`` contains the first 128 bytes of the 500-byte string. - Truncation always happens on a UTF8 character boundary. If - there are multi-byte characters in the string, then the length - of the shortened string might be less than the size limit. - truncated_byte_count: - The number of bytes removed from the original string. If this - value is 0, then the string was not shortened. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.TruncatableString) - ), -) -_sym_db.RegisterMessage(TruncatableString) - - -DESCRIPTOR._options = None -_SPAN_ATTRIBUTES_ATTRIBUTEMAPENTRY._options = None -_SPAN.fields_by_name["name"]._options = None -_SPAN.fields_by_name["span_id"]._options = None -_SPAN.fields_by_name["display_name"]._options = None -_SPAN.fields_by_name["start_time"]._options = None -_SPAN.fields_by_name["end_time"]._options = None -_SPAN.fields_by_name["status"]._options = None -_SPAN.fields_by_name["same_process_as_parent_span"]._options = None -_SPAN.fields_by_name["child_span_count"]._options = None -_SPAN._options = None -# @@protoc_insertion_point(module_scope) diff --git a/trace/google/cloud/trace_v2/proto/trace_pb2_grpc.py b/trace/google/cloud/trace_v2/proto/trace_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/trace/google/cloud/trace_v2/proto/trace_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/trace/google/cloud/trace_v2/proto/tracing.proto b/trace/google/cloud/trace_v2/proto/tracing.proto deleted file mode 100644 index 966a817917d9..000000000000 --- a/trace/google/cloud/trace_v2/proto/tracing.proto +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.devtools.cloudtrace.v2; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/devtools/cloudtrace/v2/trace.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.Trace.V2"; -option go_package = "google.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace"; -option java_multiple_files = true; -option java_outer_classname = "TracingProto"; -option java_package = "com.google.devtools.cloudtrace.v2"; -option php_namespace = "Google\\Cloud\\Trace\\V2"; - -// This file describes an API for collecting and viewing traces and spans -// within a trace. A Trace is a collection of spans corresponding to a single -// operation or set of operations for an application. A span is an individual -// timed event which forms a node of the trace tree. A single trace may -// contain span(s) from multiple services. -service TraceService { - option (google.api.default_host) = "cloudtrace.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/trace.append"; - - // Sends new spans to new or existing traces. You cannot update - // existing spans. - rpc BatchWriteSpans(BatchWriteSpansRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v2/{name=projects/*}/traces:batchWrite" - body: "*" - }; - option (google.api.method_signature) = "name,spans"; - } - - // Creates a new span. - rpc CreateSpan(Span) returns (Span) { - option (google.api.http) = { - post: "/v2/{name=projects/*/traces/*/spans/*}" - body: "*" - }; - } -} - -// The request message for the `BatchWriteSpans` method. -message BatchWriteSpansRequest { - // Required. The name of the project where the spans belong. The format is - // `projects/[PROJECT_ID]`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "cloudresourcemanager.googleapis.com/Project" - } - ]; - - // Required. A list of new spans. The span names must not match existing - // spans, or the results are undefined. - repeated Span spans = 2 [(google.api.field_behavior) = REQUIRED]; -} diff --git a/trace/google/cloud/trace_v2/proto/tracing_pb2.py b/trace/google/cloud/trace_v2/proto/tracing_pb2.py deleted file mode 100644 index 4bcd957e7d73..000000000000 --- a/trace/google/cloud/trace_v2/proto/tracing_pb2.py +++ /dev/null @@ -1,181 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/devtools/cloudtrace_v2/proto/tracing.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.trace_v2.proto import ( - trace_pb2 as google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/devtools/cloudtrace_v2/proto/tracing.proto", - package="google.devtools.cloudtrace.v2", - syntax="proto3", - serialized_options=_b( - "\n!com.google.devtools.cloudtrace.v2B\014TracingProtoP\001ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace\252\002\025Google.Cloud.Trace.V2\312\002\025Google\\Cloud\\Trace\\V2" - ), - serialized_pb=_b( - '\n1google/devtools/cloudtrace_v2/proto/tracing.proto\x12\x1dgoogle.devtools.cloudtrace.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a/google/devtools/cloudtrace_v2/proto/trace.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\x94\x01\n\x16\x42\x61tchWriteSpansRequest\x12\x41\n\x04name\x18\x01 \x01(\tB3\xe0\x41\x02\xfa\x41-\n+cloudresourcemanager.googleapis.com/Project\x12\x37\n\x05spans\x18\x02 \x03(\x0b\x32#.google.devtools.cloudtrace.v2.SpanB\x03\xe0\x41\x02\x32\xba\x03\n\x0cTraceService\x12\xa1\x01\n\x0f\x42\x61tchWriteSpans\x12\x35.google.devtools.cloudtrace.v2.BatchWriteSpansRequest\x1a\x16.google.protobuf.Empty"?\x82\xd3\xe4\x93\x02,"\'/v2/{name=projects/*}/traces:batchWrite:\x01*\xda\x41\nname,spans\x12\x89\x01\n\nCreateSpan\x12#.google.devtools.cloudtrace.v2.Span\x1a#.google.devtools.cloudtrace.v2.Span"1\x82\xd3\xe4\x93\x02+"&/v2/{name=projects/*/traces/*/spans/*}:\x01*\x1az\xca\x41\x19\x63loudtrace.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.appendB\xac\x01\n!com.google.devtools.cloudtrace.v2B\x0cTracingProtoP\x01ZGgoogle.golang.org/genproto/googleapis/devtools/cloudtrace/v2;cloudtrace\xaa\x02\x15Google.Cloud.Trace.V2\xca\x02\x15Google\\Cloud\\Trace\\V2b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_BATCHWRITESPANSREQUEST = _descriptor.Descriptor( - name="BatchWriteSpansRequest", - full_name="google.devtools.cloudtrace.v2.BatchWriteSpansRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.devtools.cloudtrace.v2.BatchWriteSpansRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A-\n+cloudresourcemanager.googleapis.com/Project" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spans", - full_name="google.devtools.cloudtrace.v2.BatchWriteSpansRequest.spans", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=311, - serialized_end=459, -) - -_BATCHWRITESPANSREQUEST.fields_by_name[ - "spans" -].message_type = google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2._SPAN -DESCRIPTOR.message_types_by_name["BatchWriteSpansRequest"] = _BATCHWRITESPANSREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -BatchWriteSpansRequest = _reflection.GeneratedProtocolMessageType( - "BatchWriteSpansRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHWRITESPANSREQUEST, - __module__="google.devtools.cloudtrace_v2.proto.tracing_pb2", - __doc__="""The request message for the ``BatchWriteSpans`` method. - - - Attributes: - name: - Required. The name of the project where the spans belong. The - format is ``projects/[PROJECT_ID]``. - spans: - Required. A list of new spans. The span names must not match - existing spans, or the results are undefined. - """, - # @@protoc_insertion_point(class_scope:google.devtools.cloudtrace.v2.BatchWriteSpansRequest) - ), -) -_sym_db.RegisterMessage(BatchWriteSpansRequest) - - -DESCRIPTOR._options = None -_BATCHWRITESPANSREQUEST.fields_by_name["name"]._options = None -_BATCHWRITESPANSREQUEST.fields_by_name["spans"]._options = None - -_TRACESERVICE = _descriptor.ServiceDescriptor( - name="TraceService", - full_name="google.devtools.cloudtrace.v2.TraceService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\031cloudtrace.googleapis.com\322A[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/trace.append" - ), - serialized_start=462, - serialized_end=904, - methods=[ - _descriptor.MethodDescriptor( - name="BatchWriteSpans", - full_name="google.devtools.cloudtrace.v2.TraceService.BatchWriteSpans", - index=0, - containing_service=None, - input_type=_BATCHWRITESPANSREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002,\"'/v2/{name=projects/*}/traces:batchWrite:\001*\332A\nname,spans" - ), - ), - _descriptor.MethodDescriptor( - name="CreateSpan", - full_name="google.devtools.cloudtrace.v2.TraceService.CreateSpan", - index=1, - containing_service=None, - input_type=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2._SPAN, - output_type=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2._SPAN, - serialized_options=_b( - '\202\323\344\223\002+"&/v2/{name=projects/*/traces/*/spans/*}:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_TRACESERVICE) - -DESCRIPTOR.services_by_name["TraceService"] = _TRACESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/trace/google/cloud/trace_v2/proto/tracing_pb2_grpc.py b/trace/google/cloud/trace_v2/proto/tracing_pb2_grpc.py deleted file mode 100644 index dcc08852bd85..000000000000 --- a/trace/google/cloud/trace_v2/proto/tracing_pb2_grpc.py +++ /dev/null @@ -1,79 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.trace_v2.proto import ( - trace_pb2 as google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2, -) -from google.cloud.trace_v2.proto import ( - tracing_pb2 as google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_tracing__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class TraceServiceStub(object): - """This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. A single trace may - contain span(s) from multiple services. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchWriteSpans = channel.unary_unary( - "/google.devtools.cloudtrace.v2.TraceService/BatchWriteSpans", - request_serializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_tracing__pb2.BatchWriteSpansRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateSpan = channel.unary_unary( - "/google.devtools.cloudtrace.v2.TraceService/CreateSpan", - request_serializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2.Span.SerializeToString, - response_deserializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2.Span.FromString, - ) - - -class TraceServiceServicer(object): - """This file describes an API for collecting and viewing traces and spans - within a trace. A Trace is a collection of spans corresponding to a single - operation or set of operations for an application. A span is an individual - timed event which forms a node of the trace tree. A single trace may - contain span(s) from multiple services. - """ - - def BatchWriteSpans(self, request, context): - """Sends new spans to new or existing traces. You cannot update - existing spans. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateSpan(self, request, context): - """Creates a new span. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_TraceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchWriteSpans": grpc.unary_unary_rpc_method_handler( - servicer.BatchWriteSpans, - request_deserializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_tracing__pb2.BatchWriteSpansRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateSpan": grpc.unary_unary_rpc_method_handler( - servicer.CreateSpan, - request_deserializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2.Span.FromString, - response_serializer=google_dot_devtools_dot_cloudtrace__v2_dot_proto_dot_trace__pb2.Span.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.devtools.cloudtrace.v2.TraceService", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/trace/google/cloud/trace_v2/types.py b/trace/google/cloud/trace_v2/types.py deleted file mode 100644 index ddbb681bbd0b..000000000000 --- a/trace/google/cloud/trace_v2/types.py +++ /dev/null @@ -1,58 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.trace_v2.proto import trace_pb2 -from google.cloud.trace_v2.proto import tracing_pb2 -from google.protobuf import any_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [ - any_pb2, - empty_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, -] - -_local_modules = [ - trace_pb2, - tracing_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.trace_v2.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/trace/noxfile.py b/trace/noxfile.py deleted file mode 100644 index 0f528b7f3902..000000000000 --- a/trace/noxfile.py +++ /dev/null @@ -1,160 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", "black", *LOCAL_DEPS) - session.run( - "black", - "--check", - "google", - "tests", - "docs", - ) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install("black") - session.run( - "black", - "google", - "tests", - "docs", - ) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=97", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install('-e', '.') - session.install('sphinx', 'alabaster', 'recommonmark') - - shutil.rmtree(os.path.join('docs', '_build'), ignore_errors=True) - session.run( - 'sphinx-build', - '-W', # warnings as errors - '-T', # show full traceback on exception - '-N', # no colors - '-b', 'html', - '-d', os.path.join('docs', '_build', 'doctrees', ''), - os.path.join('docs', ''), - os.path.join('docs', '_build', 'html', ''), - ) diff --git a/trace/setup.cfg b/trace/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/trace/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/trace/setup.py b/trace/setup.py deleted file mode 100644 index 015b48f9973f..000000000000 --- a/trace/setup.py +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = 'google-cloud-trace' -description = 'Stackdriver Trace API client library' -version = '0.23.0' -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = 'Development Status :: 3 - Alpha' -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - "google-cloud-core >= 1.0.3, < 2.0dev", -] -extras = { -} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, 'README.rst') -with io.open(readme_filename, encoding='utf-8') as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() - if package.startswith('google')] - -# Determine which namespaces are needed. -namespaces = ['google'] -if 'google.cloud' in packages: - namespaces.append('google.cloud') - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author='Google LLC', - author_email='googleapis-packages@google.com', - license='Apache 2.0', - url='https://github.com/GoogleCloudPlatform/google-cloud-python', - classifiers=[ - release_status, - 'Intended Audience :: Developers', - 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Programming Language :: Python :: 3.7', - 'Operating System :: OS Independent', - 'Topic :: Internet', - ], - platforms='Posix; MacOS X; Windows', - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires='>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*', - include_package_data=True, - zip_safe=False, -) diff --git a/trace/synth.metadata b/trace/synth.metadata deleted file mode 100644 index 55bc638aac4a..000000000000 --- a/trace/synth.metadata +++ /dev/null @@ -1,268 +0,0 @@ -{ - "updateTime": "2020-01-30T13:42:30.204095Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "trace", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/devtools/cloudtrace/artman_cloudtrace_v1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "trace", - "apiVersion": "v2", - "language": "python", - "generator": "gapic", - "config": "google/devtools/cloudtrace/artman_cloudtrace_v2.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "PUBLISHING.rst" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v2/api.rst" - }, - { - "path": "docs/gapic/v2/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "docs/starting.html" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/trace.py" - }, - { - "path": "google/cloud/trace/__init__.py" - }, - { - "path": "google/cloud/trace/_gapic.py" - }, - { - "path": "google/cloud/trace/client.py" - }, - { - "path": "google/cloud/trace/v1/__init__.py" - }, - { - "path": "google/cloud/trace/v1/_gapic.py" - }, - { - "path": "google/cloud/trace/v1/client.py" - }, - { - "path": "google/cloud/trace_v1/__init__.py" - }, - { - "path": "google/cloud/trace_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/trace_v1/gapic/enums.py" - }, - { - "path": "google/cloud/trace_v1/gapic/trace_service_client.py" - }, - { - "path": "google/cloud/trace_v1/gapic/trace_service_client_config.py" - }, - { - "path": "google/cloud/trace_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/trace_v1/gapic/transports/trace_service_grpc_transport.py" - }, - { - "path": "google/cloud/trace_v1/proto/__init__.py" - }, - { - "path": "google/cloud/trace_v1/proto/trace.proto" - }, - { - "path": "google/cloud/trace_v1/proto/trace_pb2.py" - }, - { - "path": "google/cloud/trace_v1/proto/trace_pb2_grpc.py" - }, - { - "path": "google/cloud/trace_v1/proto/tracing.proto" - }, - { - "path": "google/cloud/trace_v1/types.py" - }, - { - "path": "google/cloud/trace_v2/__init__.py" - }, - { - "path": "google/cloud/trace_v2/gapic/__init__.py" - }, - { - "path": "google/cloud/trace_v2/gapic/enums.py" - }, - { - "path": "google/cloud/trace_v2/gapic/trace_service_client.py" - }, - { - "path": "google/cloud/trace_v2/gapic/trace_service_client_config.py" - }, - { - "path": "google/cloud/trace_v2/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/trace_v2/gapic/transports/trace_service_grpc_transport.py" - }, - { - "path": "google/cloud/trace_v2/proto/__init__.py" - }, - { - "path": "google/cloud/trace_v2/proto/trace.proto" - }, - { - "path": "google/cloud/trace_v2/proto/trace_pb2.py" - }, - { - "path": "google/cloud/trace_v2/proto/trace_pb2_grpc.py" - }, - { - "path": "google/cloud/trace_v2/proto/tracing.proto" - }, - { - "path": "google/cloud/trace_v2/proto/tracing_pb2.py" - }, - { - "path": "google/cloud/trace_v2/proto/tracing_pb2_grpc.py" - }, - { - "path": "google/cloud/trace_v2/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/__init__.py" - }, - { - "path": "tests/system/gapic/v1/test_system_trace_service_v1.py" - }, - { - "path": "tests/system/gapic/v1/test_system_trace_service_v1_vpcsc.py" - }, - { - "path": "tests/system/gapic/v2/test_system_trace_service_v2.py" - }, - { - "path": "tests/system/gapic/v2/test_system_trace_service_v2_vpcsc.py" - }, - { - "path": "tests/unit/gapic/v1/test_trace_service_client_v1.py" - }, - { - "path": "tests/unit/gapic/v2/test_trace_service_client_v2.py" - }, - { - "path": "tests/unit/v1/test__gapic_v1.py" - }, - { - "path": "tests/unit/v1/test_client_v1.py" - }, - { - "path": "tests/unit/v2/test__gapic_v2.py" - }, - { - "path": "tests/unit/v2/test_client_v2.py" - } - ] -} \ No newline at end of file diff --git a/trace/synth.py b/trace/synth.py deleted file mode 100644 index 7e6ec0478e42..000000000000 --- a/trace/synth.py +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -import synthtool.gcp as gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() - -# ---------------------------------------------------------------------------- -# Generate trace GAPIC layer -# ---------------------------------------------------------------------------- -for version in ["v1", "v2"]: - library = gapic.py_library( - "trace", - version, - config_path=f"/google/devtools/cloudtrace" f"/artman_cloudtrace_{version}.yaml", - artman_output_name=f"trace-{version}", - include_protos=True, - ) - - s.move(library / f"google/cloud/trace_{version}") - s.move(library / f"tests/unit/gapic/{version}") - - # Fix up imports - s.replace( - "google/**/*.py", - f"from google.devtools.cloudtrace_{version}.proto import ", - f"from google.cloud.trace_{version}.proto import ", - ) - -# Copy docs configuration -s.move(library / f"docs/conf.py") - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files, excludes=["noxfile.py"]) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/trace/tests/__init__.py b/trace/tests/__init__.py deleted file mode 100644 index ab6729095248..000000000000 --- a/trace/tests/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 2017 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 -# -# http://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. diff --git a/trace/tests/system/gapic/v1/test_system_trace_service_v1.py b/trace/tests/system/gapic/v1/test_system_trace_service_v1.py deleted file mode 100644 index bfdba136f869..000000000000 --- a/trace/tests/system/gapic/v1/test_system_trace_service_v1.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 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. - -import os -import time - -from google.cloud import trace_v1 -from google.cloud.trace_v1 import enums -from google.cloud.trace_v1.proto import trace_pb2 -from google.protobuf import timestamp_pb2 - - -class TestSystemTraceService(object): - def test_list_traces(self): - project_id = os.environ["PROJECT_ID"] - - client = trace_v1.TraceServiceClient() - project_id_2 = project_id - response = client.list_traces(project_id_2) diff --git a/trace/tests/system/gapic/v1/test_system_trace_service_v1_vpcsc.py b/trace/tests/system/gapic/v1/test_system_trace_service_v1_vpcsc.py deleted file mode 100644 index 69aeaaf857f1..000000000000 --- a/trace/tests/system/gapic/v1/test_system_trace_service_v1_vpcsc.py +++ /dev/null @@ -1,72 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -# flake8: noqa - -import os -import pytest - -from google.api_core import exceptions -from google.cloud import trace_v1 -from test_utils.vpcsc_config import vpcsc_config - -_VPCSC_PROHIBITED_MESSAGE = "Request is prohibited by organization's policy." - - -@pytest.fixture -def client(): - return trace_v1.TraceServiceClient() - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_list_traces_w_inside(client): - list(client.list_traces(vpcsc_config.project_inside)) # no perms issue - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_list_traces_w_outside(client): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(client.list_traces(vpcsc_config.project_outside)) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_get_trace_w_inside(client): - with pytest.raises(exceptions.InvalidArgument): - client.get_trace(vpcsc_config.project_inside, "") # no perms issue - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_get_trace_w_outside(client): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.get_trace(vpcsc_config.project_outside, "") - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_patch_traces_w_inside(client): - with pytest.raises(exceptions.InvalidArgument): - client.patch_traces(vpcsc_config.project_inside, {}) # no perms issue - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_patch_traces_w_ouside(client): - with pytest.raises(exceptions.PermissionDenied) as exc: - client.patch_traces(vpcsc_config.project_outside, {}) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message diff --git a/trace/tests/system/gapic/v2/test_system_trace_service_v2.py b/trace/tests/system/gapic/v2/test_system_trace_service_v2.py deleted file mode 100644 index fb42ca7ba46a..000000000000 --- a/trace/tests/system/gapic/v2/test_system_trace_service_v2.py +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 2018 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. - -import os -import time - -from google.cloud import trace_v2 -from google.cloud.trace_v2.proto import trace_pb2 -from google.cloud.trace_v2.proto import tracing_pb2 - - -class TestSystemTraceService(object): - def test_batch_write_spans(self): - project_id = os.environ["PROJECT_ID"] - - client = trace_v2.TraceServiceClient() - name = client.project_path(project_id) - spans = [] - client.batch_write_spans(name, spans) diff --git a/trace/tests/system/gapic/v2/test_system_trace_service_v2_vpcsc.py b/trace/tests/system/gapic/v2/test_system_trace_service_v2_vpcsc.py deleted file mode 100644 index 19add1888a14..000000000000 --- a/trace/tests/system/gapic/v2/test_system_trace_service_v2_vpcsc.py +++ /dev/null @@ -1,47 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -# flake8: noqa - -import os -import pytest - -from google.api_core import exceptions -from google.cloud import trace_v2 -from test_utils.vpcsc_config import vpcsc_config - -_VPCSC_PROHIBITED_MESSAGE = "Request is prohibited by organization's policy." - - -@pytest.fixture -def client(): - return trace_v2.TraceServiceClient() - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_batch_write_spans_w_inside(client): - project_inside = client.project_path(vpcsc_config.project_inside) - client.batch_write_spans(project_inside, []) # no raise - - -@vpcsc_config.skip_unless_inside_vpcsc -def test_batch_write_spans_w_outside(client): - project_outside = client.project_path(vpcsc_config.project_outside) - - with pytest.raises(exceptions.PermissionDenied) as exc: - client.batch_write_spans(project_outside, []) - - assert _VPCSC_PROHIBITED_MESSAGE in exc.value.message diff --git a/trace/tests/unit/gapic/v1/test_trace_service_client_v1.py b/trace/tests/unit/gapic/v1/test_trace_service_client_v1.py deleted file mode 100644 index 5b488459ea92..000000000000 --- a/trace/tests/unit/gapic/v1/test_trace_service_client_v1.py +++ /dev/null @@ -1,183 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import trace_v1 -from google.cloud.trace_v1.proto import trace_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTraceServiceClient(object): - def test_list_traces(self): - # Setup Expected Response - next_page_token = "" - traces_element = {} - traces = [traces_element] - expected_response = {"next_page_token": next_page_token, "traces": traces} - expected_response = trace_pb2.ListTracesResponse(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup Request - project_id = "projectId-1969970175" - - paged_list_response = client.list_traces(project_id) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.traces[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = trace_pb2.ListTracesRequest(project_id=project_id) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_traces_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup request - project_id = "projectId-1969970175" - - paged_list_response = client.list_traces(project_id) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_trace(self): - # Setup Expected Response - project_id_2 = "projectId2939242356" - trace_id_2 = "traceId2987826376" - expected_response = {"project_id": project_id_2, "trace_id": trace_id_2} - expected_response = trace_pb2.Trace(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup Request - project_id = "projectId-1969970175" - trace_id = "traceId1270300245" - - response = client.get_trace(project_id, trace_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = trace_pb2.GetTraceRequest( - project_id=project_id, trace_id=trace_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_trace_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup request - project_id = "projectId-1969970175" - trace_id = "traceId1270300245" - - with pytest.raises(CustomException): - client.get_trace(project_id, trace_id) - - def test_patch_traces(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup Request - project_id = "projectId-1969970175" - traces = {} - - client.patch_traces(project_id, traces) - - assert len(channel.requests) == 1 - expected_request = trace_pb2.PatchTracesRequest( - project_id=project_id, traces=traces - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_patch_traces_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v1.TraceServiceClient() - - # Setup request - project_id = "projectId-1969970175" - traces = {} - - with pytest.raises(CustomException): - client.patch_traces(project_id, traces) diff --git a/trace/tests/unit/gapic/v2/test_trace_service_client_v2.py b/trace/tests/unit/gapic/v2/test_trace_service_client_v2.py deleted file mode 100644 index 53091b03de1a..000000000000 --- a/trace/tests/unit/gapic/v2/test_trace_service_client_v2.py +++ /dev/null @@ -1,155 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import trace_v2 -from google.cloud.trace_v2.proto import trace_pb2 -from google.cloud.trace_v2.proto import tracing_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import timestamp_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestTraceServiceClient(object): - def test_batch_write_spans(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v2.TraceServiceClient() - - # Setup Request - name = client.project_path("[PROJECT]") - spans = [] - - client.batch_write_spans(name, spans) - - assert len(channel.requests) == 1 - expected_request = tracing_pb2.BatchWriteSpansRequest(name=name, spans=spans) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_write_spans_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v2.TraceServiceClient() - - # Setup request - name = client.project_path("[PROJECT]") - spans = [] - - with pytest.raises(CustomException): - client.batch_write_spans(name, spans) - - def test_create_span(self): - # Setup Expected Response - name_2 = "name2-1052831874" - span_id_2 = "spanId2-643891741" - parent_span_id = "parentSpanId-1757797477" - expected_response = { - "name": name_2, - "span_id": span_id_2, - "parent_span_id": parent_span_id, - } - expected_response = trace_pb2.Span(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v2.TraceServiceClient() - - # Setup Request - name = client.span_path("[PROJECT]", "[TRACE]", "[SPAN]") - span_id = "spanId-2011840976" - display_name = {} - start_time = {} - end_time = {} - - response = client.create_span(name, span_id, display_name, start_time, end_time) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = trace_pb2.Span( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_span_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = trace_v2.TraceServiceClient() - - # Setup request - name = client.span_path("[PROJECT]", "[TRACE]", "[SPAN]") - span_id = "spanId-2011840976" - display_name = {} - start_time = {} - end_time = {} - - with pytest.raises(CustomException): - client.create_span(name, span_id, display_name, start_time, end_time) diff --git a/trace/tests/unit/v1/test__gapic_v1.py b/trace/tests/unit/v1/test__gapic_v1.py deleted file mode 100644 index bf9103e7abe5..000000000000 --- a/trace/tests/unit/v1/test__gapic_v1.py +++ /dev/null @@ -1,247 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -import datetime -import unittest - -import mock - - -class Test__TraceAPI(unittest.TestCase): - project = "PROJECT" - - @staticmethod - def _get_target_class(): - from google.cloud.trace.v1._gapic import _TraceAPI - - return _TraceAPI - - def _make_one(self, gapic_client=None, handwritten_client=None): - from google.cloud.trace_v1.gapic import trace_service_client - - if gapic_client is None: - gapic_client = mock.create_autospec(trace_service_client.TraceServiceClient) - if handwritten_client is None: - handwritten_client = mock.Mock() - api = self._get_target_class()(gapic_client, handwritten_client) - return api - - def test_constructor(self): - from google.cloud.trace_v1.gapic import trace_service_client - - gapic_client = mock.create_autospec(trace_service_client.TraceServiceClient) - api = self._make_one(gapic_client, mock.sentinel.client) - self.assertIs(api._gapic_api, gapic_client) - self.assertIs(api.client, mock.sentinel.client) - - def test_patch_traces(self): - from google.cloud.trace_v1.gapic import trace_service_client - from google.cloud.trace.v1._gapic import _traces_mapping_to_pb - - trace_id = "test_trace_id" - span_id = 1234 - span_name = "test_span_name" - start_time = datetime.datetime.utcnow() - end_time = datetime.datetime.utcnow() - traces = { - "traces": [ - { - "projectId": self.project, - "traceId": trace_id, - "spans": [ - { - "spanId": span_id, - "name": span_name, - "startTime": start_time.isoformat() + "Z", - "endTime": end_time.isoformat() + "Z", - } - ], - } - ] - } - traces_pb = _traces_mapping_to_pb(traces) - gapic_api = mock.create_autospec(trace_service_client.TraceServiceClient) - api = self._make_one(gapic_api, None) - - api.patch_traces(project_id=self.project, traces=traces) - - gapic_api.patch_traces.assert_called_once_with(self.project, traces_pb) - - def test_get_trace(self): - from google.cloud.trace_v1.gapic import trace_service_client - from google.cloud.trace_v1.proto.trace_pb2 import Trace - - trace_id = "test_trace_id" - trace_pb = Trace(project_id=self.project, trace_id=trace_id) - - gapic_api = mock.create_autospec(trace_service_client.TraceServiceClient) - gapic_api.get_trace.return_value = trace_pb - api = self._make_one(gapic_api, None) - - trace = api.get_trace(project_id=self.project, trace_id=trace_id) - - expected_trace = {"projectId": self.project, "traceId": trace_id} - self.assertEqual(trace, expected_trace) - - gapic_api.get_trace.assert_called_with(self.project, trace_id) - - def test_list_traces(self): - from google.api_core.page_iterator import GRPCIterator - from google.cloud.trace_v1.gapic import trace_service_client - from google.cloud.trace_v1.gapic.enums import ListTracesRequest as Enum - from google.cloud.trace.v1._gapic import _item_to_mapping - - page_size = 10 - view_type = Enum.ViewType.COMPLETE - page_token = "TOKEN" - gapic_api = mock.create_autospec(trace_service_client.TraceServiceClient) - response_iter = mock.create_autospec(GRPCIterator) - gapic_api.list_traces.return_value = response_iter - api = self._make_one(gapic_api) - - iterator = api.list_traces( - project_id=self.project, - view=view_type, - page_size=page_size, - page_token=page_token, - ) - - self.assertIs(iterator, response_iter) - self.assertIs(iterator.item_to_value, _item_to_mapping) - self.assertEqual(iterator.next_page_token, page_token) - - gapic_api.list_traces.assert_called_once_with( - project_id=self.project, - view=view_type, - page_size=page_size, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - ) - - -class _TracePbBase(object): - project = u"PROJECT" - trace_id = u"test_trace_id" - span_id = 1234 - span_name = u"test_span_name" - start_time = "2017-06-24T00:12:50.369990Z" - end_time = "2017-06-24T00:13:39.633255Z" - start_seconds = 1498263170 - start_nanos = 369990000 - end_seconds = 1498263219 - end_nanos = 633255000 - - @classmethod - def _make_trace_pb(cls): - from google.cloud.trace_v1.proto.trace_pb2 import Trace - from google.cloud.trace_v1.proto.trace_pb2 import TraceSpan - from google.protobuf.timestamp_pb2 import Timestamp - - start_time_pb = Timestamp(seconds=cls.start_seconds, nanos=cls.start_nanos) - end_time_pb = Timestamp(seconds=cls.end_seconds, nanos=cls.end_nanos) - - span_pb = TraceSpan( - span_id=cls.span_id, - name=cls.span_name, - start_time=start_time_pb, - end_time=end_time_pb, - ) - - return Trace(project_id=cls.project, trace_id=cls.trace_id, spans=[span_pb]) - - @classmethod - def _expected_json(cls): - return { - "projectId": cls.project, - "traceId": cls.trace_id, - "spans": [ - { - "spanId": str(cls.span_id), - "name": cls.span_name, - "startTime": cls.start_time, - "endTime": cls.end_time, - } - ], - } - - -class Test__item_to_mapping(unittest.TestCase, _TracePbBase): - @staticmethod - def _call_fut(*args, **kwargs): - from google.cloud.trace.v1._gapic import _item_to_mapping - - return _item_to_mapping(*args, **kwargs) - - def test_registered_type(self): - iterator = object() - trace_pb = self._make_trace_pb() - - parsed_json = self._call_fut(iterator, trace_pb) - - expected_result = self._expected_json() - self.assertEqual(parsed_json, expected_result) - - -class Test__parse_trace_pb(unittest.TestCase, _TracePbBase): - @staticmethod - def _call_fut(*args, **kwargs): - from google.cloud.trace.v1._gapic import _parse_trace_pb - - return _parse_trace_pb(*args, **kwargs) - - def test_registered_type(self): - trace_pb = self._make_trace_pb() - - parsed_json = self._call_fut(trace_pb) - - expected_result = self._expected_json() - self.assertEqual(parsed_json, expected_result) - - @mock.patch("google.cloud.trace.v1._gapic.MessageToDict", side_effect=TypeError) - def test_unregistered_type(self, msg_to_dict_mock): - trace_pb = mock.Mock(spec=["HasField"]) - trace_pb.HasField.return_value = False - with self.assertRaises(TypeError): - self._call_fut(trace_pb) - - -class Test_make_trace_api(unittest.TestCase): - def _call_fut(self, client): - from google.cloud.trace.v1._gapic import make_trace_api - - return make_trace_api(client) - - def test_it(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - client = mock.Mock(spec=["_credentials", "_client_info", "_client_options"]) - - patch_api = mock.patch( - "google.cloud.trace.v1._gapic.trace_service_client.TraceServiceClient" - ) - - with patch_api as patched: - trace_api = self._call_fut(client) - - patched.assert_called_once_with( - credentials=client._credentials, - client_info=client._client_info, - client_options=client._client_options, - ) - - self.assertIsInstance(trace_api, _TraceAPI) - self.assertIs(trace_api._gapic_api, patched.return_value) - self.assertIs(trace_api.client, client) diff --git a/trace/tests/unit/v1/test_client_v1.py b/trace/tests/unit/v1/test_client_v1.py deleted file mode 100644 index 9f50e868caad..000000000000 --- a/trace/tests/unit/v1/test_client_v1.py +++ /dev/null @@ -1,284 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -import unittest - -import mock - - -def _make_credentials(): - import google.auth.credentials - - return mock.Mock(spec=google.auth.credentials.Credentials) - - -class TestClient(unittest.TestCase): - - project = "PROJECT" - - @staticmethod - def _get_target_class(): - from google.cloud.trace.v1.client import Client - - return Client - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_constructor_defaults(self): - from google.api_core.gapic_v1.client_info import ClientInfo - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - self.assertEqual(client.project, self.project) - self.assertIsInstance(client._client_info, ClientInfo) - - def test_constructor_explicit(self): - credentials = _make_credentials() - client_info = mock.Mock() - client_options = mock.Mock() - client = self._make_one( - project=self.project, - credentials=credentials, - client_info=client_info, - client_options=client_options, - ) - self.assertEqual(client.project, self.project) - self.assertIs(client._client_info, client_info) - self.assertIs(client._client_options, client_options) - - def test_trace_api(self): - clients = [] - api_obj = object() - - def make_api(client_obj): - clients.append(client_obj) - return api_obj - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - - patch = mock.patch("google.cloud.trace.v1.client.make_trace_api", new=make_api) - - with patch: - api = client.trace_api - - self.assertIs(api, api_obj) - self.assertEqual(clients, [client]) - - def test_trace_api_existing(self): - """Check that the client caches _trace_api.""" - client = self._make_one(project=self.project, credentials=_make_credentials()) - client._trace_api = mock.sentinel.trace_api - self.assertIs(client.trace_api, mock.sentinel.trace_api) - - def test_patch_traces_default(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - traces = "fake_traces_for_test" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.patch_traces = mock.Mock() - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - client.patch_traces(traces=traces) - - mock_trace_api.patch_traces.assert_called_with( - project_id="PROJECT", traces="fake_traces_for_test" - ) - - def test_patch_traces_explicit(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - traces = "fake_traces_for_test" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.patch_traces = mock.Mock() - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - client.patch_traces(project_id=self.project, traces=traces) - - mock_trace_api.patch_traces.assert_called_with( - project_id="PROJECT", traces="fake_traces_for_test" - ) - - def test_get_trace_default(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - def get_trace(trace_id, project_id=None, options=None): - _get_trace_called_with = (trace_id, project_id, options) - return _get_trace_called_with - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - trace_id = "5e6e73b4131303cb6f5c9dfbaf104e33" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.get_trace = get_trace - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - get_trace_called_with = client.get_trace(trace_id=trace_id) - - self.assertEqual(get_trace_called_with, (trace_id, self.project, None)) - - def test_get_trace_explicit(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - def get_trace(trace_id, project_id=None, options=None): - _get_trace_called_with = (trace_id, project_id, options) - return _get_trace_called_with - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - trace_id = "5e6e73b4131303cb6f5c9dfbaf104e33" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.get_trace = get_trace - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - get_trace_called_with = client.get_trace( - trace_id=trace_id, project_id=self.project - ) - - self.assertEqual(get_trace_called_with, (trace_id, self.project, None)) - - def test_list_traces_default(self): - from google.cloud.trace.v1._gapic import _TraceAPI - - def list_traces( - project_id, - view=None, - page_size=None, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - page_token=None, - ): - _list_traces_called_with = ( - project_id, - view, - page_size, - start_time, - end_time, - filter_, - order_by, - page_token, - ) - return _list_traces_called_with - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.list_traces = list_traces - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - list_traces_called_with = client.list_traces() - - self.assertEqual( - list_traces_called_with, - (self.project, None, None, None, None, None, None, None), - ) - - def test_list_traces_explicit(self): - from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.trace_v1.gapic.enums import ListTracesRequest as Enum - from google.cloud.trace.v1._gapic import _TraceAPI - - from datetime import datetime - - def list_traces( - project_id, - view=None, - page_size=None, - start_time=None, - end_time=None, - filter_=None, - order_by=None, - page_token=None, - ): - _list_traces_called_with = ( - project_id, - view, - page_size, - start_time, - end_time, - filter_, - order_by, - page_token, - ) - return _list_traces_called_with - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.list_traces = list_traces - patch = mock.patch( - "google.cloud.trace.v1.client.make_trace_api", return_value=mock_trace_api - ) - - view = Enum.ViewType.COMPLETE - page_size = 10 - start_time = datetime.utcnow() - end_time = datetime.utcnow() - filter_ = "+span:span1" - order_by = "traceId" - page_token = "TOKEN" - - with patch: - list_traces_called_with = client.list_traces( - project_id=self.project, - view=view, - page_size=page_size, - start_time=start_time, - end_time=end_time, - filter_=filter_, - order_by=order_by, - page_token=page_token, - ) - - self.assertEqual( - list_traces_called_with, - ( - self.project, - view, - page_size, - _datetime_to_pb_timestamp(start_time), - _datetime_to_pb_timestamp(end_time), - filter_, - order_by, - page_token, - ), - ) diff --git a/trace/tests/unit/v2/test__gapic_v2.py b/trace/tests/unit/v2/test__gapic_v2.py deleted file mode 100644 index fd647240dba7..000000000000 --- a/trace/tests/unit/v2/test__gapic_v2.py +++ /dev/null @@ -1,292 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -import datetime -import unittest - -import mock - - -def _str_to_truncatablestr(str_to_convert): - result = {"value": str_to_convert, "truncated_byte_count": 0} - return result - - -class _Base(object): - from google.cloud.trace_v2.gapic import enums - - # Set the constants used for tests - project = "PROJECT" - trace_id = "c801e4119a064c659fe052d88f1d461b" - span_id = "1234123412341234" - parent_span_id = "1111000011110000" - span_name = "projects/{}/traces/{}/spans/{}".format(project, trace_id, span_id) - start_time = datetime.datetime.utcnow() - end_time = datetime.datetime.utcnow() - type = enums.Span.TimeEvent.MessageEvent.Type.SENT - display_name = "test display name" - - attributes = { - "attributeMap": { - "test_int_key": {"int_value": 123}, - "test_str_key": {"string_value": _str_to_truncatablestr("str_value")}, - "test_bool_key": {"bool_value": True}, - } - } - - st_function_name = "test function name" - st_origin_name = "test original name" - st_file_name = "test file name" - st_line_number = 12 - st_column_number = 2 - st_test_module = "test module" - st_build_id = "test build id" - st_source_version = "test source version" - stack_trace = { - "stack_frames": { - "frame": [ - { - "function_name": _str_to_truncatablestr(st_function_name), - "original_function_name": _str_to_truncatablestr(st_origin_name), - "file_name": _str_to_truncatablestr(st_file_name), - "line_number": st_line_number, - "column_number": st_column_number, - "load_module": { - "module": _str_to_truncatablestr(st_test_module), - "build_id": _str_to_truncatablestr(st_build_id), - }, - "source_version": _str_to_truncatablestr(st_source_version), - } - ], - "dropped_frames_count": 0, - }, - "stack_trace_hash_id": 1234, - } - - te_time = datetime.datetime.utcnow().isoformat() + "Z" - te_description = "test description" - time_events = { - "time_event": [ - { - "time": te_time, - "annotation": { - "description": _str_to_truncatablestr(te_description), - "attributes": attributes, - }, # TimeEvent can contain either annotation - # or message_event - } - ], - "dropped_annotations_count": 0, - "dropped_message_events_count": 0, - } - - link_span_id = "1111222211112222" - links = { - "link": [ - { - "trace_id": trace_id, - "span_id": link_span_id, - "type": type, - "attributes": attributes, - } - ], - "dropped_links_count": 0, - } - - status_code = 888 - status_message = "test status message" - status = {"code": status_code, "message": status_message, "details": []} - - same_process_as_parent_span = True - child_span_count = 0 - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - -class Test__TraceAPI(_Base, unittest.TestCase): - @staticmethod - def _get_target_class(): - from google.cloud.trace._gapic import _TraceAPI - - return _TraceAPI - - def test_constructor(self): - gapic_api = object() - client = object() - api = self._make_one(gapic_api, client) - self.assertIs(api._gapic_api, gapic_api) - self.assertIs(api.client, client) - - def test_batch_write_spans(self): - from google.cloud.trace_v2.gapic import trace_service_client - from google.cloud.trace._gapic import _dict_mapping_to_pb - - spans = { - "spans": [ - { - "name": self.span_name, - "span_id": self.span_id, - "parent_span_id": self.parent_span_id, - "display_name": _str_to_truncatablestr(self.display_name), - "start_time": self.start_time.isoformat() + "Z", - "end_time": self.end_time.isoformat() + "Z", - "attributes": self.attributes, - "stack_trace": self.stack_trace, - "time_events": self.time_events, - "links": self.links, - "status": self.status, - "same_process_as_parent_span": self.same_process_as_parent_span, - "child_span_count": self.child_span_count, - } - ] - } - - spans_pb_list = [_dict_mapping_to_pb(spans["spans"][0], "Span")] - project_name = "projects/{}".format(self.project) - - gapic_api = mock.Mock(spec=trace_service_client.TraceServiceClient) - api = self._make_one(gapic_api, None) - retry = mock.Mock() - timeout = mock.Mock() - api.batch_write_spans(project_name, spans, retry, timeout) - - gapic_api.batch_write_spans.assert_called_with( - name=project_name, spans=spans_pb_list, retry=retry, timeout=timeout - ) - - def test_create_span_default(self): - from google.cloud.trace_v2.gapic import trace_service_client - from google.cloud.trace._gapic import _dict_mapping_to_pb - from google.cloud._helpers import _datetime_to_pb_timestamp - - gapic_api = mock.Mock(spec=trace_service_client.TraceServiceClient) - api = self._make_one(gapic_api, None) - api.create_span( - name=self.span_name, - span_id=self.span_id, - display_name=_str_to_truncatablestr(self.display_name), - start_time=self.start_time, - end_time=self.end_time, - ) - - display_name_pb = _dict_mapping_to_pb( - _str_to_truncatablestr(self.display_name), "TruncatableString" - ) - start_time_pb = _datetime_to_pb_timestamp(self.start_time) - end_time_pb = _datetime_to_pb_timestamp(self.end_time) - - gapic_api.create_span.assert_called_with( - name=self.span_name, - span_id=self.span_id, - display_name=display_name_pb, - start_time=start_time_pb, - end_time=end_time_pb, - parent_span_id=None, - attributes=None, - stack_trace=None, - time_events=None, - links=None, - status=None, - same_process_as_parent_span=None, - child_span_count=None, - ) - - def test_create_span_explicit(self): - from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.trace._gapic import ( - _dict_mapping_to_pb, - _span_attrs_to_pb, - _status_mapping_to_pb, - _value_to_pb, - ) - from google.cloud.trace_v2.gapic import trace_service_client - - gapic_api = mock.Mock(spec=trace_service_client.TraceServiceClient) - api = self._make_one(gapic_api, None) - api.create_span( - name=self.span_name, - span_id=self.span_id, - display_name=_str_to_truncatablestr(self.display_name), - start_time=self.start_time, - end_time=self.end_time, - parent_span_id=self.parent_span_id, - attributes=self.attributes, - stack_trace=self.stack_trace, - time_events=self.time_events, - links=self.links, - status=self.status, - same_process_as_parent_span=self.same_process_as_parent_span, - child_span_count=self.child_span_count, - ) - - display_name_pb = _dict_mapping_to_pb( - _str_to_truncatablestr(self.display_name), "TruncatableString" - ) - start_time_pb = _datetime_to_pb_timestamp(self.start_time) - end_time_pb = _datetime_to_pb_timestamp(self.end_time) - attributes_pb = _span_attrs_to_pb(self.attributes, "Attributes") - stack_trace_pb = _dict_mapping_to_pb(self.stack_trace, "StackTrace") - time_events_pb = _span_attrs_to_pb(self.time_events, "TimeEvents") - links_pb = _span_attrs_to_pb(self.links, "Links") - status_pb = _status_mapping_to_pb(self.status) - same_process_as_parent_span_pb = _value_to_pb( - self.same_process_as_parent_span, "BoolValue" - ) - child_span_count_pb = _value_to_pb(self.child_span_count, "Int32Value") - - gapic_api.create_span.assert_called_with( - name=self.span_name, - span_id=self.span_id, - display_name=display_name_pb, - start_time=start_time_pb, - end_time=end_time_pb, - parent_span_id=self.parent_span_id, - attributes=attributes_pb, - stack_trace=stack_trace_pb, - time_events=time_events_pb, - links=links_pb, - status=status_pb, - same_process_as_parent_span=same_process_as_parent_span_pb, - child_span_count=child_span_count_pb, - ) - - -class Test_make_trace_api(unittest.TestCase): - def _call_fut(self, client): - from google.cloud.trace._gapic import make_trace_api - - return make_trace_api(client) - - def test_it(self): - from google.cloud.trace._gapic import _TraceAPI - - client = mock.Mock(spec=["_credentials", "_client_info", "_client_options"]) - - patch_api = mock.patch( - "google.cloud.trace._gapic.trace_service_client.TraceServiceClient" - ) - - with patch_api as patched: - trace_api = self._call_fut(client) - - patched.assert_called_once_with( - credentials=client._credentials, - client_info=client._client_info, - client_options=client._client_options, - ) - - self.assertIsInstance(trace_api, _TraceAPI) - self.assertIs(trace_api._gapic_api, patched.return_value) - self.assertIs(trace_api.client, client) diff --git a/trace/tests/unit/v2/test_client_v2.py b/trace/tests/unit/v2/test_client_v2.py deleted file mode 100644 index 4cd8a2a8705a..000000000000 --- a/trace/tests/unit/v2/test_client_v2.py +++ /dev/null @@ -1,162 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -import unittest - -import mock - - -def _make_credentials(): - import google.auth.credentials - - return mock.Mock(spec=google.auth.credentials.Credentials) - - -class TestClient(unittest.TestCase): - - project = "PROJECT" - - @staticmethod - def _get_target_class(): - from google.cloud.trace.client import Client - - return Client - - def _make_one(self, *args, **kw): - return self._get_target_class()(*args, **kw) - - def test_constructor_defaults(self): - from google.api_core.gapic_v1.client_info import ClientInfo - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - self.assertEqual(client.project, self.project) - self.assertIsInstance(client._client_info, ClientInfo) - - def test_constructor_explicit(self): - credentials = _make_credentials() - client_info = mock.Mock() - client_options = mock.Mock() - client = self._make_one( - project=self.project, - credentials=credentials, - client_info=client_info, - client_options=client_options, - ) - self.assertEqual(client.project, self.project) - self.assertIs(client._client_options, client_options) - - def test_trace_api(self): - clients = [] - api_obj = object() - - def make_api(client_obj): - clients.append(client_obj) - return api_obj - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - - patch = mock.patch("google.cloud.trace.client.make_trace_api", new=make_api) - - with patch: - api = client.trace_api - - self.assertIs(api, api_obj) - self.assertEqual(clients, [client]) - - def test_trace_api_existing(self): - """Check that the client caches _trace_api.""" - client = self._make_one(project=self.project, credentials=_make_credentials()) - client._trace_api = mock.sentinel.trace_api - self.assertIs(client.trace_api, mock.sentinel.trace_api) - - def test_batch_write_spans(self): - from google.cloud.trace._gapic import _TraceAPI - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - name = "projects/{}".format(self.project) - spans = "fake_spans_for_test" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.patch_traces = mock.Mock() - patch = mock.patch( - "google.cloud.trace.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - client.batch_write_spans(name=name, spans=spans) - - mock_trace_api.batch_write_spans.assert_called_with( - name=name, spans=spans, retry=None, timeout=None - ) - - def test_create_span(self): - from google.cloud.trace._gapic import _TraceAPI - - credentials = _make_credentials() - client = self._make_one(project=self.project, credentials=credentials) - name = "projects/{}".format(self.project) - span_id = "1111" - display_name = "test display name" - start_time = "test start time" - end_time = "test end time" - parent_span_id = "test parent span id" - attributes = "test attributes" - stack_trace = "test stack trace" - time_events = "test time events" - links = "test links" - status = "test status" - same_process_as_parent_span = "test same process as parent span" - child_span_count = "test child span count" - - mock_trace_api = mock.Mock(spec=_TraceAPI) - mock_trace_api.patch_traces = mock.Mock() - patch = mock.patch( - "google.cloud.trace.client.make_trace_api", return_value=mock_trace_api - ) - - with patch: - client.create_span( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - parent_span_id=parent_span_id, - attributes=attributes, - stack_trace=stack_trace, - time_events=time_events, - links=links, - status=status, - same_process_as_parent_span=same_process_as_parent_span, - child_span_count=child_span_count, - ) - - mock_trace_api.create_span.assert_called_with( - name=name, - span_id=span_id, - display_name=display_name, - start_time=start_time, - end_time=end_time, - parent_span_id=parent_span_id, - attributes=attributes, - stack_trace=stack_trace, - time_events=time_events, - links=links, - status=status, - same_process_as_parent_span=same_process_as_parent_span, - child_span_count=child_span_count, - ) diff --git a/videointelligence/.coveragerc b/videointelligence/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/videointelligence/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/videointelligence/.flake8 b/videointelligence/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/videointelligence/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/videointelligence/.repo-metadata.json b/videointelligence/.repo-metadata.json deleted file mode 100644 index 1861d3f653d9..000000000000 --- a/videointelligence/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "videointelligence", - "name_pretty": "Cloud Video Intelligence", - "product_documentation": "https://cloud.google.com/video-intelligence/docs/", - "client_documentation": "https://googleapis.dev/python/videointelligence/latest", - "issue_tracker": "https://issuetracker.google.com/savedsearches/5084810", - "release_level": "ga", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-videointelligence", - "api_id": "videointelligence.googleapis.com", - "requires_billing": true -} \ No newline at end of file diff --git a/videointelligence/CHANGELOG.md b/videointelligence/CHANGELOG.md deleted file mode 100644 index 07dd370bce20..000000000000 --- a/videointelligence/CHANGELOG.md +++ /dev/null @@ -1,270 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-videointelligence/#history - -## 1.12.1 - -11-14-2019 16:12 PST - -### Implementation Changes -- Revert [#9440](https://github.com/googleapis/google-cloud-python/pull/9440). Make `features` a keyword parameter to `annotate_video`. ([#9810](https://github.com/googleapis/google-cloud-python/pull/9810)) - -## 1.12.0 - -11-08-2019 09:32 PST - - -### Implementation Changes -- Make `features` a positional parameter in `annotate_video`, update retry config, make AnnotateVideo nonidempotent (via synth). ([#9440](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9440)) - -### New Features -- Add celebrity recognition support (via synth). ([#9612](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9612)) -- Drop support for `v1beta1` version of the API. ([#9426](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9426)) - -### Documentation -- Tweak docstrings, client configuration (via synth). ([#9434](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9434)) -- Change requests intersphinx url (via synth). ([#9412](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9412)) -- Fix intersphinx reference to requests. ([#9294](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9294)) -- Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9085)) -- Remove compatibility badges from READMEs. ([#9035](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9035)) - -### Internal / Testing Changes -- Enrich VPCSC tests. ([#9193](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9193)) - -## 1.11.0 - -08-12-2019 14:00 PDT - -### New Features -- Add segment / shot presence label annotations fields (via synth). ([#8987](https://github.com/googleapis/google-cloud-python/pull/8987)) -- Add V1 video segment / feature fields; remove send/recv msg size limit (via synth). ([#8975](https://github.com/googleapis/google-cloud-python/pull/8975)) - -### Documentation -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 1.10.0 - -07-24-2019 17:52 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8410](https://github.com/googleapis/google-cloud-python/pull/8410)) - -### New Features -- Add 'client_options' support (via synth). ([#8528](https://github.com/googleapis/google-cloud-python/pull/8528)) -- Add support for streaming classification / object tracking (via synth). ([#8427](https://github.com/googleapis/google-cloud-python/pull/8427)) - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -### Internal / Testing Changes -- Add VPC SC integration tests. ([#8607](https://github.com/googleapis/google-cloud-python/pull/8607)) -- Pin black version (via synth). ([#8601](https://github.com/googleapis/google-cloud-python/pull/8601)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- Change test video URI, add disclaimer to auto-generated template files (via synth). ([#8334](https://github.com/googleapis/google-cloud-python/pull/8334)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8370](https://github.com/googleapis/google-cloud-python/pull/8370)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8256](https://github.com/googleapis/google-cloud-python/pull/8256)) - -## 1.9.0 - -06-05-2019 10:42 PDT - - -### Implementation Changes -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) - -### New Features -- Add v1 object tracking support, v1p3b1 speech transcription / logo recognition support (via synth). ([#8221](https://github.com/googleapis/google-cloud-python/pull/8221)) - -### Documentation -- Change input_uri for sample video (via synth). ([#7944](https://github.com/googleapis/google-cloud-python/pull/7944)) -- Fix uri to video (via synth). ([#7862](https://github.com/googleapis/google-cloud-python/pull/7862)) - -### Internal / Testing Changes -- Fix coverage in 'types.py' (via synth). ([#8169](https://github.com/googleapis/google-cloud-python/pull/8169)) -- Blacken noxfile.py, setup.py (via synth). ([#8136](https://github.com/googleapis/google-cloud-python/pull/8136)) -- Harden synth replacement against template changes. ([#8104](https://github.com/googleapis/google-cloud-python/pull/8104)) -- Update noxfile (via synth). ([#7838](https://github.com/googleapis/google-cloud-python/pull/7838)) -- Add nox session `docs` (via synth). ([#7786](https://github.com/googleapis/google-cloud-python/pull/7786)) -- Update docs build configuration. ([#7603](https://github.com/googleapis/google-cloud-python/pull/7603)) - -## 1.8.0 - -03-06-2019 12:20 PST - -### New Features -- Add videointelligence v1p3beta1 (Streaming API Support). ([#7490](https://github.com/googleapis/google-cloud-python/pull/7490)) - -### Internal / Testing Changes -- Copy lintified proto files (via synth). ([#7472](https://github.com/googleapis/google-cloud-python/pull/7472)) - -## 1.7.0 - -02-25-2019 12:25 PST - - -### Implementation Changes -- Remove unused message exports. ([#7279](https://github.com/googleapis/google-cloud-python/pull/7279)) -- Protoc-generated serialization update. ([#7099](https://github.com/googleapis/google-cloud-python/pull/7099)) - -### New Features -- Add text detection / object tracking feature support (via sync). ([#7415](https://github.com/googleapis/google-cloud-python/pull/7415)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Update copyright headers. -- Pick up stub docstring fix in GAPIC generator. ([#6986](https://github.com/googleapis/google-cloud-python/pull/6986)) - -### Internal / Testing Changes -- Add clarifying comment to blacken nox target. ([#7407](https://github.com/googleapis/google-cloud-python/pull/7407)) -- Copy proto files alongside protoc versions. -- Add protos as an artifact to library. ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 1.6.1 - -12-17-2018 17:09 PST - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) -- Fixes to GAPIC generator. ([#6578](https://github.com/googleapis/google-cloud-python/pull/6578)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) - -### Internal / Testing Changes -- Add baseline for synth.metadata -- Update noxfile. -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) - -## 1.6.0 - -11-09-2018 13:36 PST - - -### Implementation Changes -- Add support for speech transcription. ([#6313](https://github.com/googleapis/google-cloud-python/pull/6313)) -- Fix client_info bug, update docstrings and timeouts. ([#6425](https://github.com/googleapis/google-cloud-python/pull/6425)) - -### Dependencies -- Bump minimum 'api_core' version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) -- Avoid broken 'google-common-apis 1.5.4' release. ([#6355](https://github.com/googleapis/google-cloud-python/pull/6355)) - -### Documentation -- normalize use of support level badges.([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) - -### Internal / Testing Changes -- Add 'mock' to unit test dependencies for autogen libs. ([#6402](https://github.com/googleapis/google-cloud-python/pull/6402)) - -## 1.5.0 - -### New Features -- Regenerate v2p2beta1 to add Object Tracking and Text Detection Beta ([#6225](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6225)) - -### Documentation -- Harmonize / DRY 'README.rst' / 'docs/index.rst'. ([#6002](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6002)) -- Correct text for the pip install command ([#6198](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6198)) - -### Internal / Testing Changes -- Use new Nox ([#6175](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6175)) - -## 1.4.0 - -### New Features -- Add support for 'v1p2beta1' API version ([#6004](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6004)) - -### Implementation Changes -- Re-generate library using videointelligence/synth.py ([#5982](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5982)) -- Re-generate library using videointelligence/synth.py ([#5954](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5954)) - -## 1.3.0 - -### Implementation Changes -- Avoid overwriting '__module__' of messages from shared modules. (#5364) - -### New Features -- Regenerate Video Intelligence v1p1beta1 endpoint to add new features (#5617) - -### Internal / Testing Changes -- Add Test runs for Python 3.7 and remove 3.4 (#5295) - -## 1.2.0 - -### New Features - -- Add v1p1beta1 version of videointelligence (#5165) - -### Internal / Testing Changes - -- Fix v1p1beta1 unit tests (#5064) - -## 1.1.0 - -### Interface additions - -- Added video v1p1beta1 (#5048) - -## 1.0.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Testing and internal changes - -- Normalize all setup.py files (#4909) - -## 1.0.0 - -[![release level](https://img.shields.io/badge/release%20level-general%20availability%20%28GA%29-brightgreen.svg?style=flat)](https://cloud.google.com/terms/launch-stages) - -### Features - -#### General Availability - -The `google-cloud-videointelligence` package is now supported at the -**general availability** quality level. This means it is stable; the code -and API surface will not change in backwards-incompatible ways unless -absolutely necessary (e.g. because of critical security issues) or with an -extensive deprecation period. - -One exception to this: We will remove beta endpoints (as a semver-minor update) -at whatever point the underlying endpoints go away. - -#### v1 endpoint - -The underlying video intelligence API has also gone general availability, and -this library by default now uses the `v1` endpoint (rather than `v1beta2`) -unless you explicitly used something else. This is a backwards compatible -change as the `v1` and `v1beta2` endpoints are identical. If you pinned to -`v1beta2`, you are encouraged to move to `v1`. - -## 0.28.0 - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) -- Deferring to `google-api-core` for `grpcio` and - `googleapis-common-protos`dependencies (#4096, #4098) - -### Packaging - -- Change "Development Status" in package metadata from `3 - Alpha` - to `4 - Beta` (eb43849569556c6e47f11b8310864c5a280507f2) - -PyPI: https://pypi.org/project/google-cloud-videointelligence/0.28.0/ diff --git a/videointelligence/LICENSE b/videointelligence/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/videointelligence/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/videointelligence/MANIFEST.in b/videointelligence/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/videointelligence/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/videointelligence/README.rst b/videointelligence/README.rst deleted file mode 100644 index 944d96bad5ff..000000000000 --- a/videointelligence/README.rst +++ /dev/null @@ -1,106 +0,0 @@ -Python Client for Google Cloud Video Intelligence -================================================= - -|beta| |pypi| |versions| - -`Google Cloud Video Intelligence`_ API makes videos searchable, and -discoverable, by extracting metadata with an easy to use API. -You can now search every moment of every video file in your catalog -and find every occurrence as well as its significance. It quickly -annotates videos stored in `Google Cloud Storage`_, and helps you -identify key nouns entities of your video, and when they occur -within the video. Separate signal from noise, by retrieving -relevant information at the video, shot or per frame. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |beta| image:: https://img.shields.io/badge/support-beta-silver.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-videointelligence.svg - :target: https://pypi.org/project/google-cloud-videointelligence/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-videointelligence.svg - :target: https://pypi.org/project/google-cloud-videointelligence/ -.. _Google Cloud Video Intelligence: https://cloud.google.com/video-intelligence/ -.. _Google Cloud Storage: https://cloud.google.com/storage/ -.. _Client Library Documentation: https://googleapis.dev/python/videointelligence/latest -.. _Product Documentation: https://cloud.google.com/video-intelligence/docs/ - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Video Intelligence API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Video Intelligence API.: https://cloud.google.com/datastore -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-videointelligence - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-videointelligence - -Example Usage -~~~~~~~~~~~~~ - -.. code-block:: python - - from google.cloud import videointelligence - - client = videointelligence.VideoIntelligenceServiceClient() - job = client.annotate_video( - input_uri='gs:///my_video.mp4', - features=['LABEL_DETECTION', 'SHOT_CHANGE_DETECTION'], - ) - result = job.result() - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Google Cloud Video Intelligence - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. diff --git a/videointelligence/docs/README.rst b/videointelligence/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/videointelligence/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/videointelligence/docs/_static/custom.css b/videointelligence/docs/_static/custom.css deleted file mode 100644 index 9a6f9f8ddc3a..000000000000 --- a/videointelligence/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/videointelligence/docs/_templates/layout.html b/videointelligence/docs/_templates/layout.html deleted file mode 100644 index de457b2c2767..000000000000 --- a/videointelligence/docs/_templates/layout.html +++ /dev/null @@ -1,49 +0,0 @@ -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/videointelligence/docs/changelog.md b/videointelligence/docs/changelog.md deleted file mode 120000 index d383e581e198..000000000000 --- a/videointelligence/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../videointelligence/CHANGELOG.md \ No newline at end of file diff --git a/videointelligence/docs/conf.py b/videointelligence/docs/conf.py deleted file mode 100644 index 398337050e02..000000000000 --- a/videointelligence/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-video-intelligence documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-video-intelligence" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-video-intelligence-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-video-intelligence.tex", - u"google-cloud-video-intelligence Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-video-intelligence", - u"google-cloud-video-intelligence Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-video-intelligence", - u"google-cloud-video-intelligence Documentation", - author, - "google-cloud-video-intelligence", - "GAPIC library for the {metadata.shortName} v1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/videointelligence/docs/gapic/v1/api.rst b/videointelligence/docs/gapic/v1/api.rst deleted file mode 100644 index cfc34f438f49..000000000000 --- a/videointelligence/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Video Intelligence API -======================================= - -.. automodule:: google.cloud.videointelligence_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1/types.rst b/videointelligence/docs/gapic/v1/types.rst deleted file mode 100644 index d8508c287842..000000000000 --- a/videointelligence/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Video Intelligence API Client -============================================= - -.. automodule:: google.cloud.videointelligence_v1.types - :members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1beta2/api.rst b/videointelligence/docs/gapic/v1beta2/api.rst deleted file mode 100644 index 006f41313e22..000000000000 --- a/videointelligence/docs/gapic/v1beta2/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Cloud Video Intelligence API -============================================== - -.. automodule:: google.cloud.videointelligence_v1beta2 - :members: - :inherited-members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1beta2/types.rst b/videointelligence/docs/gapic/v1beta2/types.rst deleted file mode 100644 index f782d4c9faec..000000000000 --- a/videointelligence/docs/gapic/v1beta2/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Cloud Video Intelligence API Client -==================================================== - -.. automodule:: google.cloud.videointelligence_v1beta2.types - :members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p1beta1/api.rst b/videointelligence/docs/gapic/v1p1beta1/api.rst deleted file mode 100644 index 5774850d626b..000000000000 --- a/videointelligence/docs/gapic/v1p1beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Video Intelligence API -======================================= - -.. automodule:: google.cloud.videointelligence_v1p1beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p1beta1/types.rst b/videointelligence/docs/gapic/v1p1beta1/types.rst deleted file mode 100644 index fc72d7807e9b..000000000000 --- a/videointelligence/docs/gapic/v1p1beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Video Intelligence API Client -============================================= - -.. automodule:: google.cloud.videointelligence_v1p1beta1.types - :members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p2beta1/api.rst b/videointelligence/docs/gapic/v1p2beta1/api.rst deleted file mode 100644 index 0dafdd894ab6..000000000000 --- a/videointelligence/docs/gapic/v1p2beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Video Intelligence API -======================================= - -.. automodule:: google.cloud.videointelligence_v1p2beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p2beta1/types.rst b/videointelligence/docs/gapic/v1p2beta1/types.rst deleted file mode 100644 index 4806fa77790e..000000000000 --- a/videointelligence/docs/gapic/v1p2beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Video Intelligence API Client -============================================= - -.. automodule:: google.cloud.videointelligence_v1p2beta1.types - :members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p3beta1/api.rst b/videointelligence/docs/gapic/v1p3beta1/api.rst deleted file mode 100644 index 570eaffa4dc3..000000000000 --- a/videointelligence/docs/gapic/v1p3beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Video Intelligence API -======================================= - -.. automodule:: google.cloud.videointelligence_v1p3beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/videointelligence/docs/gapic/v1p3beta1/types.rst b/videointelligence/docs/gapic/v1p3beta1/types.rst deleted file mode 100644 index 9f86eee10bac..000000000000 --- a/videointelligence/docs/gapic/v1p3beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Video Intelligence API Client -============================================= - -.. automodule:: google.cloud.videointelligence_v1p3beta1.types - :members: \ No newline at end of file diff --git a/videointelligence/docs/index.rst b/videointelligence/docs/index.rst deleted file mode 100644 index 5a888812a870..000000000000 --- a/videointelligence/docs/index.rst +++ /dev/null @@ -1,56 +0,0 @@ -.. include:: README.rst - -API Reference -------------- - - -This package includes clients for multiple versions of the Video Intelligence -API. By default, you will get ``v1``, the latest stable version. - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - -A new beta release with additional features over the current stable version, -spelled ``v1p3beta1``, is provided to allow you to use these new features. -These are expected to move into the stable release soon; until then, the -usual beta admonishment (changes are possible, etc.) applies. - -An API and type reference is provided for this beta: - -.. toctree:: - :maxdepth: 2 - - gapic/v1p3beta1/api - gapic/v1p3beta1/types - -The previous beta releases, spelled ``v1p2beta1``, ``v1p1beta1``, and -``v1beta2``, are provided to continue to support code previously written -against them. In order to use ththem, you will want to import from e.g. -``google.cloud.videointelligence_v1beta2`` in lieu of -``google.cloud.videointelligence_v1``. - -An API and type reference is provided the these betas also: - -.. toctree:: - :maxdepth: 2 - - gapic/v1p2beta1/api - gapic/v1p2beta1/types - gapic/v1p1beta1/api - gapic/v1p1beta1/types - gapic/v1beta2/api - gapic/v1beta2/types - - -Changelog ---------- - -For a list of all ``google-cloud-videointelligence`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/videointelligence/google/__init__.py b/videointelligence/google/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/videointelligence/google/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/videointelligence/google/cloud/__init__.py b/videointelligence/google/cloud/__init__.py deleted file mode 100644 index 8fcc60e2b9c6..000000000000 --- a/videointelligence/google/cloud/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/videointelligence/google/cloud/videointelligence.py b/videointelligence/google/cloud/videointelligence.py deleted file mode 100644 index 276a663b7ec4..000000000000 --- a/videointelligence/google/cloud/videointelligence.py +++ /dev/null @@ -1,25 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1 import VideoIntelligenceServiceClient -from google.cloud.videointelligence_v1 import enums -from google.cloud.videointelligence_v1 import types - - -__all__ = ("enums", "types", "VideoIntelligenceServiceClient") diff --git a/videointelligence/google/cloud/videointelligence_v1/__init__.py b/videointelligence/google/cloud/videointelligence_v1/__init__.py deleted file mode 100644 index 85cd704ad066..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/__init__.py +++ /dev/null @@ -1,32 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1 import types -from google.cloud.videointelligence_v1.gapic import enums -from google.cloud.videointelligence_v1.gapic import video_intelligence_service_client - - -class VideoIntelligenceServiceClient( - video_intelligence_service_client.VideoIntelligenceServiceClient -): - __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "VideoIntelligenceServiceClient") diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1/gapic/enums.py deleted file mode 100644 index 269d8829128a..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/gapic/enums.py +++ /dev/null @@ -1,82 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Feature(enum.IntEnum): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - SHOT_CHANGE_DETECTION (int): Shot change detection. - EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - FACE_DETECTION (int): Human face detection and tracking. - SPEECH_TRANSCRIPTION (int): Speech transcription. - TEXT_DETECTION (int): OCR text detection and tracking. - OBJECT_TRACKING (int): Object detection and tracking. - """ - - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - SHOT_CHANGE_DETECTION = 2 - EXPLICIT_CONTENT_DETECTION = 3 - FACE_DETECTION = 4 - SPEECH_TRANSCRIPTION = 6 - TEXT_DETECTION = 7 - OBJECT_TRACKING = 9 - - -class LabelDetectionMode(enum.IntEnum): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(enum.IntEnum): - """ - Bucketized representation of likelihood. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/transports/__init__.py b/videointelligence/google/cloud/videointelligence_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/transports/video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1/gapic/transports/video_intelligence_service_grpc_transport.py deleted file mode 100644 index 0a74daf4de6b..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/gapic/transports/video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.videointelligence_v1.proto import video_intelligence_pb2_grpc - - -class VideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1 VideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "video_intelligence_service_stub": video_intelligence_pb2_grpc.VideoIntelligenceServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def annotate_video(self): - """Return the gRPC stub for :meth:`VideoIntelligenceServiceClient.annotate_video`. - - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["video_intelligence_service_stub"].AnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py deleted file mode 100644 index f872f349fde8..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client.py +++ /dev/null @@ -1,306 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1 VideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.videointelligence_v1.gapic import enums -from google.cloud.videointelligence_v1.gapic import ( - video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1.gapic.transports import ( - video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.videointelligence.v1.VideoIntelligenceService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - VideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.VideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.VideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def annotate_video( - self, - input_uri=None, - input_content=None, - features=None, - video_context=None, - output_uri=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud import videointelligence_v1 - >>> from google.cloud.videointelligence_v1 import enums - >>> - >>> client = videointelligence_v1.VideoIntelligenceServiceClient() - >>> - >>> input_uri = 'gs://cloud-samples-data/video/cat.mp4' - >>> features_element = enums.Feature.LABEL_DETECTION - >>> features = [features_element] - >>> - >>> response = client.annotate_video(input_uri=input_uri, features=features) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (str): Input video location. Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. A video - URI may include wildcards in ``object-id``, and thus identify multiple - videos. Supported wildcards: '\*' to match 0 or more characters; '?' to - match 1 character. If unset, the input video should be embedded in the - request as ``input_content``. If set, ``input_content`` should be unset. - input_content (bytes): The video data bytes. If unset, the input video(s) should be specified - via ``input_uri``. If set, ``input_uri`` should be unset. - features (list[~google.cloud.videointelligence_v1.types.Feature]): Required. Requested video annotation features. - video_context (Union[dict, ~google.cloud.videointelligence_v1.types.VideoContext]): Additional video context and/or feature-specific parameters. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.videointelligence_v1.types.VideoContext` - output_uri (str): Optional. Location where the output (in JSON format) should be stored. - Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. - location_id (str): Optional. Cloud region where annotation should take place. Supported - cloud regions: ``us-east1``, ``us-west1``, ``europe-west1``, - ``asia-east1``. If no region is specified, a region will be determined - based on video file location. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.videointelligence_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.annotate_video, - default_retry=self._method_configs["AnnotateVideo"].retry, - default_timeout=self._method_configs["AnnotateVideo"].timeout, - client_info=self._client_info, - ) - - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - input_content=input_content, - features=features, - video_context=video_context, - output_uri=output_uri, - location_id=location_id, - ) - operation = self._inner_api_calls["annotate_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - metadata_type=video_intelligence_pb2.AnnotateVideoProgress, - ) diff --git a/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client_config.py deleted file mode 100644 index 70a9b8812235..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/gapic/video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1.VideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence.proto b/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence.proto deleted file mode 100644 index 6611e9eb2c61..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence.proto +++ /dev/null @@ -1,745 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.videointelligence.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.VideoIntelligence.V1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence"; -option java_multiple_files = true; -option java_outer_classname = "VideoIntelligenceServiceProto"; -option java_package = "com.google.cloud.videointelligence.v1"; -option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1"; -option ruby_package = "Google::Cloud::VideoIntelligence::V1"; - -// Service that implements Google Cloud Video Intelligence API. -service VideoIntelligenceService { - option (google.api.default_host) = "videointelligence.googleapis.com"; - option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; - - // Performs asynchronous video annotation. Progress and results can be - // retrieved through the `google.longrunning.Operations` interface. - // `Operation.metadata` contains `AnnotateVideoProgress` (progress). - // `Operation.response` contains `AnnotateVideoResponse` (results). - rpc AnnotateVideo(AnnotateVideoRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/videos:annotate" - body: "*" - }; - option (google.api.method_signature) = "input_uri,features"; - option (google.longrunning.operation_info) = { - response_type: "AnnotateVideoResponse" - metadata_type: "AnnotateVideoProgress" - }; - } -} - -// Video annotation request. -message AnnotateVideoRequest { - // Input video location. Currently, only - // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are - // supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](/storage/docs/reference-uris). - // A video URI may include wildcards in `object-id`, and thus identify - // multiple videos. Supported wildcards: '*' to match 0 or more characters; - // '?' to match 1 character. If unset, the input video should be embedded - // in the request as `input_content`. If set, `input_content` should be unset. - string input_uri = 1; - - // The video data bytes. - // If unset, the input video(s) should be specified via `input_uri`. - // If set, `input_uri` should be unset. - bytes input_content = 6; - - // Required. Requested video annotation features. - repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; - - // Additional video context and/or feature-specific parameters. - VideoContext video_context = 3; - - // Optional. Location where the output (in JSON format) should be stored. - // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - // URIs are supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For more information, see - // [Request URIs](/storage/docs/reference-uris). - string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Cloud region where annotation should take place. Supported cloud - // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - // is specified, a region will be determined based on video file location. - string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Video context and/or feature-specific parameters. -message VideoContext { - // Video segments to annotate. The segments may overlap and are not required - // to be contiguous or span the whole video. If unspecified, each video is - // treated as a single segment. - repeated VideoSegment segments = 1; - - // Config for LABEL_DETECTION. - LabelDetectionConfig label_detection_config = 2; - - // Config for SHOT_CHANGE_DETECTION. - ShotChangeDetectionConfig shot_change_detection_config = 3; - - // Config for EXPLICIT_CONTENT_DETECTION. - ExplicitContentDetectionConfig explicit_content_detection_config = 4; - - // Config for FACE_DETECTION. - FaceDetectionConfig face_detection_config = 5; - - // Config for SPEECH_TRANSCRIPTION. - SpeechTranscriptionConfig speech_transcription_config = 6; - - // Config for TEXT_DETECTION. - TextDetectionConfig text_detection_config = 8; - - // Config for OBJECT_TRACKING. - ObjectTrackingConfig object_tracking_config = 13; -} - -// Video annotation feature. -enum Feature { - // Unspecified. - FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - LABEL_DETECTION = 1; - - // Shot change detection. - SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - EXPLICIT_CONTENT_DETECTION = 3; - - // Human face detection and tracking. - FACE_DETECTION = 4; - - // Speech transcription. - SPEECH_TRANSCRIPTION = 6; - - // OCR text detection and tracking. - TEXT_DETECTION = 7; - - // Object detection and tracking. - OBJECT_TRACKING = 9; -} - -// Label detection mode. -enum LabelDetectionMode { - // Unspecified. - LABEL_DETECTION_MODE_UNSPECIFIED = 0; - - // Detect shot-level labels. - SHOT_MODE = 1; - - // Detect frame-level labels. - FRAME_MODE = 2; - - // Detect both shot-level and frame-level labels. - SHOT_AND_FRAME_MODE = 3; -} - -// Bucketized representation of likelihood. -enum Likelihood { - // Unspecified likelihood. - LIKELIHOOD_UNSPECIFIED = 0; - - // Very unlikely. - VERY_UNLIKELY = 1; - - // Unlikely. - UNLIKELY = 2; - - // Possible. - POSSIBLE = 3; - - // Likely. - LIKELY = 4; - - // Very likely. - VERY_LIKELY = 5; -} - -// Config for LABEL_DETECTION. -message LabelDetectionConfig { - // What labels should be detected with LABEL_DETECTION, in addition to - // video-level labels or segment-level labels. - // If unspecified, defaults to `SHOT_MODE`. - LabelDetectionMode label_detection_mode = 1; - - // Whether the video has been shot from a stationary (i.e. non-moving) camera. - // When set to true, might improve detection accuracy for moving objects. - // Should be used with `SHOT_AND_FRAME_MODE` enabled. - bool stationary_camera = 2; - - // Model to use for label detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; - - // The confidence threshold we perform filtering on the labels from - // frame-level detection. If not set, it is set to 0.4 by default. The valid - // range for this threshold is [0.1, 0.9]. Any value set outside of this - // range will be clipped. - // Note: for best results please follow the default threshold. We will update - // the default threshold everytime when we release a new model. - float frame_confidence_threshold = 4; - - // The confidence threshold we perform filtering on the labels from - // video-level and shot-level detections. If not set, it is set to 0.3 by - // default. The valid range for this threshold is [0.1, 0.9]. Any value set - // outside of this range will be clipped. - // Note: for best results please follow the default threshold. We will update - // the default threshold everytime when we release a new model. - float video_confidence_threshold = 5; -} - -// Config for SHOT_CHANGE_DETECTION. -message ShotChangeDetectionConfig { - // Model to use for shot change detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for OBJECT_TRACKING. -message ObjectTrackingConfig { - // Model to use for object tracking. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for FACE_DETECTION. -message FaceDetectionConfig { - // Model to use for face detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; - - // Whether bounding boxes be included in the face annotation output. - bool include_bounding_boxes = 2; -} - -// Config for EXPLICIT_CONTENT_DETECTION. -message ExplicitContentDetectionConfig { - // Model to use for explicit content detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for TEXT_DETECTION. -message TextDetectionConfig { - // Language hint can be specified if the language to be detected is known a - // priori. It can increase the accuracy of the detection. Language hint must - // be language code in BCP-47 format. - // - // Automatic language detection is performed if no hint is provided. - repeated string language_hints = 1; - - // Model to use for text detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 2; -} - -// Video segment. -message VideoSegment { - // Time-offset, relative to the beginning of the video, - // corresponding to the start of the segment (inclusive). - google.protobuf.Duration start_time_offset = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the end of the segment (inclusive). - google.protobuf.Duration end_time_offset = 2; -} - -// Video segment level annotation results for label detection. -message LabelSegment { - // Video segment where a label was detected. - VideoSegment segment = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Video frame level annotation results for label detection. -message LabelFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Detected entity from video analysis. -message Entity { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string entity_id = 1; - - // Textual description, e.g. `Fixed-gear bicycle`. - string description = 2; - - // Language code for `description` in BCP-47 format. - string language_code = 3; -} - -// Label annotation. -message LabelAnnotation { - // Detected entity. - Entity entity = 1; - - // Common categories for the detected entity. - // E.g. when the label is `Terrier` the category is likely `dog`. And in some - // cases there might be more than one categories e.g. `Terrier` could also be - // a `pet`. - repeated Entity category_entities = 2; - - // All video segments where a label was detected. - repeated LabelSegment segments = 3; - - // All video frames where a label was detected. - repeated LabelFrame frames = 4; -} - -// Video frame level annotation results for explicit content. -message ExplicitContentFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Likelihood of the pornography content.. - Likelihood pornography_likelihood = 2; -} - -// Explicit content annotation (based on per-frame visual signals only). -// If no explicit content has been detected in a frame, no annotations are -// present for that frame. -message ExplicitContentAnnotation { - // All video frames where explicit content was detected. - repeated ExplicitContentFrame frames = 1; -} - -// Normalized bounding box. -// The normalized vertex coordinates are relative to the original image. -// Range: [0, 1]. -message NormalizedBoundingBox { - // Left X coordinate. - float left = 1; - - // Top Y coordinate. - float top = 2; - - // Right X coordinate. - float right = 3; - - // Bottom Y coordinate. - float bottom = 4; -} - -// Video segment level annotation results for face detection. -message FaceSegment { - // Video segment where a face was detected. - VideoSegment segment = 1; -} - -// Video frame level annotation results for face detection. -message FaceFrame { - // Normalized Bounding boxes in a frame. - // There can be more than one boxes if the same face is detected in multiple - // locations within the current frame. - repeated NormalizedBoundingBox normalized_bounding_boxes = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the video frame for this location. - google.protobuf.Duration time_offset = 2; -} - -// Face annotation. -message FaceAnnotation { - // Thumbnail of a representative face view (in JPEG format). - bytes thumbnail = 1; - - // All video segments where a face was detected. - repeated FaceSegment segments = 2; - - // All video frames where a face was detected. - repeated FaceFrame frames = 3; -} - -// Annotation results for a single video. -message VideoAnnotationResults { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Video segment on which the annotation is run. - VideoSegment segment = 10; - - // Topical label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. - repeated LabelAnnotation segment_label_annotations = 2; - - // Presence label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. Compared to the - // existing topical `segment_label_annotations`, this field presents more - // fine-grained, segment-level labels detected in video content and is made - // available only when the client sets `LabelDetectionConfig.model` to - // "builtin/latest" in the request. - repeated LabelAnnotation segment_presence_label_annotations = 23; - - // Topical label annotations on shot level. - // There is exactly one element for each unique label. - repeated LabelAnnotation shot_label_annotations = 3; - - // Presence label annotations on shot level. There is exactly one element for - // each unique label. Compared to the existing topical - // `shot_label_annotations`, this field presents more fine-grained, shot-level - // labels detected in video content and is made available only when the client - // sets `LabelDetectionConfig.model` to "builtin/latest" in the request. - repeated LabelAnnotation shot_presence_label_annotations = 24; - - // Label annotations on frame level. - // There is exactly one element for each unique label. - repeated LabelAnnotation frame_label_annotations = 4; - - // Face annotations. There is exactly one element for each unique face. - repeated FaceAnnotation face_annotations = 5; - - // Shot annotations. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 6; - - // Explicit content annotation. - ExplicitContentAnnotation explicit_annotation = 7; - - // Speech transcription. - repeated SpeechTranscription speech_transcriptions = 11; - - // OCR text detection and tracking. - // Annotations for list of detected text snippets. Each will have list of - // frame information associated with it. - repeated TextAnnotation text_annotations = 12; - - // Annotations for list of objects detected and tracked in video. - repeated ObjectTrackingAnnotation object_annotations = 14; - - // If set, indicates an error. Note that for a single `AnnotateVideoRequest` - // some videos may succeed and some may fail. - google.rpc.Status error = 9; -} - -// Video annotation response. Included in the `response` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoResponse { - // Annotation results for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationResults annotation_results = 1; -} - -// Annotation progress for a single video. -message VideoAnnotationProgress { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Approximate percentage processed thus far. Guaranteed to be - // 100 when fully processed. - int32 progress_percent = 2; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 3; - - // Time of the most recent update. - google.protobuf.Timestamp update_time = 4; - - // Specifies which feature is being tracked if the request contains more than - // one features. - Feature feature = 5; - - // Specifies which segment is being tracked if the request contains more than - // one segments. - VideoSegment segment = 6; -} - -// Video annotation progress. Included in the `metadata` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoProgress { - // Progress metadata for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationProgress annotation_progress = 1; -} - -// Config for SPEECH_TRANSCRIPTION. -message SpeechTranscriptionConfig { - // Required. *Required* The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language Support](https://cloud.google.com/speech/docs/languages) - // for a list of the currently supported language codes. - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechTranscription`. The server may return fewer than - // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will - // return a maximum of one. If omitted, will return a maximum of one. - int32 max_alternatives = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool filter_profanity = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A means to provide context to assist the speech recognition. - repeated SpeechContext speech_contexts = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. The default 'false' value - // does not add punctuation to result hypotheses. NOTE: "This is currently - // offered as an experimental service, complimentary to all users. In the - // future this may be exclusively available as a premium feature." - bool enable_automatic_punctuation = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. For file formats, such as MXF or MKV, supporting multiple audio - // tracks, specify up to two tracks. Default: track 0. - repeated int32 audio_tracks = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - // Note: When this is true, we send all the words from the beginning of the - // audio for the top alternative in every consecutive responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - bool enable_speaker_diarization = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, specifies the estimated number of speakers in the conversation. - // If not set, defaults to '2'. - // Ignored unless enable_speaker_diarization is set to true. - int32 diarization_speaker_count = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // Optional. A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech/limits#content). - repeated string phrases = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechTranscription { - // May contain one or more recognition hypotheses (up to the maximum specified - // in `max_alternatives`). These alternatives are ordered in terms of - // accuracy, with the top (first) alternative being the most probable, as - // ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag of - // the language in this result. This language code was detected to have the - // most likelihood of being spoken in the audio. - string language_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // Output only. The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Word-specific information for recognized words. Word information is only -// included in the response when certain request parameters are set, such -// as `enable_word_time_offsets`. -message WordInfo { - // Time offset relative to the beginning of the audio, and - // corresponding to the start of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, and - // corresponding to the end of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // Output only. The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from 1 up to diarization_speaker_count, - // and is only set if speaker diarization is enabled. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// Normalized bounding polygon for text (that might not be aligned with axis). -// Contains list of the corner points in clockwise order starting from -// top-left corner. For example, for a rectangular bounding box: -// When the text is horizontal it might look like: -// 0----1 -// | | -// 3----2 -// -// When it's clockwise rotated 180 degrees around the top-left corner it -// becomes: -// 2----3 -// | | -// 1----0 -// -// and the vertex order will still be (0, 1, 2, 3). Note that values can be less -// than 0, or greater than 1 due to trignometric calculations for location of -// the box. -message NormalizedBoundingPoly { - // Normalized vertices of the bounding polygon. - repeated NormalizedVertex vertices = 1; -} - -// Video segment level annotation results for text detection. -message TextSegment { - // Video segment where a text snippet was detected. - VideoSegment segment = 1; - - // Confidence for the track of detected text. It is calculated as the highest - // over all frames where OCR detected text appears. - float confidence = 2; - - // Information related to the frames where OCR detected text appears. - repeated TextFrame frames = 3; -} - -// Video frame level annotation results for text annotation (OCR). -// Contains information regarding timestamp and bounding box locations for the -// frames containing detected OCR text snippets. -message TextFrame { - // Bounding polygon of the detected text for this frame. - NormalizedBoundingPoly rotated_bounding_box = 1; - - // Timestamp of this frame. - google.protobuf.Duration time_offset = 2; -} - -// Annotations related to one detected OCR text snippet. This will contain the -// corresponding text, confidence value, and frame level information for each -// detection. -message TextAnnotation { - // The detected text. - string text = 1; - - // All video segments where OCR detected text appears. - repeated TextSegment segments = 2; -} - -// Video frame level annotations for object detection and tracking. This field -// stores per frame location, time offset, and confidence. -message ObjectTrackingFrame { - // The normalized bounding box location of this object track for the frame. - NormalizedBoundingBox normalized_bounding_box = 1; - - // The timestamp of the frame in microseconds. - google.protobuf.Duration time_offset = 2; -} - -// Annotations corresponding to one tracked object. -message ObjectTrackingAnnotation { - // Different representation of tracking info in non-streaming batch - // and streaming modes. - oneof track_info { - // Non-streaming batch mode ONLY. - // Each object track corresponds to one video segment where it appears. - VideoSegment segment = 3; - - // Streaming mode ONLY. - // In streaming mode, we do not know the end time of a tracked object - // before it is completed. Hence, there is no VideoSegment info returned. - // Instead, we provide a unique identifiable integer track_id so that - // the customers can correlate the results of the ongoing - // ObjectTrackAnnotation of the same track_id over time. - int64 track_id = 5; - } - - // Entity to specify the object category that this track is labeled as. - Entity entity = 1; - - // Object category's labeling confidence of this track. - float confidence = 4; - - // Information corresponding to all frames where this object track appears. - // Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame - // messages in frames. - // Streaming mode: it can only be one ObjectTrackingFrame message in frames. - repeated ObjectTrackingFrame frames = 2; -} diff --git a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py deleted file mode 100644 index 869eeae436ce..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2.py +++ /dev/null @@ -1,4186 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/videointelligence_v1/proto/video_intelligence.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/videointelligence_v1/proto/video_intelligence.proto", - package="google.cloud.videointelligence.v1", - syntax="proto3", - serialized_options=_b( - "\n%com.google.cloud.videointelligence.v1B\035VideoIntelligenceServiceProtoP\001ZRgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence\252\002!Google.Cloud.VideoIntelligence.V1\312\002!Google\\Cloud\\VideoIntelligence\\V1\352\002$Google::Cloud::VideoIntelligence::V1" - ), - serialized_pb=_b( - '\n@google/cloud/videointelligence_v1/proto/video_intelligence.proto\x12!google.cloud.videointelligence.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xfe\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\x0c\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32*.google.cloud.videointelligence.v1.FeatureB\x03\xe0\x41\x02\x12\x46\n\rvideo_context\x18\x03 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoContext\x12\x17\n\noutput_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0blocation_id\x18\x05 \x01(\tB\x03\xe0\x41\x01"\xe6\x05\n\x0cVideoContext\x12\x41\n\x08segments\x18\x01 \x03(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment\x12W\n\x16label_detection_config\x18\x02 \x01(\x0b\x32\x37.google.cloud.videointelligence.v1.LabelDetectionConfig\x12\x62\n\x1cshot_change_detection_config\x18\x03 \x01(\x0b\x32<.google.cloud.videointelligence.v1.ShotChangeDetectionConfig\x12l\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32\x41.google.cloud.videointelligence.v1.ExplicitContentDetectionConfig\x12U\n\x15\x66\x61\x63\x65_detection_config\x18\x05 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1.FaceDetectionConfig\x12\x61\n\x1bspeech_transcription_config\x18\x06 \x01(\x0b\x32<.google.cloud.videointelligence.v1.SpeechTranscriptionConfig\x12U\n\x15text_detection_config\x18\x08 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1.TextDetectionConfig\x12W\n\x16object_tracking_config\x18\r \x01(\x0b\x32\x37.google.cloud.videointelligence.v1.ObjectTrackingConfig"\xdd\x01\n\x14LabelDetectionConfig\x12S\n\x14label_detection_mode\x18\x01 \x01(\x0e\x32\x35.google.cloud.videointelligence.v1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x02 \x01(\x08\x12\r\n\x05model\x18\x03 \x01(\t\x12"\n\x1a\x66rame_confidence_threshold\x18\x04 \x01(\x02\x12"\n\x1avideo_confidence_threshold\x18\x05 \x01(\x02"*\n\x19ShotChangeDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"%\n\x14ObjectTrackingConfig\x12\r\n\x05model\x18\x01 \x01(\t"D\n\x13\x46\x61\x63\x65\x44\x65tectionConfig\x12\r\n\x05model\x18\x01 \x01(\t\x12\x1e\n\x16include_bounding_boxes\x18\x02 \x01(\x08"/\n\x1e\x45xplicitContentDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"<\n\x13TextDetectionConfig\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t\x12\r\n\x05model\x18\x02 \x01(\t"x\n\x0cVideoSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"d\n\x0cLabelSegment\x12@\n\x07segment\x18\x01 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02"P\n\nLabelFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x02 \x01(\x02"G\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t"\x94\x02\n\x0fLabelAnnotation\x12\x39\n\x06\x65ntity\x18\x01 \x01(\x0b\x32).google.cloud.videointelligence.v1.Entity\x12\x44\n\x11\x63\x61tegory_entities\x18\x02 \x03(\x0b\x32).google.cloud.videointelligence.v1.Entity\x12\x41\n\x08segments\x18\x03 \x03(\x0b\x32/.google.cloud.videointelligence.v1.LabelSegment\x12=\n\x06\x66rames\x18\x04 \x03(\x0b\x32-.google.cloud.videointelligence.v1.LabelFrame"\x95\x01\n\x14\x45xplicitContentFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12M\n\x16pornography_likelihood\x18\x02 \x01(\x0e\x32-.google.cloud.videointelligence.v1.Likelihood"d\n\x19\x45xplicitContentAnnotation\x12G\n\x06\x66rames\x18\x01 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1.ExplicitContentFrame"Q\n\x15NormalizedBoundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x02\x12\x0b\n\x03top\x18\x02 \x01(\x02\x12\r\n\x05right\x18\x03 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x02"O\n\x0b\x46\x61\x63\x65Segment\x12@\n\x07segment\x18\x01 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment"\x98\x01\n\tFaceFrame\x12[\n\x19normalized_bounding_boxes\x18\x01 \x03(\x0b\x32\x38.google.cloud.videointelligence.v1.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xa3\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\x0c\x12@\n\x08segments\x18\x02 \x03(\x0b\x32..google.cloud.videointelligence.v1.FaceSegment\x12<\n\x06\x66rames\x18\x03 \x03(\x0b\x32,.google.cloud.videointelligence.v1.FaceFrame"\xbd\x08\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12@\n\x07segment\x18\n \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment\x12U\n\x19segment_label_annotations\x18\x02 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1.LabelAnnotation\x12^\n"segment_presence_label_annotations\x18\x17 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1.LabelAnnotation\x12R\n\x16shot_label_annotations\x18\x03 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1.LabelAnnotation\x12[\n\x1fshot_presence_label_annotations\x18\x18 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1.LabelAnnotation\x12S\n\x17\x66rame_label_annotations\x18\x04 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1.LabelAnnotation\x12K\n\x10\x66\x61\x63\x65_annotations\x18\x05 \x03(\x0b\x32\x31.google.cloud.videointelligence.v1.FaceAnnotation\x12I\n\x10shot_annotations\x18\x06 \x03(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment\x12Y\n\x13\x65xplicit_annotation\x18\x07 \x01(\x0b\x32<.google.cloud.videointelligence.v1.ExplicitContentAnnotation\x12U\n\x15speech_transcriptions\x18\x0b \x03(\x0b\x32\x36.google.cloud.videointelligence.v1.SpeechTranscription\x12K\n\x10text_annotations\x18\x0c \x03(\x0b\x32\x31.google.cloud.videointelligence.v1.TextAnnotation\x12W\n\x12object_annotations\x18\x0e \x03(\x0b\x32;.google.cloud.videointelligence.v1.ObjectTrackingAnnotation\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"n\n\x15\x41nnotateVideoResponse\x12U\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1.VideoAnnotationResults"\xa6\x02\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12;\n\x07\x66\x65\x61ture\x18\x05 \x01(\x0e\x32*.google.cloud.videointelligence.v1.Feature\x12@\n\x07segment\x18\x06 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment"p\n\x15\x41nnotateVideoProgress\x12W\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32:.google.cloud.videointelligence.v1.VideoAnnotationProgress"\x81\x03\n\x19SpeechTranscriptionConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10max_alternatives\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x66ilter_profanity\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12N\n\x0fspeech_contexts\x18\x04 \x03(\x0b\x32\x30.google.cloud.videointelligence.v1.SpeechContextB\x03\xe0\x41\x01\x12)\n\x1c\x65nable_automatic_punctuation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0c\x61udio_tracks\x18\x06 \x03(\x05\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_speaker_diarization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x64iarization_speaker_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_word_confidence\x18\t \x01(\x08\x42\x03\xe0\x41\x01"%\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01"\x88\x01\n\x13SpeechTranscription\x12U\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32?.google.cloud.videointelligence.v1.SpeechRecognitionAlternative\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03"\x8c\x01\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x17\n\nconfidence\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03\x12?\n\x05words\x18\x03 \x03(\x0b\x32+.google.cloud.videointelligence.v1.WordInfoB\x03\xe0\x41\x03"\xa7\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x17\n\nconfidence\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x12\x18\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"_\n\x16NormalizedBoundingPoly\x12\x45\n\x08vertices\x18\x01 \x03(\x0b\x32\x33.google.cloud.videointelligence.v1.NormalizedVertex"\xa1\x01\n\x0bTextSegment\x12@\n\x07segment\x18\x01 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12<\n\x06\x66rames\x18\x03 \x03(\x0b\x32,.google.cloud.videointelligence.v1.TextFrame"\x94\x01\n\tTextFrame\x12W\n\x14rotated_bounding_box\x18\x01 \x01(\x0b\x32\x39.google.cloud.videointelligence.v1.NormalizedBoundingPoly\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"`\n\x0eTextAnnotation\x12\x0c\n\x04text\x18\x01 \x01(\t\x12@\n\x08segments\x18\x02 \x03(\x0b\x32..google.cloud.videointelligence.v1.TextSegment"\xa0\x01\n\x13ObjectTrackingFrame\x12Y\n\x17normalized_bounding_box\x18\x01 \x01(\x0b\x32\x38.google.cloud.videointelligence.v1.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\x97\x02\n\x18ObjectTrackingAnnotation\x12\x42\n\x07segment\x18\x03 \x01(\x0b\x32/.google.cloud.videointelligence.v1.VideoSegmentH\x00\x12\x12\n\x08track_id\x18\x05 \x01(\x03H\x00\x12\x39\n\x06\x65ntity\x18\x01 \x01(\x0b\x32).google.cloud.videointelligence.v1.Entity\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12\x46\n\x06\x66rames\x18\x02 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1.ObjectTrackingFrameB\x0c\n\ntrack_info*\xc9\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x02\x12\x1e\n\x1a\x45XPLICIT_CONTENT_DETECTION\x10\x03\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x04\x12\x18\n\x14SPEECH_TRANSCRIPTION\x10\x06\x12\x12\n\x0eTEXT_DETECTION\x10\x07\x12\x13\n\x0fOBJECT_TRACKING\x10\t*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xc0\x02\n\x18VideoIntelligenceService\x12\xcd\x01\n\rAnnotateVideo\x12\x37.google.cloud.videointelligence.v1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation"d\x82\xd3\xe4\x93\x02\x18"\x13/v1/videos:annotate:\x01*\xda\x41\x12input_uri,features\xca\x41.\n\x15\x41nnotateVideoResponse\x12\x15\x41nnotateVideoProgress\x1aT\xca\x41 videointelligence.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x8b\x02\n%com.google.cloud.videointelligence.v1B\x1dVideoIntelligenceServiceProtoP\x01ZRgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1;videointelligence\xaa\x02!Google.Cloud.VideoIntelligence.V1\xca\x02!Google\\Cloud\\VideoIntelligence\\V1\xea\x02$Google::Cloud::VideoIntelligence::V1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.videointelligence.v1.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPEECH_TRANSCRIPTION", - index=5, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=6, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_TRACKING", - index=7, - number=9, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6693, - serialized_end=6894, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name="LabelDetectionMode", - full_name="google.cloud.videointelligence.v1.LabelDetectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_MODE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FRAME_MODE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHOT_AND_FRAME_MODE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=6896, - serialized_end=7010, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.videointelligence.v1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7012, - serialized_end=7128, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -SHOT_CHANGE_DETECTION = 2 -EXPLICIT_CONTENT_DETECTION = 3 -FACE_DETECTION = 4 -SPEECH_TRANSCRIPTION = 6 -TEXT_DETECTION = 7 -OBJECT_TRACKING = 9 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="AnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.input_content", - index=1, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.features", - index=2, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_context", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.video_context", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.output_uri", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.videointelligence.v1.AnnotateVideoRequest.location_id", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=319, - serialized_end=573, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name="VideoContext", - full_name="google.cloud.videointelligence.v1.VideoContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1.VideoContext.segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1.VideoContext.label_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1.VideoContext.shot_change_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1.VideoContext.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_detection_config", - full_name="google.cloud.videointelligence.v1.VideoContext.face_detection_config", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcription_config", - full_name="google.cloud.videointelligence.v1.VideoContext.speech_transcription_config", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_detection_config", - full_name="google.cloud.videointelligence.v1.VideoContext.text_detection_config", - index=6, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_config", - full_name="google.cloud.videointelligence.v1.VideoContext.object_tracking_config", - index=7, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=576, - serialized_end=1318, -) - - -_LABELDETECTIONCONFIG = _descriptor.Descriptor( - name="LabelDetectionConfig", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label_detection_mode", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig.label_detection_mode", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig.stationary_camera", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_confidence_threshold", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig.frame_confidence_threshold", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_confidence_threshold", - full_name="google.cloud.videointelligence.v1.LabelDetectionConfig.video_confidence_threshold", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1321, - serialized_end=1542, -) - - -_SHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="ShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1.ShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.ShotChangeDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1544, - serialized_end=1586, -) - - -_OBJECTTRACKINGCONFIG = _descriptor.Descriptor( - name="ObjectTrackingConfig", - full_name="google.cloud.videointelligence.v1.ObjectTrackingConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.ObjectTrackingConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1588, - serialized_end=1625, -) - - -_FACEDETECTIONCONFIG = _descriptor.Descriptor( - name="FaceDetectionConfig", - full_name="google.cloud.videointelligence.v1.FaceDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.FaceDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_bounding_boxes", - full_name="google.cloud.videointelligence.v1.FaceDetectionConfig.include_bounding_boxes", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1627, - serialized_end=1695, -) - - -_EXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="ExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1.ExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.ExplicitContentDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1697, - serialized_end=1744, -) - - -_TEXTDETECTIONCONFIG = _descriptor.Descriptor( - name="TextDetectionConfig", - full_name="google.cloud.videointelligence.v1.TextDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.videointelligence.v1.TextDetectionConfig.language_hints", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1.TextDetectionConfig.model", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1746, - serialized_end=1806, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name="VideoSegment", - full_name="google.cloud.videointelligence.v1.VideoSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.videointelligence.v1.VideoSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.videointelligence.v1.VideoSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1808, - serialized_end=1928, -) - - -_LABELSEGMENT = _descriptor.Descriptor( - name="LabelSegment", - full_name="google.cloud.videointelligence.v1.LabelSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.LabelSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.LabelSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1930, - serialized_end=2030, -) - - -_LABELFRAME = _descriptor.Descriptor( - name="LabelFrame", - full_name="google.cloud.videointelligence.v1.LabelFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1.LabelFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.LabelFrame.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2032, - serialized_end=2112, -) - - -_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.videointelligence.v1.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.videointelligence.v1.Entity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1.Entity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1.Entity.language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2114, - serialized_end=2185, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name="LabelAnnotation", - full_name="google.cloud.videointelligence.v1.LabelAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1.LabelAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_entities", - full_name="google.cloud.videointelligence.v1.LabelAnnotation.category_entities", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1.LabelAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1.LabelAnnotation.frames", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2188, - serialized_end=2464, -) - - -_EXPLICITCONTENTFRAME = _descriptor.Descriptor( - name="ExplicitContentFrame", - full_name="google.cloud.videointelligence.v1.ExplicitContentFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1.ExplicitContentFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pornography_likelihood", - full_name="google.cloud.videointelligence.v1.ExplicitContentFrame.pornography_likelihood", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2467, - serialized_end=2616, -) - - -_EXPLICITCONTENTANNOTATION = _descriptor.Descriptor( - name="ExplicitContentAnnotation", - full_name="google.cloud.videointelligence.v1.ExplicitContentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1.ExplicitContentAnnotation.frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2618, - serialized_end=2718, -) - - -_NORMALIZEDBOUNDINGBOX = _descriptor.Descriptor( - name="NormalizedBoundingBox", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingBox", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="left", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingBox.left", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="top", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingBox.top", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="right", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingBox.right", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bottom", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingBox.bottom", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2720, - serialized_end=2801, -) - - -_FACESEGMENT = _descriptor.Descriptor( - name="FaceSegment", - full_name="google.cloud.videointelligence.v1.FaceSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.FaceSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2803, - serialized_end=2882, -) - - -_FACEFRAME = _descriptor.Descriptor( - name="FaceFrame", - full_name="google.cloud.videointelligence.v1.FaceFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_boxes", - full_name="google.cloud.videointelligence.v1.FaceFrame.normalized_bounding_boxes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1.FaceFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2885, - serialized_end=3037, -) - - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.videointelligence.v1.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="thumbnail", - full_name="google.cloud.videointelligence.v1.FaceAnnotation.thumbnail", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1.FaceAnnotation.segments", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1.FaceAnnotation.frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3040, - serialized_end=3203, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="VideoAnnotationResults", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.segment", - index=1, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_label_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.segment_label_annotations", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_presence_label_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.segment_presence_label_annotations", - index=3, - number=23, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_label_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.shot_label_annotations", - index=4, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_presence_label_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.shot_presence_label_annotations", - index=5, - number=24, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_label_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.frame_label_annotations", - index=6, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.face_annotations", - index=7, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.shot_annotations", - index=8, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.explicit_annotation", - index=9, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcriptions", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.speech_transcriptions", - index=10, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.text_annotations", - index=11, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_annotations", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.object_annotations", - index=12, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1.VideoAnnotationResults.error", - index=13, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3206, - serialized_end=4291, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="AnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1.AnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1.AnnotateVideoResponse.annotation_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4293, - serialized_end=4403, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name="VideoAnnotationProgress", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.progress_percent", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.start_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.feature", - index=4, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.VideoAnnotationProgress.segment", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4406, - serialized_end=4700, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name="AnnotateVideoProgress", - full_name="google.cloud.videointelligence.v1.AnnotateVideoProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_progress", - full_name="google.cloud.videointelligence.v1.AnnotateVideoProgress.annotation_progress", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4702, - serialized_end=4814, -) - - -_SPEECHTRANSCRIPTIONCONFIG = _descriptor.Descriptor( - name="SpeechTranscriptionConfig", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_alternatives", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.max_alternatives", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter_profanity", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.filter_profanity", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_contexts", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.speech_contexts", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_automatic_punctuation", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.enable_automatic_punctuation", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_tracks", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.audio_tracks", - index=5, - number=6, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_speaker_diarization", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.enable_speaker_diarization", - index=6, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="diarization_speaker_count", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.diarization_speaker_count", - index=7, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_word_confidence", - full_name="google.cloud.videointelligence.v1.SpeechTranscriptionConfig.enable_word_confidence", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4817, - serialized_end=5202, -) - - -_SPEECHCONTEXT = _descriptor.Descriptor( - name="SpeechContext", - full_name="google.cloud.videointelligence.v1.SpeechContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="phrases", - full_name="google.cloud.videointelligence.v1.SpeechContext.phrases", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5204, - serialized_end=5241, -) - - -_SPEECHTRANSCRIPTION = _descriptor.Descriptor( - name="SpeechTranscription", - full_name="google.cloud.videointelligence.v1.SpeechTranscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="alternatives", - full_name="google.cloud.videointelligence.v1.SpeechTranscription.alternatives", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1.SpeechTranscription.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5244, - serialized_end=5380, -) - - -_SPEECHRECOGNITIONALTERNATIVE = _descriptor.Descriptor( - name="SpeechRecognitionAlternative", - full_name="google.cloud.videointelligence.v1.SpeechRecognitionAlternative", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="transcript", - full_name="google.cloud.videointelligence.v1.SpeechRecognitionAlternative.transcript", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.SpeechRecognitionAlternative.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.videointelligence.v1.SpeechRecognitionAlternative.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5383, - serialized_end=5523, -) - - -_WORDINFO = _descriptor.Descriptor( - name="WordInfo", - full_name="google.cloud.videointelligence.v1.WordInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1.WordInfo.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.videointelligence.v1.WordInfo.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="word", - full_name="google.cloud.videointelligence.v1.WordInfo.word", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.WordInfo.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speaker_tag", - full_name="google.cloud.videointelligence.v1.WordInfo.speaker_tag", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5526, - serialized_end=5693, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.videointelligence.v1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.videointelligence.v1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.videointelligence.v1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5695, - serialized_end=5735, -) - - -_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( - name="NormalizedBoundingPoly", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.videointelligence.v1.NormalizedBoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5737, - serialized_end=5832, -) - - -_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.videointelligence.v1.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.TextSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.TextSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1.TextSegment.frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5835, - serialized_end=5996, -) - - -_TEXTFRAME = _descriptor.Descriptor( - name="TextFrame", - full_name="google.cloud.videointelligence.v1.TextFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="rotated_bounding_box", - full_name="google.cloud.videointelligence.v1.TextFrame.rotated_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1.TextFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5999, - serialized_end=6147, -) - - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.videointelligence.v1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.videointelligence.v1.TextAnnotation.text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1.TextAnnotation.segments", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6149, - serialized_end=6245, -) - - -_OBJECTTRACKINGFRAME = _descriptor.Descriptor( - name="ObjectTrackingFrame", - full_name="google.cloud.videointelligence.v1.ObjectTrackingFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_box", - full_name="google.cloud.videointelligence.v1.ObjectTrackingFrame.normalized_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1.ObjectTrackingFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6248, - serialized_end=6408, -) - - -_OBJECTTRACKINGANNOTATION = _descriptor.Descriptor( - name="ObjectTrackingAnnotation", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.segment", - index=0, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="track_id", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.track_id", - index=1, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.entity", - index=2, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.frames", - index=4, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="track_info", - full_name="google.cloud.videointelligence.v1.ObjectTrackingAnnotation.track_info", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=6411, - serialized_end=6690, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name["features"].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name["video_context"].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name[ - "label_detection_config" -].message_type = _LABELDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "shot_change_detection_config" -].message_type = _SHOTCHANGEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "explicit_content_detection_config" -].message_type = _EXPLICITCONTENTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "face_detection_config" -].message_type = _FACEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "speech_transcription_config" -].message_type = _SPEECHTRANSCRIPTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "text_detection_config" -].message_type = _TEXTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "object_tracking_config" -].message_type = _OBJECTTRACKINGCONFIG -_LABELDETECTIONCONFIG.fields_by_name[ - "label_detection_mode" -].enum_type = _LABELDETECTIONMODE -_VIDEOSEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOSEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_LABELFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["category_entities"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["segments"].message_type = _LABELSEGMENT -_LABELANNOTATION.fields_by_name["frames"].message_type = _LABELFRAME -_EXPLICITCONTENTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_EXPLICITCONTENTFRAME.fields_by_name["pornography_likelihood"].enum_type = _LIKELIHOOD -_EXPLICITCONTENTANNOTATION.fields_by_name["frames"].message_type = _EXPLICITCONTENTFRAME -_FACESEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_FACEFRAME.fields_by_name[ - "normalized_bounding_boxes" -].message_type = _NORMALIZEDBOUNDINGBOX -_FACEFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_FACEANNOTATION.fields_by_name["segments"].message_type = _FACESEGMENT -_FACEANNOTATION.fields_by_name["frames"].message_type = _FACEFRAME -_VIDEOANNOTATIONRESULTS.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_presence_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_presence_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "frame_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "face_annotations" -].message_type = _FACEANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name["shot_annotations"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "speech_transcriptions" -].message_type = _SPEECHTRANSCRIPTION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "text_annotations" -].message_type = _TEXTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "object_annotations" -].message_type = _OBJECTTRACKINGANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name["feature"].enum_type = _FEATURE -_VIDEOANNOTATIONPROGRESS.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_ANNOTATEVIDEOPROGRESS.fields_by_name[ - "annotation_progress" -].message_type = _VIDEOANNOTATIONPROGRESS -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name[ - "speech_contexts" -].message_type = _SPEECHCONTEXT -_SPEECHTRANSCRIPTION.fields_by_name[ - "alternatives" -].message_type = _SPEECHRECOGNITIONALTERNATIVE -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"].message_type = _WORDINFO -_WORDINFO.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_WORDINFO.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_NORMALIZEDBOUNDINGPOLY.fields_by_name["vertices"].message_type = _NORMALIZEDVERTEX -_TEXTSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_TEXTSEGMENT.fields_by_name["frames"].message_type = _TEXTFRAME -_TEXTFRAME.fields_by_name["rotated_bounding_box"].message_type = _NORMALIZEDBOUNDINGPOLY -_TEXTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TEXTANNOTATION.fields_by_name["segments"].message_type = _TEXTSEGMENT -_OBJECTTRACKINGFRAME.fields_by_name[ - "normalized_bounding_box" -].message_type = _NORMALIZEDBOUNDINGBOX -_OBJECTTRACKINGFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_OBJECTTRACKINGANNOTATION.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_OBJECTTRACKINGANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_OBJECTTRACKINGANNOTATION.fields_by_name["frames"].message_type = _OBJECTTRACKINGFRAME -_OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"].fields.append( - _OBJECTTRACKINGANNOTATION.fields_by_name["segment"] -) -_OBJECTTRACKINGANNOTATION.fields_by_name[ - "segment" -].containing_oneof = _OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"] -_OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"].fields.append( - _OBJECTTRACKINGANNOTATION.fields_by_name["track_id"] -) -_OBJECTTRACKINGANNOTATION.fields_by_name[ - "track_id" -].containing_oneof = _OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"] -DESCRIPTOR.message_types_by_name["AnnotateVideoRequest"] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name["VideoContext"] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name["LabelDetectionConfig"] = _LABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ShotChangeDetectionConfig" -] = _SHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["ObjectTrackingConfig"] = _OBJECTTRACKINGCONFIG -DESCRIPTOR.message_types_by_name["FaceDetectionConfig"] = _FACEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ExplicitContentDetectionConfig" -] = _EXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["TextDetectionConfig"] = _TEXTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["VideoSegment"] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["LabelSegment"] = _LABELSEGMENT -DESCRIPTOR.message_types_by_name["LabelFrame"] = _LABELFRAME -DESCRIPTOR.message_types_by_name["Entity"] = _ENTITY -DESCRIPTOR.message_types_by_name["LabelAnnotation"] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name["ExplicitContentFrame"] = _EXPLICITCONTENTFRAME -DESCRIPTOR.message_types_by_name[ - "ExplicitContentAnnotation" -] = _EXPLICITCONTENTANNOTATION -DESCRIPTOR.message_types_by_name["NormalizedBoundingBox"] = _NORMALIZEDBOUNDINGBOX -DESCRIPTOR.message_types_by_name["FaceSegment"] = _FACESEGMENT -DESCRIPTOR.message_types_by_name["FaceFrame"] = _FACEFRAME -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["VideoAnnotationResults"] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["AnnotateVideoResponse"] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name["VideoAnnotationProgress"] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoProgress"] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.message_types_by_name[ - "SpeechTranscriptionConfig" -] = _SPEECHTRANSCRIPTIONCONFIG -DESCRIPTOR.message_types_by_name["SpeechContext"] = _SPEECHCONTEXT -DESCRIPTOR.message_types_by_name["SpeechTranscription"] = _SPEECHTRANSCRIPTION -DESCRIPTOR.message_types_by_name[ - "SpeechRecognitionAlternative" -] = _SPEECHRECOGNITIONALTERNATIVE -DESCRIPTOR.message_types_by_name["WordInfo"] = _WORDINFO -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY -DESCRIPTOR.message_types_by_name["TextSegment"] = _TEXTSEGMENT -DESCRIPTOR.message_types_by_name["TextFrame"] = _TEXTFRAME -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["ObjectTrackingFrame"] = _OBJECTTRACKINGFRAME -DESCRIPTOR.message_types_by_name["ObjectTrackingAnnotation"] = _OBJECTTRACKINGANNOTATION -DESCRIPTOR.enum_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.enum_types_by_name["LabelDetectionMode"] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. If unset, the input video(s) should be - specified via ``input_uri``. If set, ``input_uri`` should be - unset. - features: - Required. Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional. Location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional. Cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.AnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType( - "VideoContext", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCONTEXT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_config: - Config for LABEL\_DETECTION. - shot_change_detection_config: - Config for SHOT\_CHANGE\_DETECTION. - explicit_content_detection_config: - Config for EXPLICIT\_CONTENT\_DETECTION. - face_detection_config: - Config for FACE\_DETECTION. - speech_transcription_config: - Config for SPEECH\_TRANSCRIPTION. - text_detection_config: - Config for TEXT\_DETECTION. - object_tracking_config: - Config for OBJECT\_TRACKING. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.VideoContext) - ), -) -_sym_db.RegisterMessage(VideoContext) - -LabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "LabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for LABEL\_DETECTION. - - - Attributes: - label_detection_mode: - What labels should be detected with LABEL\_DETECTION, in - addition to video-level labels or segment-level labels. If - unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. Should be used with - ``SHOT_AND_FRAME_MODE`` enabled. - model: - Model to use for label detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - frame_confidence_threshold: - The confidence threshold we perform filtering on the labels - from frame-level detection. If not set, it is set to 0.4 by - default. The valid range for this threshold is [0.1, 0.9]. Any - value set outside of this range will be clipped. Note: for - best results please follow the default threshold. We will - update the default threshold everytime when we release a new - model. - video_confidence_threshold: - The confidence threshold we perform filtering on the labels - from video-level and shot-level detections. If not set, it is - set to 0.3 by default. The valid range for this threshold is - [0.1, 0.9]. Any value set outside of this range will be - clipped. Note: for best results please follow the default - threshold. We will update the default threshold everytime when - we release a new model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.LabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(LabelDetectionConfig) - -ShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for SHOT\_CHANGE\_DETECTION. - - - Attributes: - model: - Model to use for shot change detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(ShotChangeDetectionConfig) - -ObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for OBJECT\_TRACKING. - - - Attributes: - model: - Model to use for object tracking. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ObjectTrackingConfig) - ), -) -_sym_db.RegisterMessage(ObjectTrackingConfig) - -FaceDetectionConfig = _reflection.GeneratedProtocolMessageType( - "FaceDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_FACEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for FACE\_DETECTION. - - - Attributes: - model: - Model to use for face detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - include_bounding_boxes: - Whether bounding boxes be included in the face annotation - output. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.FaceDetectionConfig) - ), -) -_sym_db.RegisterMessage(FaceDetectionConfig) - -ExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for EXPLICIT\_CONTENT\_DETECTION. - - - Attributes: - model: - Model to use for explicit content detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(ExplicitContentDetectionConfig) - -TextDetectionConfig = _reflection.GeneratedProtocolMessageType( - "TextDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for TEXT\_DETECTION. - - - Attributes: - language_hints: - Language hint can be specified if the language to be detected - is known a priori. It can increase the accuracy of the - detection. Language hint must be language code in BCP-47 - format. Automatic language detection is performed if no hint - is provided. - model: - Model to use for text detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.TextDetectionConfig) - ), -) -_sym_db.RegisterMessage(TextDetectionConfig) - -VideoSegment = _reflection.GeneratedProtocolMessageType( - "VideoSegment", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOSEGMENT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video segment. - - - Attributes: - start_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the start of the segment (inclusive). - end_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the end of the segment (inclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.VideoSegment) - ), -) -_sym_db.RegisterMessage(VideoSegment) - -LabelSegment = _reflection.GeneratedProtocolMessageType( - "LabelSegment", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSEGMENT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for label detection. - - - Attributes: - segment: - Video segment where a label was detected. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.LabelSegment) - ), -) -_sym_db.RegisterMessage(LabelSegment) - -LabelFrame = _reflection.GeneratedProtocolMessageType( - "LabelFrame", - (_message.Message,), - dict( - DESCRIPTOR=_LABELFRAME, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for label detection. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.LabelFrame) - ), -) -_sym_db.RegisterMessage(LabelFrame) - -Entity = _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITY, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Detected entity from video analysis. - - - Attributes: - entity_id: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.Entity) - ), -) -_sym_db.RegisterMessage(Entity) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType( - "LabelAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LABELANNOTATION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Label annotation. - - - Attributes: - entity: - Detected entity. - category_entities: - Common categories for the detected entity. E.g. when the label - is ``Terrier`` the category is likely ``dog``. And in some - cases there might be more than one categories e.g. ``Terrier`` - could also be a ``pet``. - segments: - All video segments where a label was detected. - frames: - All video frames where a label was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.LabelAnnotation) - ), -) -_sym_db.RegisterMessage(LabelAnnotation) - -ExplicitContentFrame = _reflection.GeneratedProtocolMessageType( - "ExplicitContentFrame", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTFRAME, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for explicit content. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - pornography_likelihood: - Likelihood of the pornography content.. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ExplicitContentFrame) - ), -) -_sym_db.RegisterMessage(ExplicitContentFrame) - -ExplicitContentAnnotation = _reflection.GeneratedProtocolMessageType( - "ExplicitContentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTANNOTATION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Explicit content annotation (based on per-frame visual signals only). If - no explicit content has been detected in a frame, no annotations are - present for that frame. - - - Attributes: - frames: - All video frames where explicit content was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ExplicitContentAnnotation) - ), -) -_sym_db.RegisterMessage(ExplicitContentAnnotation) - -NormalizedBoundingBox = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingBox", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGBOX, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding box. The normalized vertex coordinates are relative - to the original image. Range: [0, 1]. - - - Attributes: - left: - Left X coordinate. - top: - Top Y coordinate. - right: - Right X coordinate. - bottom: - Bottom Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.NormalizedBoundingBox) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingBox) - -FaceSegment = _reflection.GeneratedProtocolMessageType( - "FaceSegment", - (_message.Message,), - dict( - DESCRIPTOR=_FACESEGMENT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for face detection. - - - Attributes: - segment: - Video segment where a face was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.FaceSegment) - ), -) -_sym_db.RegisterMessage(FaceSegment) - -FaceFrame = _reflection.GeneratedProtocolMessageType( - "FaceFrame", - (_message.Message,), - dict( - DESCRIPTOR=_FACEFRAME, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for face detection. - - - Attributes: - normalized_bounding_boxes: - Normalized Bounding boxes in a frame. There can be more than - one boxes if the same face is detected in multiple locations - within the current frame. - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.FaceFrame) - ), -) -_sym_db.RegisterMessage(FaceFrame) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Face annotation. - - - Attributes: - thumbnail: - Thumbnail of a representative face view (in JPEG format). - segments: - All video segments where a face was detected. - frames: - All video frames where a face was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Annotation results for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - segment: - Video segment on which the annotation is run. - segment_label_annotations: - Topical label annotations on video level or user specified - segment level. There is exactly one element for each unique - label. - segment_presence_label_annotations: - Presence label annotations on video level or user specified - segment level. There is exactly one element for each unique - label. Compared to the existing topical - ``segment_label_annotations``, this field presents more fine- - grained, segment-level labels detected in video content and is - made available only when the client sets - ``LabelDetectionConfig.model`` to "builtin/latest" in the - request. - shot_label_annotations: - Topical label annotations on shot level. There is exactly one - element for each unique label. - shot_presence_label_annotations: - Presence label annotations on shot level. There is exactly one - element for each unique label. Compared to the existing - topical ``shot_label_annotations``, this field presents more - fine-grained, shot-level labels detected in video content and - is made available only when the client sets - ``LabelDetectionConfig.model`` to "builtin/latest" in the - request. - frame_label_annotations: - Label annotations on frame level. There is exactly one element - for each unique label. - face_annotations: - Face annotations. There is exactly one element for each unique - face. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - explicit_annotation: - Explicit content annotation. - speech_transcriptions: - Speech transcription. - text_annotations: - OCR text detection and tracking. Annotations for list of - detected text snippets. Each will have list of frame - information associated with it. - object_annotations: - Annotations for list of objects detected and tracked in video. - error: - If set, indicates an error. Note that for a single - ``AnnotateVideoRequest`` some videos may succeed and some may - fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.VideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.AnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationProgress", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONPROGRESS, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Annotation progress for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - progress_percent: - Approximate percentage processed thus far. Guaranteed to be - 100 when fully processed. - start_time: - Time when the request was received. - update_time: - Time of the most recent update. - feature: - Specifies which feature is being tracked if the request - contains more than one features. - segment: - Specifies which segment is being tracked if the request - contains more than one segments. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.VideoAnnotationProgress) - ), -) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoProgress", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOPROGRESS, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.AnnotateVideoProgress) - ), -) -_sym_db.RegisterMessage(AnnotateVideoProgress) - -SpeechTranscriptionConfig = _reflection.GeneratedProtocolMessageType( - "SpeechTranscriptionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTIONCONFIG, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Config for SPEECH\_TRANSCRIPTION. - - - Attributes: - language_code: - Required. *Required* The language of the supplied audio as a - `BCP-47 `__ - language tag. Example: "en-US". See `Language Support - `__ for a list - of the currently supported language codes. - max_alternatives: - Optional. Maximum number of recognition hypotheses to be - returned. Specifically, the maximum number of - ``SpeechRecognitionAlternative`` messages within each - ``SpeechTranscription``. The server may return fewer than - ``max_alternatives``. Valid values are ``0``-``30``. A value - of ``0`` or ``1`` will return a maximum of one. If omitted, - will return a maximum of one. - filter_profanity: - Optional. If set to ``true``, the server will attempt to - filter out profanities, replacing all but the initial - character in each filtered word with asterisks, e.g. - "f\*\*\*". If set to ``false`` or omitted, profanities won't - be filtered out. - speech_contexts: - Optional. A means to provide context to assist the speech - recognition. - enable_automatic_punctuation: - Optional. If 'true', adds punctuation to recognition result - hypotheses. This feature is only available in select - languages. Setting this for requests in other languages has no - effect at all. The default 'false' value does not add - punctuation to result hypotheses. NOTE: "This is currently - offered as an experimental service, complimentary to all - users. In the future this may be exclusively available as a - premium feature." - audio_tracks: - Optional. For file formats, such as MXF or MKV, supporting - multiple audio tracks, specify up to two tracks. Default: - track 0. - enable_speaker_diarization: - Optional. If 'true', enables speaker detection for each - recognized word in the top alternative of the recognition - result using a speaker\_tag provided in the WordInfo. Note: - When this is true, we send all the words from the beginning of - the audio for the top alternative in every consecutive - responses. This is done in order to improve our speaker tags - as our models learn to identify the speakers in the - conversation over time. - diarization_speaker_count: - Optional. If set, specifies the estimated number of speakers - in the conversation. If not set, defaults to '2'. Ignored - unless enable\_speaker\_diarization is set to true. - enable_word_confidence: - Optional. If ``true``, the top result includes a list of words - and the confidence for those words. If ``false``, no word- - level confidence information is returned. The default is - ``false``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.SpeechTranscriptionConfig) - ), -) -_sym_db.RegisterMessage(SpeechTranscriptionConfig) - -SpeechContext = _reflection.GeneratedProtocolMessageType( - "SpeechContext", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHCONTEXT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Provides "hints" to the speech recognizer to favor specific words and - phrases in the results. - - - Attributes: - phrases: - Optional. A list of strings containing words and phrases - "hints" so that the speech recognition is more likely to - recognize them. This can be used to improve the accuracy for - specific words and phrases, for example, if specific commands - are typically spoken by the user. This can also be used to add - additional words to the vocabulary of the recognizer. See - `usage limits - `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.SpeechContext) - ), -) -_sym_db.RegisterMessage(SpeechContext) - -SpeechTranscription = _reflection.GeneratedProtocolMessageType( - "SpeechTranscription", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""A speech recognition result corresponding to a portion of the audio. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - language_code: - Output only. The `BCP-47 `__ language tag of the language - in this result. This language code was detected to have the - most likelihood of being spoken in the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.SpeechTranscription) - ), -) -_sym_db.RegisterMessage(SpeechTranscription) - -SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionAlternative", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONALTERNATIVE, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Alternative hypotheses (a.k.a. n-best list). - - - Attributes: - transcript: - Transcript text representing the words that the user spoke. - confidence: - Output only. The confidence estimate between 0.0 and 1.0. A - higher number indicates an estimated greater likelihood that - the recognized words are correct. This field is set only for - the top alternative. This field is not guaranteed to be - accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - words: - Output only. A list of word-specific information for each - recognized word. Note: When ``enable_speaker_diarization`` is - true, you will see all the words from the beginning of the - audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.SpeechRecognitionAlternative) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionAlternative) - -WordInfo = _reflection.GeneratedProtocolMessageType( - "WordInfo", - (_message.Message,), - dict( - DESCRIPTOR=_WORDINFO, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Word-specific information for recognized words. Word information is only - included in the response when certain request parameters are set, such - as ``enable_word_time_offsets``. - - - Attributes: - start_time: - Time offset relative to the beginning of the audio, and - corresponding to the start of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - end_time: - Time offset relative to the beginning of the audio, and - corresponding to the end of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - word: - The word corresponding to this set of information. - confidence: - Output only. The confidence estimate between 0.0 and 1.0. A - higher number indicates an estimated greater likelihood that - the recognized words are correct. This field is set only for - the top alternative. This field is not guaranteed to be - accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - speaker_tag: - Output only. A distinct integer value is assigned for every - speaker within the audio. This field specifies which one of - those speakers was detected to have spoken this word. Value - ranges from 1 up to diarization\_speaker\_count, and is only - set if speaker diarization is enabled. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.WordInfo) - ), -) -_sym_db.RegisterMessage(WordInfo) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding polygon for text (that might not be aligned with - axis). Contains list of the corner points in clockwise order starting - from top-left corner. For example, for a rectangular bounding box: When - the text is horizontal it might look like: 0----1 \| \| 3----2 - - When it's clockwise rotated 180 degrees around the top-left corner it - becomes: 2----3 \| \| 1----0 - - and the vertex order will still be (0, 1, 2, 3). Note that values can be - less than 0, or greater than 1 due to trignometric calculations for - location of the box. - - - Attributes: - vertices: - Normalized vertices of the bounding polygon. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.NormalizedBoundingPoly) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingPoly) - -TextSegment = _reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSEGMENT, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for text detection. - - - Attributes: - segment: - Video segment where a text snippet was detected. - confidence: - Confidence for the track of detected text. It is calculated as - the highest over all frames where OCR detected text appears. - frames: - Information related to the frames where OCR detected text - appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.TextSegment) - ), -) -_sym_db.RegisterMessage(TextSegment) - -TextFrame = _reflection.GeneratedProtocolMessageType( - "TextFrame", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTFRAME, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for text annotation (OCR). Contains - information regarding timestamp and bounding box locations for the - frames containing detected OCR text snippets. - - - Attributes: - rotated_bounding_box: - Bounding polygon of the detected text for this frame. - time_offset: - Timestamp of this frame. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.TextFrame) - ), -) -_sym_db.RegisterMessage(TextFrame) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Annotations related to one detected OCR text snippet. This will contain - the corresponding text, confidence value, and frame level information - for each detection. - - - Attributes: - text: - The detected text. - segments: - All video segments where OCR detected text appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) - -ObjectTrackingFrame = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingFrame", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGFRAME, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotations for object detection and tracking. This - field stores per frame location, time offset, and confidence. - - - Attributes: - normalized_bounding_box: - The normalized bounding box location of this object track for - the frame. - time_offset: - The timestamp of the frame in microseconds. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ObjectTrackingFrame) - ), -) -_sym_db.RegisterMessage(ObjectTrackingFrame) - -ObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGANNOTATION, - __module__="google.cloud.videointelligence_v1.proto.video_intelligence_pb2", - __doc__="""Annotations corresponding to one tracked object. - - - Attributes: - track_info: - Different representation of tracking info in non-streaming - batch and streaming modes. - segment: - Non-streaming batch mode ONLY. Each object track corresponds - to one video segment where it appears. - track_id: - Streaming mode ONLY. In streaming mode, we do not know the end - time of a tracked object before it is completed. Hence, there - is no VideoSegment info returned. Instead, we provide a unique - identifiable integer track\_id so that the customers can - correlate the results of the ongoing ObjectTrackAnnotation of - the same track\_id over time. - entity: - Entity to specify the object category that this track is - labeled as. - confidence: - Object category's labeling confidence of this track. - frames: - Information corresponding to all frames where this object - track appears. Non-streaming batch mode: it may be one or - multiple ObjectTrackingFrame messages in frames. Streaming - mode: it can only be one ObjectTrackingFrame message in - frames. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1.ObjectTrackingAnnotation) - ), -) -_sym_db.RegisterMessage(ObjectTrackingAnnotation) - - -DESCRIPTOR._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["features"]._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["output_uri"]._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["location_id"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["language_code"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["max_alternatives"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["filter_profanity"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["speech_contexts"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name[ - "enable_automatic_punctuation" -]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["audio_tracks"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["enable_speaker_diarization"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["diarization_speaker_count"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["enable_word_confidence"]._options = None -_SPEECHCONTEXT.fields_by_name["phrases"]._options = None -_SPEECHTRANSCRIPTION.fields_by_name["language_code"]._options = None -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["confidence"]._options = None -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"]._options = None -_WORDINFO.fields_by_name["confidence"]._options = None -_WORDINFO.fields_by_name["speaker_tag"]._options = None - -_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="VideoIntelligenceService", - full_name="google.cloud.videointelligence.v1.VideoIntelligenceService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A videointelligence.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=7131, - serialized_end=7451, - methods=[ - _descriptor.MethodDescriptor( - name="AnnotateVideo", - full_name="google.cloud.videointelligence.v1.VideoIntelligenceService.AnnotateVideo", - index=0, - containing_service=None, - input_type=_ANNOTATEVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\030"\023/v1/videos:annotate:\001*\332A\022input_uri,features\312A.\n\025AnnotateVideoResponse\022\025AnnotateVideoProgress' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name["VideoIntelligenceService"] = _VIDEOINTELLIGENCESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2_grpc.py deleted file mode 100644 index 672a18eb9f42..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/proto/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.videointelligence_v1.proto import ( - video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1_dot_proto_dot_video__intelligence__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - "/google.cloud.videointelligence.v1.VideoIntelligenceService/AnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AnnotateVideo": grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1.VideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1/types.py b/videointelligence/google/cloud/videointelligence_v1/types.py deleted file mode 100644 index 6603682edcba..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.videointelligence_v1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [video_intelligence_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.videointelligence_v1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta2/__init__.py deleted file mode 100644 index c180603ffc35..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1beta2 import types -from google.cloud.videointelligence_v1beta2.gapic import enums -from google.cloud.videointelligence_v1beta2.gapic import ( - video_intelligence_service_client, -) - - -class VideoIntelligenceServiceClient( - video_intelligence_service_client.VideoIntelligenceServiceClient -): - __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "VideoIntelligenceServiceClient") diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/enums.py deleted file mode 100644 index 57070f93e4bc..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/enums.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Feature(enum.IntEnum): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - SHOT_CHANGE_DETECTION (int): Shot change detection. - EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - FACE_DETECTION (int): Human face detection and tracking. - """ - - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - SHOT_CHANGE_DETECTION = 2 - EXPLICIT_CONTENT_DETECTION = 3 - FACE_DETECTION = 4 - - -class LabelDetectionMode(enum.IntEnum): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(enum.IntEnum): - """ - Bucketized representation of likelihood. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/video_intelligence_service_grpc_transport.py deleted file mode 100644 index 0da1802284c3..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/transports/video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.videointelligence_v1beta2.proto import video_intelligence_pb2_grpc - - -class VideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1beta2 VideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "video_intelligence_service_stub": video_intelligence_pb2_grpc.VideoIntelligenceServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def annotate_video(self): - """Return the gRPC stub for :meth:`VideoIntelligenceServiceClient.annotate_video`. - - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["video_intelligence_service_stub"].AnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client.py deleted file mode 100644 index 1356475fea0a..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client.py +++ /dev/null @@ -1,306 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1beta2 VideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.videointelligence_v1beta2.gapic import enums -from google.cloud.videointelligence_v1beta2.gapic import ( - video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1beta2.gapic.transports import ( - video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1beta2.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1beta2.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.videointelligence.v1beta2.VideoIntelligenceService" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - VideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.VideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.VideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def annotate_video( - self, - input_uri=None, - input_content=None, - features=None, - video_context=None, - output_uri=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud import videointelligence_v1beta2 - >>> from google.cloud.videointelligence_v1beta2 import enums - >>> - >>> client = videointelligence_v1beta2.VideoIntelligenceServiceClient() - >>> - >>> input_uri = 'gs://cloud-samples-data/video/cat.mp4' - >>> features_element = enums.Feature.LABEL_DETECTION - >>> features = [features_element] - >>> - >>> response = client.annotate_video(input_uri=input_uri, features=features) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (str): Input video location. Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. A video - URI may include wildcards in ``object-id``, and thus identify multiple - videos. Supported wildcards: '\*' to match 0 or more characters; '?' to - match 1 character. If unset, the input video should be embedded in the - request as ``input_content``. If set, ``input_content`` should be unset. - input_content (bytes): The video data bytes. If unset, the input video(s) should be specified - via ``input_uri``. If set, ``input_uri`` should be unset. - features (list[~google.cloud.videointelligence_v1beta2.types.Feature]): Requested video annotation features. - video_context (Union[dict, ~google.cloud.videointelligence_v1beta2.types.VideoContext]): Additional video context and/or feature-specific parameters. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.videointelligence_v1beta2.types.VideoContext` - output_uri (str): Optional location where the output (in JSON format) should be stored. - Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. - location_id (str): Optional cloud region where annotation should take place. Supported - cloud regions: ``us-east1``, ``us-west1``, ``europe-west1``, - ``asia-east1``. If no region is specified, a region will be determined - based on video file location. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.videointelligence_v1beta2.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.annotate_video, - default_retry=self._method_configs["AnnotateVideo"].retry, - default_timeout=self._method_configs["AnnotateVideo"].timeout, - client_info=self._client_info, - ) - - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - input_content=input_content, - features=features, - video_context=video_context, - output_uri=output_uri, - location_id=location_id, - ) - operation = self._inner_api_calls["annotate_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - metadata_type=video_intelligence_pb2.AnnotateVideoProgress, - ) diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client_config.py deleted file mode 100644 index 9bae7bc23bed..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/gapic/video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1beta2.VideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.5, - "max_retry_delay_millis": 120000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta2/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence.proto b/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence.proto deleted file mode 100644 index a69c25791e17..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence.proto +++ /dev/null @@ -1,396 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.videointelligence.v1beta2; - -import "google/api/annotations.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.VideoIntelligence.V1Beta2"; -option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence"; -option java_multiple_files = true; -option java_outer_classname = "VideoIntelligenceServiceProto"; -option java_package = "com.google.cloud.videointelligence.v1beta2"; -option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1beta2"; -option ruby_package = "Google::Cloud::VideoIntelligence::V1beta2"; - -// Service that implements Google Cloud Video Intelligence API. -service VideoIntelligenceService { - // Performs asynchronous video annotation. Progress and results can be - // retrieved through the `google.longrunning.Operations` interface. - // `Operation.metadata` contains `AnnotateVideoProgress` (progress). - // `Operation.response` contains `AnnotateVideoResponse` (results). - rpc AnnotateVideo(AnnotateVideoRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1beta2/videos:annotate" - body: "*" - }; - } -} - -// Video annotation request. -message AnnotateVideoRequest { - // Input video location. Currently, only - // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are - // supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). A video - // URI may include wildcards in `object-id`, and thus identify multiple - // videos. Supported wildcards: '*' to match 0 or more characters; - // '?' to match 1 character. If unset, the input video should be embedded - // in the request as `input_content`. If set, `input_content` should be unset. - string input_uri = 1; - - // The video data bytes. - // If unset, the input video(s) should be specified via `input_uri`. - // If set, `input_uri` should be unset. - bytes input_content = 6; - - // Requested video annotation features. - repeated Feature features = 2; - - // Additional video context and/or feature-specific parameters. - VideoContext video_context = 3; - - // Optional location where the output (in JSON format) should be stored. - // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - // URIs are supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). - string output_uri = 4; - - // Optional cloud region where annotation should take place. Supported cloud - // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - // is specified, a region will be determined based on video file location. - string location_id = 5; -} - -// Video context and/or feature-specific parameters. -message VideoContext { - // Video segments to annotate. The segments may overlap and are not required - // to be contiguous or span the whole video. If unspecified, each video - // is treated as a single segment. - repeated VideoSegment segments = 1; - - // Config for LABEL_DETECTION. - LabelDetectionConfig label_detection_config = 2; - - // Config for SHOT_CHANGE_DETECTION. - ShotChangeDetectionConfig shot_change_detection_config = 3; - - // Config for EXPLICIT_CONTENT_DETECTION. - ExplicitContentDetectionConfig explicit_content_detection_config = 4; - - // Config for FACE_DETECTION. - FaceDetectionConfig face_detection_config = 5; -} - -// Config for LABEL_DETECTION. -message LabelDetectionConfig { - // What labels should be detected with LABEL_DETECTION, in addition to - // video-level labels or segment-level labels. - // If unspecified, defaults to `SHOT_MODE`. - LabelDetectionMode label_detection_mode = 1; - - // Whether the video has been shot from a stationary (i.e. non-moving) camera. - // When set to true, might improve detection accuracy for moving objects. - // Should be used with `SHOT_AND_FRAME_MODE` enabled. - bool stationary_camera = 2; - - // Model to use for label detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// Config for SHOT_CHANGE_DETECTION. -message ShotChangeDetectionConfig { - // Model to use for shot change detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for EXPLICIT_CONTENT_DETECTION. -message ExplicitContentDetectionConfig { - // Model to use for explicit content detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for FACE_DETECTION. -message FaceDetectionConfig { - // Model to use for face detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; - - // Whether bounding boxes be included in the face annotation output. - bool include_bounding_boxes = 2; -} - -// Video segment. -message VideoSegment { - // Time-offset, relative to the beginning of the video, - // corresponding to the start of the segment (inclusive). - google.protobuf.Duration start_time_offset = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the end of the segment (inclusive). - google.protobuf.Duration end_time_offset = 2; -} - -// Video segment level annotation results for label detection. -message LabelSegment { - // Video segment where a label was detected. - VideoSegment segment = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Video frame level annotation results for label detection. -message LabelFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Detected entity from video analysis. -message Entity { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string entity_id = 1; - - // Textual description, e.g. `Fixed-gear bicycle`. - string description = 2; - - // Language code for `description` in BCP-47 format. - string language_code = 3; -} - -// Label annotation. -message LabelAnnotation { - // Detected entity. - Entity entity = 1; - - // Common categories for the detected entity. - // E.g. when the label is `Terrier` the category is likely `dog`. And in some - // cases there might be more than one categories e.g. `Terrier` could also be - // a `pet`. - repeated Entity category_entities = 2; - - // All video segments where a label was detected. - repeated LabelSegment segments = 3; - - // All video frames where a label was detected. - repeated LabelFrame frames = 4; -} - -// Video frame level annotation results for explicit content. -message ExplicitContentFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Likelihood of the pornography content.. - Likelihood pornography_likelihood = 2; -} - -// Explicit content annotation (based on per-frame visual signals only). -// If no explicit content has been detected in a frame, no annotations are -// present for that frame. -message ExplicitContentAnnotation { - // All video frames where explicit content was detected. - repeated ExplicitContentFrame frames = 1; -} - -// Normalized bounding box. -// The normalized vertex coordinates are relative to the original image. -// Range: [0, 1]. -message NormalizedBoundingBox { - // Left X coordinate. - float left = 1; - - // Top Y coordinate. - float top = 2; - - // Right X coordinate. - float right = 3; - - // Bottom Y coordinate. - float bottom = 4; -} - -// Video segment level annotation results for face detection. -message FaceSegment { - // Video segment where a face was detected. - VideoSegment segment = 1; -} - -// Video frame level annotation results for face detection. -message FaceFrame { - // Normalized Bounding boxes in a frame. - // There can be more than one boxes if the same face is detected in multiple - // locations within the current frame. - repeated NormalizedBoundingBox normalized_bounding_boxes = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the video frame for this location. - google.protobuf.Duration time_offset = 2; -} - -// Face annotation. -message FaceAnnotation { - // Thumbnail of a representative face view (in JPEG format). - bytes thumbnail = 1; - - // All video segments where a face was detected. - repeated FaceSegment segments = 2; - - // All video frames where a face was detected. - repeated FaceFrame frames = 3; -} - -// Annotation results for a single video. -message VideoAnnotationResults { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. - repeated LabelAnnotation segment_label_annotations = 2; - - // Label annotations on shot level. - // There is exactly one element for each unique label. - repeated LabelAnnotation shot_label_annotations = 3; - - // Label annotations on frame level. - // There is exactly one element for each unique label. - repeated LabelAnnotation frame_label_annotations = 4; - - // Face annotations. There is exactly one element for each unique face. - repeated FaceAnnotation face_annotations = 5; - - // Shot annotations. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 6; - - // Explicit content annotation. - ExplicitContentAnnotation explicit_annotation = 7; - - // If set, indicates an error. Note that for a single `AnnotateVideoRequest` - // some videos may succeed and some may fail. - google.rpc.Status error = 9; -} - -// Video annotation response. Included in the `response` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoResponse { - // Annotation results for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationResults annotation_results = 1; -} - -// Annotation progress for a single video. -message VideoAnnotationProgress { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Approximate percentage processed thus far. - // Guaranteed to be 100 when fully processed. - int32 progress_percent = 2; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 3; - - // Time of the most recent update. - google.protobuf.Timestamp update_time = 4; -} - -// Video annotation progress. Included in the `metadata` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoProgress { - // Progress metadata for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationProgress annotation_progress = 1; -} - -// Video annotation feature. -enum Feature { - // Unspecified. - FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - LABEL_DETECTION = 1; - - // Shot change detection. - SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - EXPLICIT_CONTENT_DETECTION = 3; - - // Human face detection and tracking. - FACE_DETECTION = 4; -} - -// Label detection mode. -enum LabelDetectionMode { - // Unspecified. - LABEL_DETECTION_MODE_UNSPECIFIED = 0; - - // Detect shot-level labels. - SHOT_MODE = 1; - - // Detect frame-level labels. - FRAME_MODE = 2; - - // Detect both shot-level and frame-level labels. - SHOT_AND_FRAME_MODE = 3; -} - -// Bucketized representation of likelihood. -enum Likelihood { - // Unspecified likelihood. - LIKELIHOOD_UNSPECIFIED = 0; - - // Very unlikely. - VERY_UNLIKELY = 1; - - // Unlikely. - UNLIKELY = 2; - - // Possible. - POSSIBLE = 3; - - // Likely. - LIKELY = 4; - - // Very likely. - VERY_LIKELY = 5; -} diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2.py deleted file mode 100644 index 871a229e0460..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2.py +++ /dev/null @@ -1,2321 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/videointelligence_v1beta2/proto/video_intelligence.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/videointelligence_v1beta2/proto/video_intelligence.proto", - package="google.cloud.videointelligence.v1beta2", - syntax="proto3", - serialized_options=_b( - "\n*com.google.cloud.videointelligence.v1beta2B\035VideoIntelligenceServiceProtoP\001ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence\252\002&Google.Cloud.VideoIntelligence.V1Beta2\312\002&Google\\Cloud\\VideoIntelligence\\V1beta2\352\002)Google::Cloud::VideoIntelligence::V1beta2" - ), - serialized_pb=_b( - '\nEgoogle/cloud/videointelligence_v1beta2/proto/video_intelligence.proto\x12&google.cloud.videointelligence.v1beta2\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xf9\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\x0c\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32/.google.cloud.videointelligence.v1beta2.Feature\x12K\n\rvideo_context\x18\x03 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"\xec\x03\n\x0cVideoContext\x12\x46\n\x08segments\x18\x01 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.VideoSegment\x12\\\n\x16label_detection_config\x18\x02 \x01(\x0b\x32<.google.cloud.videointelligence.v1beta2.LabelDetectionConfig\x12g\n\x1cshot_change_detection_config\x18\x03 \x01(\x0b\x32\x41.google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig\x12q\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32\x46.google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig\x12Z\n\x15\x66\x61\x63\x65_detection_config\x18\x05 \x01(\x0b\x32;.google.cloud.videointelligence.v1beta2.FaceDetectionConfig"\x9a\x01\n\x14LabelDetectionConfig\x12X\n\x14label_detection_mode\x18\x01 \x01(\x0e\x32:.google.cloud.videointelligence.v1beta2.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x02 \x01(\x08\x12\r\n\x05model\x18\x03 \x01(\t"*\n\x19ShotChangeDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"/\n\x1e\x45xplicitContentDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"D\n\x13\x46\x61\x63\x65\x44\x65tectionConfig\x12\r\n\x05model\x18\x01 \x01(\t\x12\x1e\n\x16include_bounding_boxes\x18\x02 \x01(\x08"x\n\x0cVideoSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"i\n\x0cLabelSegment\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02"P\n\nLabelFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x02 \x01(\x02"G\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t"\xa8\x02\n\x0fLabelAnnotation\x12>\n\x06\x65ntity\x18\x01 \x01(\x0b\x32..google.cloud.videointelligence.v1beta2.Entity\x12I\n\x11\x63\x61tegory_entities\x18\x02 \x03(\x0b\x32..google.cloud.videointelligence.v1beta2.Entity\x12\x46\n\x08segments\x18\x03 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.LabelSegment\x12\x42\n\x06\x66rames\x18\x04 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1beta2.LabelFrame"\x9a\x01\n\x14\x45xplicitContentFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12R\n\x16pornography_likelihood\x18\x02 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta2.Likelihood"i\n\x19\x45xplicitContentAnnotation\x12L\n\x06\x66rames\x18\x01 \x03(\x0b\x32<.google.cloud.videointelligence.v1beta2.ExplicitContentFrame"Q\n\x15NormalizedBoundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x02\x12\x0b\n\x03top\x18\x02 \x01(\x02\x12\r\n\x05right\x18\x03 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x02"T\n\x0b\x46\x61\x63\x65Segment\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.VideoSegment"\x9d\x01\n\tFaceFrame\x12`\n\x19normalized_bounding_boxes\x18\x01 \x03(\x0b\x32=.google.cloud.videointelligence.v1beta2.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xad\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\x0c\x12\x45\n\x08segments\x18\x02 \x03(\x0b\x32\x33.google.cloud.videointelligence.v1beta2.FaceSegment\x12\x41\n\x06\x66rames\x18\x03 \x03(\x0b\x32\x31.google.cloud.videointelligence.v1beta2.FaceFrame"\xdf\x04\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12Z\n\x19segment_label_annotations\x18\x02 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta2.LabelAnnotation\x12W\n\x16shot_label_annotations\x18\x03 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta2.LabelAnnotation\x12X\n\x17\x66rame_label_annotations\x18\x04 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta2.LabelAnnotation\x12P\n\x10\x66\x61\x63\x65_annotations\x18\x05 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1beta2.FaceAnnotation\x12N\n\x10shot_annotations\x18\x06 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta2.VideoSegment\x12^\n\x13\x65xplicit_annotation\x18\x07 \x01(\x0b\x32\x41.google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"s\n\x15\x41nnotateVideoResponse\x12Z\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1beta2.VideoAnnotationResults"\xa7\x01\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"u\n\x15\x41nnotateVideoProgress\x12\\\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32?.google.cloud.videointelligence.v1beta2.VideoAnnotationProgress*\x86\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x02\x12\x1e\n\x1a\x45XPLICIT_CONTENT_DETECTION\x10\x03\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x04*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xae\x01\n\x18VideoIntelligenceService\x12\x91\x01\n\rAnnotateVideo\x12<.google.cloud.videointelligence.v1beta2.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation"#\x82\xd3\xe4\x93\x02\x1d"\x18/v1beta2/videos:annotate:\x01*B\xa4\x02\n*com.google.cloud.videointelligence.v1beta2B\x1dVideoIntelligenceServiceProtoP\x01ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta2;videointelligence\xaa\x02&Google.Cloud.VideoIntelligence.V1Beta2\xca\x02&Google\\Cloud\\VideoIntelligence\\V1beta2\xea\x02)Google::Cloud::VideoIntelligence::V1beta2b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.videointelligence.v1beta2.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3806, - serialized_end=3940, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name="LabelDetectionMode", - full_name="google.cloud.videointelligence.v1beta2.LabelDetectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_MODE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FRAME_MODE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHOT_AND_FRAME_MODE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3942, - serialized_end=4056, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.videointelligence.v1beta2.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4058, - serialized_end=4174, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -SHOT_CHANGE_DETECTION = 2 -EXPLICIT_CONTENT_DETECTION = 3 -FACE_DETECTION = 4 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="AnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.input_content", - index=1, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.features", - index=2, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_context", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.video_context", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.output_uri", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoRequest.location_id", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=271, - serialized_end=520, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name="VideoContext", - full_name="google.cloud.videointelligence.v1beta2.VideoContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1beta2.VideoContext.segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1beta2.VideoContext.label_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1beta2.VideoContext.shot_change_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1beta2.VideoContext.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_detection_config", - full_name="google.cloud.videointelligence.v1beta2.VideoContext.face_detection_config", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=523, - serialized_end=1015, -) - - -_LABELDETECTIONCONFIG = _descriptor.Descriptor( - name="LabelDetectionConfig", - full_name="google.cloud.videointelligence.v1beta2.LabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label_detection_mode", - full_name="google.cloud.videointelligence.v1beta2.LabelDetectionConfig.label_detection_mode", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1beta2.LabelDetectionConfig.stationary_camera", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1beta2.LabelDetectionConfig.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1018, - serialized_end=1172, -) - - -_SHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="ShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1174, - serialized_end=1216, -) - - -_EXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="ExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1218, - serialized_end=1265, -) - - -_FACEDETECTIONCONFIG = _descriptor.Descriptor( - name="FaceDetectionConfig", - full_name="google.cloud.videointelligence.v1beta2.FaceDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1beta2.FaceDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="include_bounding_boxes", - full_name="google.cloud.videointelligence.v1beta2.FaceDetectionConfig.include_bounding_boxes", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1267, - serialized_end=1335, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name="VideoSegment", - full_name="google.cloud.videointelligence.v1beta2.VideoSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.videointelligence.v1beta2.VideoSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.videointelligence.v1beta2.VideoSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1337, - serialized_end=1457, -) - - -_LABELSEGMENT = _descriptor.Descriptor( - name="LabelSegment", - full_name="google.cloud.videointelligence.v1beta2.LabelSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1beta2.LabelSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1beta2.LabelSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1459, - serialized_end=1564, -) - - -_LABELFRAME = _descriptor.Descriptor( - name="LabelFrame", - full_name="google.cloud.videointelligence.v1beta2.LabelFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1beta2.LabelFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1beta2.LabelFrame.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1566, - serialized_end=1646, -) - - -_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.videointelligence.v1beta2.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.videointelligence.v1beta2.Entity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1beta2.Entity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1beta2.Entity.language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1648, - serialized_end=1719, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name="LabelAnnotation", - full_name="google.cloud.videointelligence.v1beta2.LabelAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1beta2.LabelAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_entities", - full_name="google.cloud.videointelligence.v1beta2.LabelAnnotation.category_entities", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1beta2.LabelAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1beta2.LabelAnnotation.frames", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1722, - serialized_end=2018, -) - - -_EXPLICITCONTENTFRAME = _descriptor.Descriptor( - name="ExplicitContentFrame", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pornography_likelihood", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentFrame.pornography_likelihood", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2021, - serialized_end=2175, -) - - -_EXPLICITCONTENTANNOTATION = _descriptor.Descriptor( - name="ExplicitContentAnnotation", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation.frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2177, - serialized_end=2282, -) - - -_NORMALIZEDBOUNDINGBOX = _descriptor.Descriptor( - name="NormalizedBoundingBox", - full_name="google.cloud.videointelligence.v1beta2.NormalizedBoundingBox", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="left", - full_name="google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.left", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="top", - full_name="google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.top", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="right", - full_name="google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.right", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bottom", - full_name="google.cloud.videointelligence.v1beta2.NormalizedBoundingBox.bottom", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2284, - serialized_end=2365, -) - - -_FACESEGMENT = _descriptor.Descriptor( - name="FaceSegment", - full_name="google.cloud.videointelligence.v1beta2.FaceSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1beta2.FaceSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2367, - serialized_end=2451, -) - - -_FACEFRAME = _descriptor.Descriptor( - name="FaceFrame", - full_name="google.cloud.videointelligence.v1beta2.FaceFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_boxes", - full_name="google.cloud.videointelligence.v1beta2.FaceFrame.normalized_bounding_boxes", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1beta2.FaceFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2454, - serialized_end=2611, -) - - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.videointelligence.v1beta2.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="thumbnail", - full_name="google.cloud.videointelligence.v1beta2.FaceAnnotation.thumbnail", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1beta2.FaceAnnotation.segments", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1beta2.FaceAnnotation.frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2614, - serialized_end=2787, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="VideoAnnotationResults", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_label_annotations", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.segment_label_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_label_annotations", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shot_label_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_label_annotations", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.frame_label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.face_annotations", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.shot_annotations", - index=5, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.explicit_annotation", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationResults.error", - index=7, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2790, - serialized_end=3397, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="AnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoResponse.annotation_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3399, - serialized_end=3514, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name="VideoAnnotationProgress", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.progress_percent", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.start_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.videointelligence.v1beta2.VideoAnnotationProgress.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3517, - serialized_end=3684, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name="AnnotateVideoProgress", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_progress", - full_name="google.cloud.videointelligence.v1beta2.AnnotateVideoProgress.annotation_progress", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3686, - serialized_end=3803, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name["features"].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name["video_context"].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name[ - "label_detection_config" -].message_type = _LABELDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "shot_change_detection_config" -].message_type = _SHOTCHANGEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "explicit_content_detection_config" -].message_type = _EXPLICITCONTENTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "face_detection_config" -].message_type = _FACEDETECTIONCONFIG -_LABELDETECTIONCONFIG.fields_by_name[ - "label_detection_mode" -].enum_type = _LABELDETECTIONMODE -_VIDEOSEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOSEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_LABELFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["category_entities"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["segments"].message_type = _LABELSEGMENT -_LABELANNOTATION.fields_by_name["frames"].message_type = _LABELFRAME -_EXPLICITCONTENTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_EXPLICITCONTENTFRAME.fields_by_name["pornography_likelihood"].enum_type = _LIKELIHOOD -_EXPLICITCONTENTANNOTATION.fields_by_name["frames"].message_type = _EXPLICITCONTENTFRAME -_FACESEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_FACEFRAME.fields_by_name[ - "normalized_bounding_boxes" -].message_type = _NORMALIZEDBOUNDINGBOX -_FACEFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_FACEANNOTATION.fields_by_name["segments"].message_type = _FACESEGMENT -_FACEANNOTATION.fields_by_name["frames"].message_type = _FACEFRAME -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "frame_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "face_annotations" -].message_type = _FACEANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name["shot_annotations"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ANNOTATEVIDEOPROGRESS.fields_by_name[ - "annotation_progress" -].message_type = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoRequest"] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name["VideoContext"] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name["LabelDetectionConfig"] = _LABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ShotChangeDetectionConfig" -] = _SHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ExplicitContentDetectionConfig" -] = _EXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["FaceDetectionConfig"] = _FACEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["VideoSegment"] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["LabelSegment"] = _LABELSEGMENT -DESCRIPTOR.message_types_by_name["LabelFrame"] = _LABELFRAME -DESCRIPTOR.message_types_by_name["Entity"] = _ENTITY -DESCRIPTOR.message_types_by_name["LabelAnnotation"] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name["ExplicitContentFrame"] = _EXPLICITCONTENTFRAME -DESCRIPTOR.message_types_by_name[ - "ExplicitContentAnnotation" -] = _EXPLICITCONTENTANNOTATION -DESCRIPTOR.message_types_by_name["NormalizedBoundingBox"] = _NORMALIZEDBOUNDINGBOX -DESCRIPTOR.message_types_by_name["FaceSegment"] = _FACESEGMENT -DESCRIPTOR.message_types_by_name["FaceFrame"] = _FACEFRAME -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["VideoAnnotationResults"] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["AnnotateVideoResponse"] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name["VideoAnnotationProgress"] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoProgress"] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.enum_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.enum_types_by_name["LabelDetectionMode"] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. If unset, the input video(s) should be - specified via ``input_uri``. If set, ``input_uri`` should be - unset. - features: - Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.AnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType( - "VideoContext", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCONTEXT, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_config: - Config for LABEL\_DETECTION. - shot_change_detection_config: - Config for SHOT\_CHANGE\_DETECTION. - explicit_content_detection_config: - Config for EXPLICIT\_CONTENT\_DETECTION. - face_detection_config: - Config for FACE\_DETECTION. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.VideoContext) - ), -) -_sym_db.RegisterMessage(VideoContext) - -LabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "LabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Config for LABEL\_DETECTION. - - - Attributes: - label_detection_mode: - What labels should be detected with LABEL\_DETECTION, in - addition to video-level labels or segment-level labels. If - unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. Should be used with - ``SHOT_AND_FRAME_MODE`` enabled. - model: - Model to use for label detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.LabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(LabelDetectionConfig) - -ShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Config for SHOT\_CHANGE\_DETECTION. - - - Attributes: - model: - Model to use for shot change detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.ShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(ShotChangeDetectionConfig) - -ExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Config for EXPLICIT\_CONTENT\_DETECTION. - - - Attributes: - model: - Model to use for explicit content detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.ExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(ExplicitContentDetectionConfig) - -FaceDetectionConfig = _reflection.GeneratedProtocolMessageType( - "FaceDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_FACEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Config for FACE\_DETECTION. - - - Attributes: - model: - Model to use for face detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - include_bounding_boxes: - Whether bounding boxes be included in the face annotation - output. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.FaceDetectionConfig) - ), -) -_sym_db.RegisterMessage(FaceDetectionConfig) - -VideoSegment = _reflection.GeneratedProtocolMessageType( - "VideoSegment", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOSEGMENT, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video segment. - - - Attributes: - start_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the start of the segment (inclusive). - end_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the end of the segment (inclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.VideoSegment) - ), -) -_sym_db.RegisterMessage(VideoSegment) - -LabelSegment = _reflection.GeneratedProtocolMessageType( - "LabelSegment", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSEGMENT, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for label detection. - - - Attributes: - segment: - Video segment where a label was detected. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.LabelSegment) - ), -) -_sym_db.RegisterMessage(LabelSegment) - -LabelFrame = _reflection.GeneratedProtocolMessageType( - "LabelFrame", - (_message.Message,), - dict( - DESCRIPTOR=_LABELFRAME, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for label detection. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.LabelFrame) - ), -) -_sym_db.RegisterMessage(LabelFrame) - -Entity = _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITY, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Detected entity from video analysis. - - - Attributes: - entity_id: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.Entity) - ), -) -_sym_db.RegisterMessage(Entity) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType( - "LabelAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LABELANNOTATION, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Label annotation. - - - Attributes: - entity: - Detected entity. - category_entities: - Common categories for the detected entity. E.g. when the label - is ``Terrier`` the category is likely ``dog``. And in some - cases there might be more than one categories e.g. ``Terrier`` - could also be a ``pet``. - segments: - All video segments where a label was detected. - frames: - All video frames where a label was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.LabelAnnotation) - ), -) -_sym_db.RegisterMessage(LabelAnnotation) - -ExplicitContentFrame = _reflection.GeneratedProtocolMessageType( - "ExplicitContentFrame", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTFRAME, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for explicit content. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - pornography_likelihood: - Likelihood of the pornography content.. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.ExplicitContentFrame) - ), -) -_sym_db.RegisterMessage(ExplicitContentFrame) - -ExplicitContentAnnotation = _reflection.GeneratedProtocolMessageType( - "ExplicitContentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTANNOTATION, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Explicit content annotation (based on per-frame visual signals only). If - no explicit content has been detected in a frame, no annotations are - present for that frame. - - - Attributes: - frames: - All video frames where explicit content was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.ExplicitContentAnnotation) - ), -) -_sym_db.RegisterMessage(ExplicitContentAnnotation) - -NormalizedBoundingBox = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingBox", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGBOX, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Normalized bounding box. The normalized vertex coordinates are relative - to the original image. Range: [0, 1]. - - - Attributes: - left: - Left X coordinate. - top: - Top Y coordinate. - right: - Right X coordinate. - bottom: - Bottom Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.NormalizedBoundingBox) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingBox) - -FaceSegment = _reflection.GeneratedProtocolMessageType( - "FaceSegment", - (_message.Message,), - dict( - DESCRIPTOR=_FACESEGMENT, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for face detection. - - - Attributes: - segment: - Video segment where a face was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.FaceSegment) - ), -) -_sym_db.RegisterMessage(FaceSegment) - -FaceFrame = _reflection.GeneratedProtocolMessageType( - "FaceFrame", - (_message.Message,), - dict( - DESCRIPTOR=_FACEFRAME, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for face detection. - - - Attributes: - normalized_bounding_boxes: - Normalized Bounding boxes in a frame. There can be more than - one boxes if the same face is detected in multiple locations - within the current frame. - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.FaceFrame) - ), -) -_sym_db.RegisterMessage(FaceFrame) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Face annotation. - - - Attributes: - thumbnail: - Thumbnail of a representative face view (in JPEG format). - segments: - All video segments where a face was detected. - frames: - All video frames where a face was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Annotation results for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - segment_label_annotations: - Label annotations on video level or user specified segment - level. There is exactly one element for each unique label. - shot_label_annotations: - Label annotations on shot level. There is exactly one element - for each unique label. - frame_label_annotations: - Label annotations on frame level. There is exactly one element - for each unique label. - face_annotations: - Face annotations. There is exactly one element for each unique - face. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - explicit_annotation: - Explicit content annotation. - error: - If set, indicates an error. Note that for a single - ``AnnotateVideoRequest`` some videos may succeed and some may - fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.VideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.AnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationProgress", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONPROGRESS, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Annotation progress for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - progress_percent: - Approximate percentage processed thus far. Guaranteed to be - 100 when fully processed. - start_time: - Time when the request was received. - update_time: - Time of the most recent update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.VideoAnnotationProgress) - ), -) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoProgress", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOPROGRESS, - __module__="google.cloud.videointelligence_v1beta2.proto.video_intelligence_pb2", - __doc__="""Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1beta2.AnnotateVideoProgress) - ), -) -_sym_db.RegisterMessage(AnnotateVideoProgress) - - -DESCRIPTOR._options = None - -_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="VideoIntelligenceService", - full_name="google.cloud.videointelligence.v1beta2.VideoIntelligenceService", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=4177, - serialized_end=4351, - methods=[ - _descriptor.MethodDescriptor( - name="AnnotateVideo", - full_name="google.cloud.videointelligence.v1beta2.VideoIntelligenceService.AnnotateVideo", - index=0, - containing_service=None, - input_type=_ANNOTATEVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\035"\030/v1beta2/videos:annotate:\001*' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name["VideoIntelligenceService"] = _VIDEOINTELLIGENCESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2_grpc.py deleted file mode 100644 index f9df0b90a1da..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/proto/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.videointelligence_v1beta2.proto import ( - video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1beta2_dot_proto_dot_video__intelligence__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - "/google.cloud.videointelligence.v1beta2.VideoIntelligenceService/AnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1beta2_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AnnotateVideo": grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1beta2_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1beta2.VideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1beta2/types.py b/videointelligence/google/cloud/videointelligence_v1beta2/types.py deleted file mode 100644 index 88b29b895b3c..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1beta2/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.videointelligence_v1beta2.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [video_intelligence_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.videointelligence_v1beta2.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py deleted file mode 100644 index f34c79eba8f2..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1p1beta1 import types -from google.cloud.videointelligence_v1p1beta1.gapic import enums -from google.cloud.videointelligence_v1p1beta1.gapic import ( - video_intelligence_service_client, -) - - -class VideoIntelligenceServiceClient( - video_intelligence_service_client.VideoIntelligenceServiceClient -): - __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "VideoIntelligenceServiceClient") diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/enums.py deleted file mode 100644 index 534d822ba120..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/enums.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Feature(enum.IntEnum): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - SHOT_CHANGE_DETECTION (int): Shot change detection. - EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - SPEECH_TRANSCRIPTION (int): Speech transcription. - """ - - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - SHOT_CHANGE_DETECTION = 2 - EXPLICIT_CONTENT_DETECTION = 3 - SPEECH_TRANSCRIPTION = 6 - - -class LabelDetectionMode(enum.IntEnum): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(enum.IntEnum): - """ - Bucketized representation of likelihood. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/__init__.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/video_intelligence_service_grpc_transport.py deleted file mode 100644 index 00d033d62667..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/transports/video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.videointelligence_v1p1beta1.proto import video_intelligence_pb2_grpc - - -class VideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1p1beta1 VideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "video_intelligence_service_stub": video_intelligence_pb2_grpc.VideoIntelligenceServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def annotate_video(self): - """Return the gRPC stub for :meth:`VideoIntelligenceServiceClient.annotate_video`. - - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["video_intelligence_service_stub"].AnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py deleted file mode 100644 index 0e6276d6df1f..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client.py +++ /dev/null @@ -1,308 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1p1beta1 VideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.videointelligence_v1p1beta1.gapic import enums -from google.cloud.videointelligence_v1p1beta1.gapic import ( - video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1p1beta1.gapic.transports import ( - video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1p1beta1.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1p1beta1.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = ( - "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService" - ) - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - VideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.VideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.VideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def annotate_video( - self, - input_uri=None, - input_content=None, - features=None, - video_context=None, - output_uri=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud import videointelligence_v1p1beta1 - >>> from google.cloud.videointelligence_v1p1beta1 import enums - >>> - >>> client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() - >>> - >>> input_uri = 'gs://cloud-samples-data/video/cat.mp4' - >>> features_element = enums.Feature.LABEL_DETECTION - >>> features = [features_element] - >>> - >>> response = client.annotate_video(input_uri=input_uri, features=features) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (str): Input video location. Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. A video - URI may include wildcards in ``object-id``, and thus identify multiple - videos. Supported wildcards: '\*' to match 0 or more characters; '?' to - match 1 character. If unset, the input video should be embedded in the - request as ``input_content``. If set, ``input_content`` should be unset. - input_content (bytes): The video data bytes. If unset, the input video(s) should be specified - via ``input_uri``. If set, ``input_uri`` should be unset. - features (list[~google.cloud.videointelligence_v1p1beta1.types.Feature]): Requested video annotation features. - video_context (Union[dict, ~google.cloud.videointelligence_v1p1beta1.types.VideoContext]): Additional video context and/or feature-specific parameters. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.videointelligence_v1p1beta1.types.VideoContext` - output_uri (str): Optional location where the output (in JSON format) should be stored. - Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. - location_id (str): Optional cloud region where annotation should take place. Supported - cloud regions: ``us-east1``, ``us-west1``, ``europe-west1``, - ``asia-east1``. If no region is specified, a region will be determined - based on video file location. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.videointelligence_v1p1beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.annotate_video, - default_retry=self._method_configs["AnnotateVideo"].retry, - default_timeout=self._method_configs["AnnotateVideo"].timeout, - client_info=self._client_info, - ) - - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - input_content=input_content, - features=features, - video_context=video_context, - output_uri=output_uri, - location_id=location_id, - ) - operation = self._inner_api_calls["annotate_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - metadata_type=video_intelligence_pb2.AnnotateVideoProgress, - ) diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client_config.py deleted file mode 100644 index ba29086dc464..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/gapic/video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.5, - "max_retry_delay_millis": 120000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto b/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto deleted file mode 100644 index 115f362beb69..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto +++ /dev/null @@ -1,434 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.videointelligence.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P1Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence"; -option java_multiple_files = true; -option java_outer_classname = "VideoIntelligenceServiceProto"; -option java_package = "com.google.cloud.videointelligence.v1p1beta1"; -option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p1beta1"; -option ruby_package = "Google::Cloud::VideoIntelligence::V1p1beta1"; - -// Service that implements Google Cloud Video Intelligence API. -service VideoIntelligenceService { - // Performs asynchronous video annotation. Progress and results can be - // retrieved through the `google.longrunning.Operations` interface. - // `Operation.metadata` contains `AnnotateVideoProgress` (progress). - // `Operation.response` contains `AnnotateVideoResponse` (results). - rpc AnnotateVideo(AnnotateVideoRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p1beta1/videos:annotate" - body: "*" - }; - } -} - -// Video annotation request. -message AnnotateVideoRequest { - // Input video location. Currently, only - // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are - // supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). A video - // URI may include wildcards in `object-id`, and thus identify multiple - // videos. Supported wildcards: '*' to match 0 or more characters; - // '?' to match 1 character. If unset, the input video should be embedded - // in the request as `input_content`. If set, `input_content` should be unset. - string input_uri = 1; - - // The video data bytes. - // If unset, the input video(s) should be specified via `input_uri`. - // If set, `input_uri` should be unset. - bytes input_content = 6; - - // Requested video annotation features. - repeated Feature features = 2; - - // Additional video context and/or feature-specific parameters. - VideoContext video_context = 3; - - // Optional location where the output (in JSON format) should be stored. - // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - // URIs are supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). - string output_uri = 4; - - // Optional cloud region where annotation should take place. Supported cloud - // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - // is specified, a region will be determined based on video file location. - string location_id = 5; -} - -// Video context and/or feature-specific parameters. -message VideoContext { - // Video segments to annotate. The segments may overlap and are not required - // to be contiguous or span the whole video. If unspecified, each video is - // treated as a single segment. - repeated VideoSegment segments = 1; - - // Config for LABEL_DETECTION. - LabelDetectionConfig label_detection_config = 2; - - // Config for SHOT_CHANGE_DETECTION. - ShotChangeDetectionConfig shot_change_detection_config = 3; - - // Config for EXPLICIT_CONTENT_DETECTION. - ExplicitContentDetectionConfig explicit_content_detection_config = 4; - - // Config for SPEECH_TRANSCRIPTION. - SpeechTranscriptionConfig speech_transcription_config = 6; -} - -// Config for LABEL_DETECTION. -message LabelDetectionConfig { - // What labels should be detected with LABEL_DETECTION, in addition to - // video-level labels or segment-level labels. - // If unspecified, defaults to `SHOT_MODE`. - LabelDetectionMode label_detection_mode = 1; - - // Whether the video has been shot from a stationary (i.e. non-moving) camera. - // When set to true, might improve detection accuracy for moving objects. - // Should be used with `SHOT_AND_FRAME_MODE` enabled. - bool stationary_camera = 2; - - // Model to use for label detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// Config for SHOT_CHANGE_DETECTION. -message ShotChangeDetectionConfig { - // Model to use for shot change detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for EXPLICIT_CONTENT_DETECTION. -message ExplicitContentDetectionConfig { - // Model to use for explicit content detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Video segment. -message VideoSegment { - // Time-offset, relative to the beginning of the video, - // corresponding to the start of the segment (inclusive). - google.protobuf.Duration start_time_offset = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the end of the segment (inclusive). - google.protobuf.Duration end_time_offset = 2; -} - -// Video segment level annotation results for label detection. -message LabelSegment { - // Video segment where a label was detected. - VideoSegment segment = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Video frame level annotation results for label detection. -message LabelFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Detected entity from video analysis. -message Entity { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string entity_id = 1; - - // Textual description, e.g. `Fixed-gear bicycle`. - string description = 2; - - // Language code for `description` in BCP-47 format. - string language_code = 3; -} - -// Label annotation. -message LabelAnnotation { - // Detected entity. - Entity entity = 1; - - // Common categories for the detected entity. - // E.g. when the label is `Terrier` the category is likely `dog`. And in some - // cases there might be more than one categories e.g. `Terrier` could also be - // a `pet`. - repeated Entity category_entities = 2; - - // All video segments where a label was detected. - repeated LabelSegment segments = 3; - - // All video frames where a label was detected. - repeated LabelFrame frames = 4; -} - -// Video frame level annotation results for explicit content. -message ExplicitContentFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Likelihood of the pornography content.. - Likelihood pornography_likelihood = 2; -} - -// Explicit content annotation (based on per-frame visual signals only). -// If no explicit content has been detected in a frame, no annotations are -// present for that frame. -message ExplicitContentAnnotation { - // All video frames where explicit content was detected. - repeated ExplicitContentFrame frames = 1; -} - -// Annotation results for a single video. -message VideoAnnotationResults { - // Output only. Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. - repeated LabelAnnotation segment_label_annotations = 2; - - // Label annotations on shot level. - // There is exactly one element for each unique label. - repeated LabelAnnotation shot_label_annotations = 3; - - // Label annotations on frame level. - // There is exactly one element for each unique label. - repeated LabelAnnotation frame_label_annotations = 4; - - // Shot annotations. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 6; - - // Explicit content annotation. - ExplicitContentAnnotation explicit_annotation = 7; - - // Speech transcription. - repeated SpeechTranscription speech_transcriptions = 11; - - // Output only. If set, indicates an error. Note that for a single - // `AnnotateVideoRequest` some videos may succeed and some may fail. - google.rpc.Status error = 9; -} - -// Video annotation response. Included in the `response` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoResponse { - // Annotation results for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationResults annotation_results = 1; -} - -// Annotation progress for a single video. -message VideoAnnotationProgress { - // Output only. Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Output only. Approximate percentage processed thus far. Guaranteed to be - // 100 when fully processed. - int32 progress_percent = 2; - - // Output only. Time when the request was received. - google.protobuf.Timestamp start_time = 3; - - // Output only. Time of the most recent update. - google.protobuf.Timestamp update_time = 4; -} - -// Video annotation progress. Included in the `metadata` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoProgress { - // Progress metadata for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationProgress annotation_progress = 1; -} - -// Config for SPEECH_TRANSCRIPTION. -message SpeechTranscriptionConfig { - // *Required* The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language Support](https://cloud.google.com/speech/docs/languages) - // for a list of the currently supported language codes. - string language_code = 1; - - // *Optional* Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechRecognitionResult`. The server may return fewer than - // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will - // return a maximum of one. If omitted, will return a maximum of one. - int32 max_alternatives = 2; - - // *Optional* If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool filter_profanity = 3; - - // *Optional* A means to provide context to assist the speech recognition. - repeated SpeechContext speech_contexts = 4; - - // *Optional* If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. The default 'false' value - // does not add punctuation to result hypotheses. NOTE: "This is currently - // offered as an experimental service, complimentary to all users. In the - // future this may be exclusively available as a premium feature." - bool enable_automatic_punctuation = 5; - - // *Optional* For file formats, such as MXF or MKV, supporting multiple audio - // tracks, specify up to two tracks. Default: track 0. - repeated int32 audio_tracks = 6; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // *Optional* A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech/limits#content). - repeated string phrases = 1; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechTranscription { - // Output only. May contain one or more recognition hypotheses (up to the - // maximum specified in `max_alternatives`). - // These alternatives are ordered in terms of accuracy, with the top (first) - // alternative being the most probable, as ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Output only. Transcript text representing the words that the user spoke. - string transcript = 1; - - // Output only. The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is typically provided only for the top hypothesis, and - // only for `is_final=true` results. Clients should not rely on the - // `confidence` field as it is not guaranteed to be accurate or consistent. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2; - - // Output only. A list of word-specific information for each recognized word. - repeated WordInfo words = 3; -} - -// Word-specific information for recognized words. Word information is only -// included in the response when certain request parameters are set, such -// as `enable_word_time_offsets`. -message WordInfo { - // Output only. Time offset relative to the beginning of the audio, and - // corresponding to the start of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration start_time = 1; - - // Output only. Time offset relative to the beginning of the audio, and - // corresponding to the end of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration end_time = 2; - - // Output only. The word corresponding to this set of information. - string word = 3; -} - -// Video annotation feature. -enum Feature { - // Unspecified. - FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - LABEL_DETECTION = 1; - - // Shot change detection. - SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - EXPLICIT_CONTENT_DETECTION = 3; - - // Speech transcription. - SPEECH_TRANSCRIPTION = 6; -} - -// Label detection mode. -enum LabelDetectionMode { - // Unspecified. - LABEL_DETECTION_MODE_UNSPECIFIED = 0; - - // Detect shot-level labels. - SHOT_MODE = 1; - - // Detect frame-level labels. - FRAME_MODE = 2; - - // Detect both shot-level and frame-level labels. - SHOT_AND_FRAME_MODE = 3; -} - -// Bucketized representation of likelihood. -enum Likelihood { - // Unspecified likelihood. - LIKELIHOOD_UNSPECIFIED = 0; - - // Very unlikely. - VERY_UNLIKELY = 1; - - // Unlikely. - UNLIKELY = 2; - - // Possible. - POSSIBLE = 3; - - // Likely. - LIKELY = 4; - - // Very likely. - VERY_LIKELY = 5; -} diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2.py deleted file mode 100644 index 52b380063359..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2.py +++ /dev/null @@ -1,2422 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto", - package="google.cloud.videointelligence.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n,com.google.cloud.videointelligence.v1p1beta1B\035VideoIntelligenceServiceProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence\252\002(Google.Cloud.VideoIntelligence.V1P1Beta1\312\002(Google\\Cloud\\VideoIntelligence\\V1p1beta1\352\002+Google::Cloud::VideoIntelligence::V1p1beta1" - ), - serialized_pb=_b( - '\nGgoogle/cloud/videointelligence_v1p1beta1/proto/video_intelligence.proto\x12(google.cloud.videointelligence.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xfd\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\x0c\x12\x43\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32\x31.google.cloud.videointelligence.v1p1beta1.Feature\x12M\n\rvideo_context\x18\x03 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p1beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"\x82\x04\n\x0cVideoContext\x12H\n\x08segments\x18\x01 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p1beta1.VideoSegment\x12^\n\x16label_detection_config\x18\x02 \x01(\x0b\x32>.google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig\x12i\n\x1cshot_change_detection_config\x18\x03 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig\x12s\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32H.google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig\x12h\n\x1bspeech_transcription_config\x18\x06 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig"\x9c\x01\n\x14LabelDetectionConfig\x12Z\n\x14label_detection_mode\x18\x01 \x01(\x0e\x32<.google.cloud.videointelligence.v1p1beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x02 \x01(\x08\x12\r\n\x05model\x18\x03 \x01(\t"*\n\x19ShotChangeDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"/\n\x1e\x45xplicitContentDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"x\n\x0cVideoSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"k\n\x0cLabelSegment\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p1beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02"P\n\nLabelFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x02 \x01(\x02"G\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t"\xb0\x02\n\x0fLabelAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p1beta1.Entity\x12K\n\x11\x63\x61tegory_entities\x18\x02 \x03(\x0b\x32\x30.google.cloud.videointelligence.v1p1beta1.Entity\x12H\n\x08segments\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p1beta1.LabelSegment\x12\x44\n\x06\x66rames\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1p1beta1.LabelFrame"\x9c\x01\n\x14\x45xplicitContentFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12T\n\x16pornography_likelihood\x18\x02 \x01(\x0e\x32\x34.google.cloud.videointelligence.v1p1beta1.Likelihood"k\n\x19\x45xplicitContentAnnotation\x12N\n\x06\x66rames\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame"\xf5\x04\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\\\n\x19segment_label_annotations\x18\x02 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p1beta1.LabelAnnotation\x12Y\n\x16shot_label_annotations\x18\x03 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p1beta1.LabelAnnotation\x12Z\n\x17\x66rame_label_annotations\x18\x04 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p1beta1.LabelAnnotation\x12P\n\x10shot_annotations\x18\x06 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p1beta1.VideoSegment\x12`\n\x13\x65xplicit_annotation\x18\x07 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation\x12\\\n\x15speech_transcriptions\x18\x0b \x03(\x0b\x32=.google.cloud.videointelligence.v1p1beta1.SpeechTranscription\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"u\n\x15\x41nnotateVideoResponse\x12\\\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32@.google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults"\xa7\x01\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"w\n\x15\x41nnotateVideoProgress\x12^\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32\x41.google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress"\xf4\x01\n\x19SpeechTranscriptionConfig\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x18\n\x10max_alternatives\x18\x02 \x01(\x05\x12\x18\n\x10\x66ilter_profanity\x18\x03 \x01(\x08\x12P\n\x0fspeech_contexts\x18\x04 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1p1beta1.SpeechContext\x12$\n\x1c\x65nable_automatic_punctuation\x18\x05 \x01(\x08\x12\x14\n\x0c\x61udio_tracks\x18\x06 \x03(\x05" \n\rSpeechContext\x12\x0f\n\x07phrases\x18\x01 \x03(\t"s\n\x13SpeechTranscription\x12\\\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x46.google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative"\x89\x01\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x41\n\x05words\x18\x03 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1p1beta1.WordInfo"t\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t*\x8c\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x02\x12\x1e\n\x1a\x45XPLICIT_CONTENT_DETECTION\x10\x03\x12\x18\n\x14SPEECH_TRANSCRIPTION\x10\x06*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xb2\x01\n\x18VideoIntelligenceService\x12\x95\x01\n\rAnnotateVideo\x12>.google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation"%\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p1beta1/videos:annotate:\x01*B\xae\x02\n,com.google.cloud.videointelligence.v1p1beta1B\x1dVideoIntelligenceServiceProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p1beta1;videointelligence\xaa\x02(Google.Cloud.VideoIntelligence.V1P1Beta1\xca\x02(Google\\Cloud\\VideoIntelligence\\V1p1beta1\xea\x02+Google::Cloud::VideoIntelligence::V1p1beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.videointelligence.v1p1beta1.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SPEECH_TRANSCRIPTION", - index=4, - number=6, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3959, - serialized_end=4099, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name="LabelDetectionMode", - full_name="google.cloud.videointelligence.v1p1beta1.LabelDetectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_MODE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FRAME_MODE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHOT_AND_FRAME_MODE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4101, - serialized_end=4215, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.videointelligence.v1p1beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4217, - serialized_end=4333, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -SHOT_CHANGE_DETECTION = 2 -EXPLICIT_CONTENT_DETECTION = 3 -SPEECH_TRANSCRIPTION = 6 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="AnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.input_content", - index=1, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.features", - index=2, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_context", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.video_context", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.output_uri", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest.location_id", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=275, - serialized_end=528, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name="VideoContext", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext.segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext.label_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext.shot_change_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcription_config", - full_name="google.cloud.videointelligence.v1p1beta1.VideoContext.speech_transcription_config", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=531, - serialized_end=1045, -) - - -_LABELDETECTIONCONFIG = _descriptor.Descriptor( - name="LabelDetectionConfig", - full_name="google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label_detection_mode", - full_name="google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.label_detection_mode", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.stationary_camera", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1048, - serialized_end=1204, -) - - -_SHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="ShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1206, - serialized_end=1248, -) - - -_EXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="ExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1250, - serialized_end=1297, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name="VideoSegment", - full_name="google.cloud.videointelligence.v1p1beta1.VideoSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.videointelligence.v1p1beta1.VideoSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.videointelligence.v1p1beta1.VideoSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1299, - serialized_end=1419, -) - - -_LABELSEGMENT = _descriptor.Descriptor( - name="LabelSegment", - full_name="google.cloud.videointelligence.v1p1beta1.LabelSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p1beta1.LabelSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p1beta1.LabelSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1421, - serialized_end=1528, -) - - -_LABELFRAME = _descriptor.Descriptor( - name="LabelFrame", - full_name="google.cloud.videointelligence.v1p1beta1.LabelFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p1beta1.LabelFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p1beta1.LabelFrame.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1530, - serialized_end=1610, -) - - -_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.videointelligence.v1p1beta1.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.videointelligence.v1p1beta1.Entity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1p1beta1.Entity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p1beta1.Entity.language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1612, - serialized_end=1683, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name="LabelAnnotation", - full_name="google.cloud.videointelligence.v1p1beta1.LabelAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p1beta1.LabelAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_entities", - full_name="google.cloud.videointelligence.v1p1beta1.LabelAnnotation.category_entities", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p1beta1.LabelAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p1beta1.LabelAnnotation.frames", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1686, - serialized_end=1990, -) - - -_EXPLICITCONTENTFRAME = _descriptor.Descriptor( - name="ExplicitContentFrame", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pornography_likelihood", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame.pornography_likelihood", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1993, - serialized_end=2149, -) - - -_EXPLICITCONTENTANNOTATION = _descriptor.Descriptor( - name="ExplicitContentAnnotation", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation.frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2151, - serialized_end=2258, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="VideoAnnotationResults", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_label_annotations", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.segment_label_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_label_annotations", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shot_label_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_label_annotations", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.frame_label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.shot_annotations", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.explicit_annotation", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcriptions", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.speech_transcriptions", - index=6, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults.error", - index=7, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2261, - serialized_end=2890, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="AnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse.annotation_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2892, - serialized_end=3009, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name="VideoAnnotationProgress", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.progress_percent", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.start_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3012, - serialized_end=3179, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name="AnnotateVideoProgress", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_progress", - full_name="google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress.annotation_progress", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3181, - serialized_end=3300, -) - - -_SPEECHTRANSCRIPTIONCONFIG = _descriptor.Descriptor( - name="SpeechTranscriptionConfig", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_alternatives", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.max_alternatives", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter_profanity", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.filter_profanity", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_contexts", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.speech_contexts", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_automatic_punctuation", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.enable_automatic_punctuation", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_tracks", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig.audio_tracks", - index=5, - number=6, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3303, - serialized_end=3547, -) - - -_SPEECHCONTEXT = _descriptor.Descriptor( - name="SpeechContext", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="phrases", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechContext.phrases", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3549, - serialized_end=3581, -) - - -_SPEECHTRANSCRIPTION = _descriptor.Descriptor( - name="SpeechTranscription", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="alternatives", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechTranscription.alternatives", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3583, - serialized_end=3698, -) - - -_SPEECHRECOGNITIONALTERNATIVE = _descriptor.Descriptor( - name="SpeechRecognitionAlternative", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="transcript", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.transcript", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3701, - serialized_end=3838, -) - - -_WORDINFO = _descriptor.Descriptor( - name="WordInfo", - full_name="google.cloud.videointelligence.v1p1beta1.WordInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1p1beta1.WordInfo.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.videointelligence.v1p1beta1.WordInfo.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="word", - full_name="google.cloud.videointelligence.v1p1beta1.WordInfo.word", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3840, - serialized_end=3956, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name["features"].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name["video_context"].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name[ - "label_detection_config" -].message_type = _LABELDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "shot_change_detection_config" -].message_type = _SHOTCHANGEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "explicit_content_detection_config" -].message_type = _EXPLICITCONTENTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "speech_transcription_config" -].message_type = _SPEECHTRANSCRIPTIONCONFIG -_LABELDETECTIONCONFIG.fields_by_name[ - "label_detection_mode" -].enum_type = _LABELDETECTIONMODE -_VIDEOSEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOSEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_LABELFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["category_entities"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["segments"].message_type = _LABELSEGMENT -_LABELANNOTATION.fields_by_name["frames"].message_type = _LABELFRAME -_EXPLICITCONTENTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_EXPLICITCONTENTFRAME.fields_by_name["pornography_likelihood"].enum_type = _LIKELIHOOD -_EXPLICITCONTENTANNOTATION.fields_by_name["frames"].message_type = _EXPLICITCONTENTFRAME -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "frame_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name["shot_annotations"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "speech_transcriptions" -].message_type = _SPEECHTRANSCRIPTION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ANNOTATEVIDEOPROGRESS.fields_by_name[ - "annotation_progress" -].message_type = _VIDEOANNOTATIONPROGRESS -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name[ - "speech_contexts" -].message_type = _SPEECHCONTEXT -_SPEECHTRANSCRIPTION.fields_by_name[ - "alternatives" -].message_type = _SPEECHRECOGNITIONALTERNATIVE -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"].message_type = _WORDINFO -_WORDINFO.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_WORDINFO.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -DESCRIPTOR.message_types_by_name["AnnotateVideoRequest"] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name["VideoContext"] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name["LabelDetectionConfig"] = _LABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ShotChangeDetectionConfig" -] = _SHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ExplicitContentDetectionConfig" -] = _EXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["VideoSegment"] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["LabelSegment"] = _LABELSEGMENT -DESCRIPTOR.message_types_by_name["LabelFrame"] = _LABELFRAME -DESCRIPTOR.message_types_by_name["Entity"] = _ENTITY -DESCRIPTOR.message_types_by_name["LabelAnnotation"] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name["ExplicitContentFrame"] = _EXPLICITCONTENTFRAME -DESCRIPTOR.message_types_by_name[ - "ExplicitContentAnnotation" -] = _EXPLICITCONTENTANNOTATION -DESCRIPTOR.message_types_by_name["VideoAnnotationResults"] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["AnnotateVideoResponse"] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name["VideoAnnotationProgress"] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoProgress"] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.message_types_by_name[ - "SpeechTranscriptionConfig" -] = _SPEECHTRANSCRIPTIONCONFIG -DESCRIPTOR.message_types_by_name["SpeechContext"] = _SPEECHCONTEXT -DESCRIPTOR.message_types_by_name["SpeechTranscription"] = _SPEECHTRANSCRIPTION -DESCRIPTOR.message_types_by_name[ - "SpeechRecognitionAlternative" -] = _SPEECHRECOGNITIONALTERNATIVE -DESCRIPTOR.message_types_by_name["WordInfo"] = _WORDINFO -DESCRIPTOR.enum_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.enum_types_by_name["LabelDetectionMode"] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. If unset, the input video(s) should be - specified via ``input_uri``. If set, ``input_uri`` should be - unset. - features: - Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.AnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType( - "VideoContext", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCONTEXT, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_config: - Config for LABEL\_DETECTION. - shot_change_detection_config: - Config for SHOT\_CHANGE\_DETECTION. - explicit_content_detection_config: - Config for EXPLICIT\_CONTENT\_DETECTION. - speech_transcription_config: - Config for SPEECH\_TRANSCRIPTION. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.VideoContext) - ), -) -_sym_db.RegisterMessage(VideoContext) - -LabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "LabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Config for LABEL\_DETECTION. - - - Attributes: - label_detection_mode: - What labels should be detected with LABEL\_DETECTION, in - addition to video-level labels or segment-level labels. If - unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. Should be used with - ``SHOT_AND_FRAME_MODE`` enabled. - model: - Model to use for label detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.LabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(LabelDetectionConfig) - -ShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Config for SHOT\_CHANGE\_DETECTION. - - - Attributes: - model: - Model to use for shot change detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.ShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(ShotChangeDetectionConfig) - -ExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Config for EXPLICIT\_CONTENT\_DETECTION. - - - Attributes: - model: - Model to use for explicit content detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.ExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(ExplicitContentDetectionConfig) - -VideoSegment = _reflection.GeneratedProtocolMessageType( - "VideoSegment", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOSEGMENT, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video segment. - - - Attributes: - start_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the start of the segment (inclusive). - end_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the end of the segment (inclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.VideoSegment) - ), -) -_sym_db.RegisterMessage(VideoSegment) - -LabelSegment = _reflection.GeneratedProtocolMessageType( - "LabelSegment", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSEGMENT, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for label detection. - - - Attributes: - segment: - Video segment where a label was detected. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.LabelSegment) - ), -) -_sym_db.RegisterMessage(LabelSegment) - -LabelFrame = _reflection.GeneratedProtocolMessageType( - "LabelFrame", - (_message.Message,), - dict( - DESCRIPTOR=_LABELFRAME, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for label detection. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.LabelFrame) - ), -) -_sym_db.RegisterMessage(LabelFrame) - -Entity = _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITY, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Detected entity from video analysis. - - - Attributes: - entity_id: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.Entity) - ), -) -_sym_db.RegisterMessage(Entity) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType( - "LabelAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LABELANNOTATION, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Label annotation. - - - Attributes: - entity: - Detected entity. - category_entities: - Common categories for the detected entity. E.g. when the label - is ``Terrier`` the category is likely ``dog``. And in some - cases there might be more than one categories e.g. ``Terrier`` - could also be a ``pet``. - segments: - All video segments where a label was detected. - frames: - All video frames where a label was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.LabelAnnotation) - ), -) -_sym_db.RegisterMessage(LabelAnnotation) - -ExplicitContentFrame = _reflection.GeneratedProtocolMessageType( - "ExplicitContentFrame", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTFRAME, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for explicit content. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - pornography_likelihood: - Likelihood of the pornography content.. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.ExplicitContentFrame) - ), -) -_sym_db.RegisterMessage(ExplicitContentFrame) - -ExplicitContentAnnotation = _reflection.GeneratedProtocolMessageType( - "ExplicitContentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTANNOTATION, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Explicit content annotation (based on per-frame visual signals only). If - no explicit content has been detected in a frame, no annotations are - present for that frame. - - - Attributes: - frames: - All video frames where explicit content was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.ExplicitContentAnnotation) - ), -) -_sym_db.RegisterMessage(ExplicitContentAnnotation) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Annotation results for a single video. - - - Attributes: - input_uri: - Output only. Video file location in `Google Cloud Storage - `__. - segment_label_annotations: - Label annotations on video level or user specified segment - level. There is exactly one element for each unique label. - shot_label_annotations: - Label annotations on shot level. There is exactly one element - for each unique label. - frame_label_annotations: - Label annotations on frame level. There is exactly one element - for each unique label. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - explicit_annotation: - Explicit content annotation. - speech_transcriptions: - Speech transcription. - error: - Output only. If set, indicates an error. Note that for a - single ``AnnotateVideoRequest`` some videos may succeed and - some may fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.VideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.AnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationProgress", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONPROGRESS, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Annotation progress for a single video. - - - Attributes: - input_uri: - Output only. Video file location in `Google Cloud Storage - `__. - progress_percent: - Output only. Approximate percentage processed thus far. - Guaranteed to be 100 when fully processed. - start_time: - Output only. Time when the request was received. - update_time: - Output only. Time of the most recent update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.VideoAnnotationProgress) - ), -) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoProgress", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOPROGRESS, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.AnnotateVideoProgress) - ), -) -_sym_db.RegisterMessage(AnnotateVideoProgress) - -SpeechTranscriptionConfig = _reflection.GeneratedProtocolMessageType( - "SpeechTranscriptionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTIONCONFIG, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Config for SPEECH\_TRANSCRIPTION. - - - Attributes: - language_code: - *Required* The language of the supplied audio as a `BCP-47 - `__ language - tag. Example: "en-US". See `Language Support - `__ for a list - of the currently supported language codes. - max_alternatives: - *Optional* Maximum number of recognition hypotheses to be - returned. Specifically, the maximum number of - ``SpeechRecognitionAlternative`` messages within each - ``SpeechRecognitionResult``. The server may return fewer than - ``max_alternatives``. Valid values are ``0``-``30``. A value - of ``0`` or ``1`` will return a maximum of one. If omitted, - will return a maximum of one. - filter_profanity: - *Optional* If set to ``true``, the server will attempt to - filter out profanities, replacing all but the initial - character in each filtered word with asterisks, e.g. - "f\*\*\*". If set to ``false`` or omitted, profanities won't - be filtered out. - speech_contexts: - *Optional* A means to provide context to assist the speech - recognition. - enable_automatic_punctuation: - *Optional* If 'true', adds punctuation to recognition result - hypotheses. This feature is only available in select - languages. Setting this for requests in other languages has no - effect at all. The default 'false' value does not add - punctuation to result hypotheses. NOTE: "This is currently - offered as an experimental service, complimentary to all - users. In the future this may be exclusively available as a - premium feature." - audio_tracks: - *Optional* For file formats, such as MXF or MKV, supporting - multiple audio tracks, specify up to two tracks. Default: - track 0. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.SpeechTranscriptionConfig) - ), -) -_sym_db.RegisterMessage(SpeechTranscriptionConfig) - -SpeechContext = _reflection.GeneratedProtocolMessageType( - "SpeechContext", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHCONTEXT, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Provides "hints" to the speech recognizer to favor specific words and - phrases in the results. - - - Attributes: - phrases: - *Optional* A list of strings containing words and phrases - "hints" so that the speech recognition is more likely to - recognize them. This can be used to improve the accuracy for - specific words and phrases, for example, if specific commands - are typically spoken by the user. This can also be used to add - additional words to the vocabulary of the recognizer. See - `usage limits - `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.SpeechContext) - ), -) -_sym_db.RegisterMessage(SpeechContext) - -SpeechTranscription = _reflection.GeneratedProtocolMessageType( - "SpeechTranscription", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTION, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""A speech recognition result corresponding to a portion of the audio. - - - Attributes: - alternatives: - Output only. May contain one or more recognition hypotheses - (up to the maximum specified in ``max_alternatives``). These - alternatives are ordered in terms of accuracy, with the top - (first) alternative being the most probable, as ranked by the - recognizer. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.SpeechTranscription) - ), -) -_sym_db.RegisterMessage(SpeechTranscription) - -SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionAlternative", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONALTERNATIVE, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Alternative hypotheses (a.k.a. n-best list). - - - Attributes: - transcript: - Output only. Transcript text representing the words that the - user spoke. - confidence: - Output only. The confidence estimate between 0.0 and 1.0. A - higher number indicates an estimated greater likelihood that - the recognized words are correct. This field is typically - provided only for the top hypothesis, and only for - ``is_final=true`` results. Clients should not rely on the - ``confidence`` field as it is not guaranteed to be accurate or - consistent. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - words: - Output only. A list of word-specific information for each - recognized word. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.SpeechRecognitionAlternative) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionAlternative) - -WordInfo = _reflection.GeneratedProtocolMessageType( - "WordInfo", - (_message.Message,), - dict( - DESCRIPTOR=_WORDINFO, - __module__="google.cloud.videointelligence_v1p1beta1.proto.video_intelligence_pb2", - __doc__="""Word-specific information for recognized words. Word information is only - included in the response when certain request parameters are set, such - as ``enable_word_time_offsets``. - - - Attributes: - start_time: - Output only. Time offset relative to the beginning of the - audio, and corresponding to the start of the spoken word. This - field is only set if ``enable_word_time_offsets=true`` and - only in the top hypothesis. This is an experimental feature - and the accuracy of the time offset can vary. - end_time: - Output only. Time offset relative to the beginning of the - audio, and corresponding to the end of the spoken word. This - field is only set if ``enable_word_time_offsets=true`` and - only in the top hypothesis. This is an experimental feature - and the accuracy of the time offset can vary. - word: - Output only. The word corresponding to this set of - information. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p1beta1.WordInfo) - ), -) -_sym_db.RegisterMessage(WordInfo) - - -DESCRIPTOR._options = None - -_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="VideoIntelligenceService", - full_name="google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=4336, - serialized_end=4514, - methods=[ - _descriptor.MethodDescriptor( - name="AnnotateVideo", - full_name="google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService.AnnotateVideo", - index=0, - containing_service=None, - input_type=_ANNOTATEVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p1beta1/videos:annotate:\001*' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name["VideoIntelligenceService"] = _VIDEOINTELLIGENCESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2_grpc.py deleted file mode 100644 index 91583de36852..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/proto/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.videointelligence_v1p1beta1.proto import ( - video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1p1beta1_dot_proto_dot_video__intelligence__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - "/google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService/AnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1p1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AnnotateVideo": grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1p1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1p1beta1.VideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1p1beta1/types.py b/videointelligence/google/cloud/videointelligence_v1p1beta1/types.py deleted file mode 100644 index a1ff8767be79..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p1beta1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.videointelligence_v1p1beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [video_intelligence_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.videointelligence_v1p1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py deleted file mode 100644 index bb08b22fa8fa..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/__init__.py +++ /dev/null @@ -1,34 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1p2beta1 import types -from google.cloud.videointelligence_v1p2beta1.gapic import enums -from google.cloud.videointelligence_v1p2beta1.gapic import ( - video_intelligence_service_client, -) - - -class VideoIntelligenceServiceClient( - video_intelligence_service_client.VideoIntelligenceServiceClient -): - __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "VideoIntelligenceServiceClient") diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/enums.py deleted file mode 100644 index 4d0ad701bd40..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/enums.py +++ /dev/null @@ -1,78 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Feature(enum.IntEnum): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - SHOT_CHANGE_DETECTION (int): Shot change detection. - EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - TEXT_DETECTION (int): OCR text detection and tracking. - OBJECT_TRACKING (int): Object detection and tracking. - """ - - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - SHOT_CHANGE_DETECTION = 2 - EXPLICIT_CONTENT_DETECTION = 3 - TEXT_DETECTION = 7 - OBJECT_TRACKING = 9 - - -class LabelDetectionMode(enum.IntEnum): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(enum.IntEnum): - """ - Bucketized representation of likelihood. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/__init__.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/video_intelligence_service_grpc_transport.py deleted file mode 100644 index b8eb33c1e9c3..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/transports/video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2_grpc - - -class VideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1p2beta1 VideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "video_intelligence_service_stub": video_intelligence_pb2_grpc.VideoIntelligenceServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def annotate_video(self): - """Return the gRPC stub for :meth:`VideoIntelligenceServiceClient.annotate_video`. - - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["video_intelligence_service_stub"].AnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py deleted file mode 100644 index 323f959ab7af..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client.py +++ /dev/null @@ -1,308 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1p2beta1 VideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.videointelligence_v1p2beta1.gapic import enums -from google.cloud.videointelligence_v1p2beta1.gapic import ( - video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1p2beta1.gapic.transports import ( - video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = ( - "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService" - ) - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - VideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.VideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.VideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def annotate_video( - self, - input_uri=None, - input_content=None, - features=None, - video_context=None, - output_uri=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud import videointelligence_v1p2beta1 - >>> from google.cloud.videointelligence_v1p2beta1 import enums - >>> - >>> client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() - >>> - >>> input_uri = 'gs://cloud-samples-data/video/cat.mp4' - >>> features_element = enums.Feature.LABEL_DETECTION - >>> features = [features_element] - >>> - >>> response = client.annotate_video(input_uri=input_uri, features=features) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (str): Input video location. Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. A video - URI may include wildcards in ``object-id``, and thus identify multiple - videos. Supported wildcards: '\*' to match 0 or more characters; '?' to - match 1 character. If unset, the input video should be embedded in the - request as ``input_content``. If set, ``input_content`` should be unset. - input_content (bytes): The video data bytes. If unset, the input video(s) should be specified - via ``input_uri``. If set, ``input_uri`` should be unset. - features (list[~google.cloud.videointelligence_v1p2beta1.types.Feature]): Requested video annotation features. - video_context (Union[dict, ~google.cloud.videointelligence_v1p2beta1.types.VideoContext]): Additional video context and/or feature-specific parameters. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.videointelligence_v1p2beta1.types.VideoContext` - output_uri (str): Optional location where the output (in JSON format) should be stored. - Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. - location_id (str): Optional cloud region where annotation should take place. Supported - cloud regions: ``us-east1``, ``us-west1``, ``europe-west1``, - ``asia-east1``. If no region is specified, a region will be determined - based on video file location. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.videointelligence_v1p2beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.annotate_video, - default_retry=self._method_configs["AnnotateVideo"].retry, - default_timeout=self._method_configs["AnnotateVideo"].timeout, - client_info=self._client_info, - ) - - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - input_content=input_content, - features=features, - video_context=video_context, - output_uri=output_uri, - location_id=location_id, - ) - operation = self._inner_api_calls["annotate_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - metadata_type=video_intelligence_pb2.AnnotateVideoProgress, - ) diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client_config.py deleted file mode 100644 index 4c0b9f3858b9..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/gapic/video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.5, - "max_retry_delay_millis": 120000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto b/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto deleted file mode 100644 index 0a16e7afd154..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto +++ /dev/null @@ -1,467 +0,0 @@ -// Copyright 2018 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.videointelligence.v1p2beta1; - -import "google/api/annotations.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P2Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence"; -option java_multiple_files = true; -option java_outer_classname = "VideoIntelligenceServiceProto"; -option java_package = "com.google.cloud.videointelligence.v1p2beta1"; -option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p2beta1"; -option ruby_package = "Google::Cloud::VideoIntelligence::V1p2beta1"; - -// Service that implements Google Cloud Video Intelligence API. -service VideoIntelligenceService { - // Performs asynchronous video annotation. Progress and results can be - // retrieved through the `google.longrunning.Operations` interface. - // `Operation.metadata` contains `AnnotateVideoProgress` (progress). - // `Operation.response` contains `AnnotateVideoResponse` (results). - rpc AnnotateVideo(AnnotateVideoRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p2beta1/videos:annotate" - body: "*" - }; - } -} - -// Video annotation request. -message AnnotateVideoRequest { - // Input video location. Currently, only - // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are - // supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). A video - // URI may include wildcards in `object-id`, and thus identify multiple - // videos. Supported wildcards: '*' to match 0 or more characters; - // '?' to match 1 character. If unset, the input video should be embedded - // in the request as `input_content`. If set, `input_content` should be unset. - string input_uri = 1; - - // The video data bytes. - // If unset, the input video(s) should be specified via `input_uri`. - // If set, `input_uri` should be unset. - bytes input_content = 6; - - // Requested video annotation features. - repeated Feature features = 2; - - // Additional video context and/or feature-specific parameters. - VideoContext video_context = 3; - - // Optional location where the output (in JSON format) should be stored. - // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - // URIs are supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). - string output_uri = 4; - - // Optional cloud region where annotation should take place. Supported cloud - // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - // is specified, a region will be determined based on video file location. - string location_id = 5; -} - -// Video context and/or feature-specific parameters. -message VideoContext { - // Video segments to annotate. The segments may overlap and are not required - // to be contiguous or span the whole video. If unspecified, each video is - // treated as a single segment. - repeated VideoSegment segments = 1; - - // Config for LABEL_DETECTION. - LabelDetectionConfig label_detection_config = 2; - - // Config for SHOT_CHANGE_DETECTION. - ShotChangeDetectionConfig shot_change_detection_config = 3; - - // Config for EXPLICIT_CONTENT_DETECTION. - ExplicitContentDetectionConfig explicit_content_detection_config = 4; - - // Config for TEXT_DETECTION. - TextDetectionConfig text_detection_config = 8; -} - -// Config for LABEL_DETECTION. -message LabelDetectionConfig { - // What labels should be detected with LABEL_DETECTION, in addition to - // video-level labels or segment-level labels. - // If unspecified, defaults to `SHOT_MODE`. - LabelDetectionMode label_detection_mode = 1; - - // Whether the video has been shot from a stationary (i.e. non-moving) camera. - // When set to true, might improve detection accuracy for moving objects. - // Should be used with `SHOT_AND_FRAME_MODE` enabled. - bool stationary_camera = 2; - - // Model to use for label detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// Config for SHOT_CHANGE_DETECTION. -message ShotChangeDetectionConfig { - // Model to use for shot change detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for EXPLICIT_CONTENT_DETECTION. -message ExplicitContentDetectionConfig { - // Model to use for explicit content detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for TEXT_DETECTION. -message TextDetectionConfig { - // Language hint can be specified if the language to be detected is known a - // priori. It can increase the accuracy of the detection. Language hint must - // be language code in BCP-47 format. - // - // Automatic language detection is performed if no hint is provided. - repeated string language_hints = 1; -} - -// Video segment. -message VideoSegment { - // Time-offset, relative to the beginning of the video, - // corresponding to the start of the segment (inclusive). - google.protobuf.Duration start_time_offset = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the end of the segment (inclusive). - google.protobuf.Duration end_time_offset = 2; -} - -// Video segment level annotation results for label detection. -message LabelSegment { - // Video segment where a label was detected. - VideoSegment segment = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Video frame level annotation results for label detection. -message LabelFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Detected entity from video analysis. -message Entity { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string entity_id = 1; - - // Textual description, e.g. `Fixed-gear bicycle`. - string description = 2; - - // Language code for `description` in BCP-47 format. - string language_code = 3; -} - -// Label annotation. -message LabelAnnotation { - // Detected entity. - Entity entity = 1; - - // Common categories for the detected entity. - // E.g. when the label is `Terrier` the category is likely `dog`. And in some - // cases there might be more than one categories e.g. `Terrier` could also be - // a `pet`. - repeated Entity category_entities = 2; - - // All video segments where a label was detected. - repeated LabelSegment segments = 3; - - // All video frames where a label was detected. - repeated LabelFrame frames = 4; -} - -// Video frame level annotation results for explicit content. -message ExplicitContentFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Likelihood of the pornography content.. - Likelihood pornography_likelihood = 2; -} - -// Explicit content annotation (based on per-frame visual signals only). -// If no explicit content has been detected in a frame, no annotations are -// present for that frame. -message ExplicitContentAnnotation { - // All video frames where explicit content was detected. - repeated ExplicitContentFrame frames = 1; -} - -// Normalized bounding box. -// The normalized vertex coordinates are relative to the original image. -// Range: [0, 1]. -message NormalizedBoundingBox { - // Left X coordinate. - float left = 1; - - // Top Y coordinate. - float top = 2; - - // Right X coordinate. - float right = 3; - - // Bottom Y coordinate. - float bottom = 4; -} - -// Annotation results for a single video. -message VideoAnnotationResults { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. - repeated LabelAnnotation segment_label_annotations = 2; - - // Label annotations on shot level. - // There is exactly one element for each unique label. - repeated LabelAnnotation shot_label_annotations = 3; - - // Label annotations on frame level. - // There is exactly one element for each unique label. - repeated LabelAnnotation frame_label_annotations = 4; - - // Shot annotations. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 6; - - // Explicit content annotation. - ExplicitContentAnnotation explicit_annotation = 7; - - // OCR text detection and tracking. - // Annotations for list of detected text snippets. Each will have list of - // frame information associated with it. - repeated TextAnnotation text_annotations = 12; - - // Annotations for list of objects detected and tracked in video. - repeated ObjectTrackingAnnotation object_annotations = 14; - - // If set, indicates an error. Note that for a single `AnnotateVideoRequest` - // some videos may succeed and some may fail. - google.rpc.Status error = 9; -} - -// Video annotation response. Included in the `response` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoResponse { - // Annotation results for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationResults annotation_results = 1; -} - -// Annotation progress for a single video. -message VideoAnnotationProgress { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Approximate percentage processed thus far. Guaranteed to be - // 100 when fully processed. - int32 progress_percent = 2; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 3; - - // Time of the most recent update. - google.protobuf.Timestamp update_time = 4; -} - -// Video annotation progress. Included in the `metadata` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoProgress { - // Progress metadata for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationProgress annotation_progress = 1; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// Normalized bounding polygon for text (that might not be aligned with axis). -// Contains list of the corner points in clockwise order starting from -// top-left corner. For example, for a rectangular bounding box: -// When the text is horizontal it might look like: -// 0----1 -// | | -// 3----2 -// -// When it's clockwise rotated 180 degrees around the top-left corner it -// becomes: -// 2----3 -// | | -// 1----0 -// -// and the vertex order will still be (0, 1, 2, 3). Note that values can be less -// than 0, or greater than 1 due to trignometric calculations for location of -// the box. -message NormalizedBoundingPoly { - // Normalized vertices of the bounding polygon. - repeated NormalizedVertex vertices = 1; -} - -// Video segment level annotation results for text detection. -message TextSegment { - // Video segment where a text snippet was detected. - VideoSegment segment = 1; - - // Confidence for the track of detected text. It is calculated as the highest - // over all frames where OCR detected text appears. - float confidence = 2; - - // Information related to the frames where OCR detected text appears. - repeated TextFrame frames = 3; -} - -// Video frame level annotation results for text annotation (OCR). -// Contains information regarding timestamp and bounding box locations for the -// frames containing detected OCR text snippets. -message TextFrame { - // Bounding polygon of the detected text for this frame. - NormalizedBoundingPoly rotated_bounding_box = 1; - - // Timestamp of this frame. - google.protobuf.Duration time_offset = 2; -} - -// Annotations related to one detected OCR text snippet. This will contain the -// corresponding text, confidence value, and frame level information for each -// detection. -message TextAnnotation { - // The detected text. - string text = 1; - - // All video segments where OCR detected text appears. - repeated TextSegment segments = 2; -} - -// Video frame level annotations for object detection and tracking. This field -// stores per frame location, time offset, and confidence. -message ObjectTrackingFrame { - // The normalized bounding box location of this object track for the frame. - NormalizedBoundingBox normalized_bounding_box = 1; - - // The timestamp of the frame in microseconds. - google.protobuf.Duration time_offset = 2; -} - -// Annotations corresponding to one tracked object. -message ObjectTrackingAnnotation { - // Entity to specify the object category that this track is labeled as. - Entity entity = 1; - - // Object category's labeling confidence of this track. - float confidence = 4; - - // Information corresponding to all frames where this object track appears. - repeated ObjectTrackingFrame frames = 2; - - // Each object track corresponds to one video segment where it appears. - VideoSegment segment = 3; -} - -// Video annotation feature. -enum Feature { - // Unspecified. - FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - LABEL_DETECTION = 1; - - // Shot change detection. - SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - EXPLICIT_CONTENT_DETECTION = 3; - - // OCR text detection and tracking. - TEXT_DETECTION = 7; - - // Object detection and tracking. - OBJECT_TRACKING = 9; -} - -// Label detection mode. -enum LabelDetectionMode { - // Unspecified. - LABEL_DETECTION_MODE_UNSPECIFIED = 0; - - // Detect shot-level labels. - SHOT_MODE = 1; - - // Detect frame-level labels. - FRAME_MODE = 2; - - // Detect both shot-level and frame-level labels. - SHOT_AND_FRAME_MODE = 3; -} - -// Bucketized representation of likelihood. -enum Likelihood { - // Unspecified likelihood. - LIKELIHOOD_UNSPECIFIED = 0; - - // Very unlikely. - VERY_UNLIKELY = 1; - - // Unlikely. - UNLIKELY = 2; - - // Possible. - POSSIBLE = 3; - - // Likely. - LIKELY = 4; - - // Very likely. - VERY_LIKELY = 5; -} diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2.py deleted file mode 100644 index 73e3c2d5cdba..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2.py +++ /dev/null @@ -1,2711 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto", - package="google.cloud.videointelligence.v1p2beta1", - syntax="proto3", - serialized_options=_b( - "\n,com.google.cloud.videointelligence.v1p2beta1B\035VideoIntelligenceServiceProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence\252\002(Google.Cloud.VideoIntelligence.V1P2Beta1\312\002(Google\\Cloud\\VideoIntelligence\\V1p2beta1\352\002+Google::Cloud::VideoIntelligence::V1p2beta1" - ), - serialized_pb=_b( - '\nGgoogle/cloud/videointelligence_v1p2beta1/proto/video_intelligence.proto\x12(google.cloud.videointelligence.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xfd\x01\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\x0c\x12\x43\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32\x31.google.cloud.videointelligence.v1p2beta1.Feature\x12M\n\rvideo_context\x18\x03 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t"\xf6\x03\n\x0cVideoContext\x12H\n\x08segments\x18\x01 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoSegment\x12^\n\x16label_detection_config\x18\x02 \x01(\x0b\x32>.google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig\x12i\n\x1cshot_change_detection_config\x18\x03 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig\x12s\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32H.google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig\x12\\\n\x15text_detection_config\x18\x08 \x01(\x0b\x32=.google.cloud.videointelligence.v1p2beta1.TextDetectionConfig"\x9c\x01\n\x14LabelDetectionConfig\x12Z\n\x14label_detection_mode\x18\x01 \x01(\x0e\x32<.google.cloud.videointelligence.v1p2beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x02 \x01(\x08\x12\r\n\x05model\x18\x03 \x01(\t"*\n\x19ShotChangeDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"/\n\x1e\x45xplicitContentDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"-\n\x13TextDetectionConfig\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t"x\n\x0cVideoSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"k\n\x0cLabelSegment\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02"P\n\nLabelFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x02 \x01(\x02"G\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t"\xb0\x02\n\x0fLabelAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p2beta1.Entity\x12K\n\x11\x63\x61tegory_entities\x18\x02 \x03(\x0b\x32\x30.google.cloud.videointelligence.v1p2beta1.Entity\x12H\n\x08segments\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.LabelSegment\x12\x44\n\x06\x66rames\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1p2beta1.LabelFrame"\x9c\x01\n\x14\x45xplicitContentFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12T\n\x16pornography_likelihood\x18\x02 \x01(\x0e\x32\x34.google.cloud.videointelligence.v1p2beta1.Likelihood"k\n\x19\x45xplicitContentAnnotation\x12N\n\x06\x66rames\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame"Q\n\x15NormalizedBoundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x02\x12\x0b\n\x03top\x18\x02 \x01(\x02\x12\r\n\x05right\x18\x03 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x02"\xcb\x05\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\\\n\x19segment_label_annotations\x18\x02 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p2beta1.LabelAnnotation\x12Y\n\x16shot_label_annotations\x18\x03 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p2beta1.LabelAnnotation\x12Z\n\x17\x66rame_label_annotations\x18\x04 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p2beta1.LabelAnnotation\x12P\n\x10shot_annotations\x18\x06 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoSegment\x12`\n\x13\x65xplicit_annotation\x18\x07 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation\x12R\n\x10text_annotations\x18\x0c \x03(\x0b\x32\x38.google.cloud.videointelligence.v1p2beta1.TextAnnotation\x12^\n\x12object_annotations\x18\x0e \x03(\x0b\x32\x42.google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"u\n\x15\x41nnotateVideoResponse\x12\\\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32@.google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults"\xa7\x01\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"w\n\x15\x41nnotateVideoProgress\x12^\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32\x41.google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"f\n\x16NormalizedBoundingPoly\x12L\n\x08vertices\x18\x01 \x03(\x0b\x32:.google.cloud.videointelligence.v1p2beta1.NormalizedVertex"\xaf\x01\n\x0bTextSegment\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x43\n\x06\x66rames\x18\x03 \x03(\x0b\x32\x33.google.cloud.videointelligence.v1p2beta1.TextFrame"\x9b\x01\n\tTextFrame\x12^\n\x14rotated_bounding_box\x18\x01 \x01(\x0b\x32@.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"g\n\x0eTextAnnotation\x12\x0c\n\x04text\x18\x01 \x01(\t\x12G\n\x08segments\x18\x02 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1p2beta1.TextSegment"\xa7\x01\n\x13ObjectTrackingFrame\x12`\n\x17normalized_bounding_box\x18\x01 \x01(\x0b\x32?.google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\x88\x02\n\x18ObjectTrackingAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p2beta1.Entity\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12M\n\x06\x66rames\x18\x02 \x03(\x0b\x32=.google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame\x12G\n\x07segment\x18\x03 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p2beta1.VideoSegment*\x9b\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x02\x12\x1e\n\x1a\x45XPLICIT_CONTENT_DETECTION\x10\x03\x12\x12\n\x0eTEXT_DETECTION\x10\x07\x12\x13\n\x0fOBJECT_TRACKING\x10\t*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xb2\x01\n\x18VideoIntelligenceService\x12\x95\x01\n\rAnnotateVideo\x12>.google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation"%\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p2beta1/videos:annotate:\x01*B\xae\x02\n,com.google.cloud.videointelligence.v1p2beta1B\x1dVideoIntelligenceServiceProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p2beta1;videointelligence\xaa\x02(Google.Cloud.VideoIntelligence.V1P2Beta1\xca\x02(Google\\Cloud\\VideoIntelligence\\V1p2beta1\xea\x02+Google::Cloud::VideoIntelligence::V1p2beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.videointelligence.v1p2beta1.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=4, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_TRACKING", - index=5, - number=9, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4531, - serialized_end=4686, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name="LabelDetectionMode", - full_name="google.cloud.videointelligence.v1p2beta1.LabelDetectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_MODE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FRAME_MODE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHOT_AND_FRAME_MODE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4688, - serialized_end=4802, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.videointelligence.v1p2beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4804, - serialized_end=4920, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -SHOT_CHANGE_DETECTION = 2 -EXPLICIT_CONTENT_DETECTION = 3 -TEXT_DETECTION = 7 -OBJECT_TRACKING = 9 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="AnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.input_content", - index=1, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.features", - index=2, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_context", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.video_context", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.output_uri", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest.location_id", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=275, - serialized_end=528, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name="VideoContext", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext.segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext.label_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext.shot_change_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_detection_config", - full_name="google.cloud.videointelligence.v1p2beta1.VideoContext.text_detection_config", - index=4, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=531, - serialized_end=1033, -) - - -_LABELDETECTIONCONFIG = _descriptor.Descriptor( - name="LabelDetectionConfig", - full_name="google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label_detection_mode", - full_name="google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.label_detection_mode", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.stationary_camera", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1036, - serialized_end=1192, -) - - -_SHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="ShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1194, - serialized_end=1236, -) - - -_EXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="ExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1238, - serialized_end=1285, -) - - -_TEXTDETECTIONCONFIG = _descriptor.Descriptor( - name="TextDetectionConfig", - full_name="google.cloud.videointelligence.v1p2beta1.TextDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.videointelligence.v1p2beta1.TextDetectionConfig.language_hints", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1287, - serialized_end=1332, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name="VideoSegment", - full_name="google.cloud.videointelligence.v1p2beta1.VideoSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.VideoSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.VideoSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1334, - serialized_end=1454, -) - - -_LABELSEGMENT = _descriptor.Descriptor( - name="LabelSegment", - full_name="google.cloud.videointelligence.v1p2beta1.LabelSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p2beta1.LabelSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p2beta1.LabelSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1456, - serialized_end=1563, -) - - -_LABELFRAME = _descriptor.Descriptor( - name="LabelFrame", - full_name="google.cloud.videointelligence.v1p2beta1.LabelFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.LabelFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p2beta1.LabelFrame.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1565, - serialized_end=1645, -) - - -_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.videointelligence.v1p2beta1.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.videointelligence.v1p2beta1.Entity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1p2beta1.Entity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p2beta1.Entity.language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1647, - serialized_end=1718, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name="LabelAnnotation", - full_name="google.cloud.videointelligence.v1p2beta1.LabelAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p2beta1.LabelAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_entities", - full_name="google.cloud.videointelligence.v1p2beta1.LabelAnnotation.category_entities", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p2beta1.LabelAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p2beta1.LabelAnnotation.frames", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1721, - serialized_end=2025, -) - - -_EXPLICITCONTENTFRAME = _descriptor.Descriptor( - name="ExplicitContentFrame", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pornography_likelihood", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame.pornography_likelihood", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2028, - serialized_end=2184, -) - - -_EXPLICITCONTENTANNOTATION = _descriptor.Descriptor( - name="ExplicitContentAnnotation", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation.frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2186, - serialized_end=2293, -) - - -_NORMALIZEDBOUNDINGBOX = _descriptor.Descriptor( - name="NormalizedBoundingBox", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="left", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.left", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="top", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.top", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="right", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.right", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bottom", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox.bottom", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2295, - serialized_end=2376, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="VideoAnnotationResults", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_label_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.segment_label_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_label_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shot_label_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_label_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.frame_label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.shot_annotations", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.explicit_annotation", - index=5, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.text_annotations", - index=6, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_annotations", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.object_annotations", - index=7, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults.error", - index=8, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2379, - serialized_end=3094, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="AnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse.annotation_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3096, - serialized_end=3213, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name="VideoAnnotationProgress", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.progress_percent", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.start_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3216, - serialized_end=3383, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name="AnnotateVideoProgress", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_progress", - full_name="google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress.annotation_progress", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3385, - serialized_end=3504, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3506, - serialized_end=3546, -) - - -_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( - name="NormalizedBoundingPoly", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3548, - serialized_end=3650, -) - - -_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.videointelligence.v1p2beta1.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p2beta1.TextSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p2beta1.TextSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p2beta1.TextSegment.frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3653, - serialized_end=3828, -) - - -_TEXTFRAME = _descriptor.Descriptor( - name="TextFrame", - full_name="google.cloud.videointelligence.v1p2beta1.TextFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="rotated_bounding_box", - full_name="google.cloud.videointelligence.v1p2beta1.TextFrame.rotated_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.TextFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3831, - serialized_end=3986, -) - - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.videointelligence.v1p2beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.videointelligence.v1p2beta1.TextAnnotation.text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p2beta1.TextAnnotation.segments", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3988, - serialized_end=4091, -) - - -_OBJECTTRACKINGFRAME = _descriptor.Descriptor( - name="ObjectTrackingFrame", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_box", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.normalized_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4094, - serialized_end=4261, -) - - -_OBJECTTRACKINGANNOTATION = _descriptor.Descriptor( - name="ObjectTrackingAnnotation", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.confidence", - index=1, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.frames", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation.segment", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4264, - serialized_end=4528, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name["features"].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name["video_context"].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name[ - "label_detection_config" -].message_type = _LABELDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "shot_change_detection_config" -].message_type = _SHOTCHANGEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "explicit_content_detection_config" -].message_type = _EXPLICITCONTENTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "text_detection_config" -].message_type = _TEXTDETECTIONCONFIG -_LABELDETECTIONCONFIG.fields_by_name[ - "label_detection_mode" -].enum_type = _LABELDETECTIONMODE -_VIDEOSEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOSEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_LABELFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["category_entities"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["segments"].message_type = _LABELSEGMENT -_LABELANNOTATION.fields_by_name["frames"].message_type = _LABELFRAME -_EXPLICITCONTENTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_EXPLICITCONTENTFRAME.fields_by_name["pornography_likelihood"].enum_type = _LIKELIHOOD -_EXPLICITCONTENTANNOTATION.fields_by_name["frames"].message_type = _EXPLICITCONTENTFRAME -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "frame_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name["shot_annotations"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "text_annotations" -].message_type = _TEXTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "object_annotations" -].message_type = _OBJECTTRACKINGANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_ANNOTATEVIDEOPROGRESS.fields_by_name[ - "annotation_progress" -].message_type = _VIDEOANNOTATIONPROGRESS -_NORMALIZEDBOUNDINGPOLY.fields_by_name["vertices"].message_type = _NORMALIZEDVERTEX -_TEXTSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_TEXTSEGMENT.fields_by_name["frames"].message_type = _TEXTFRAME -_TEXTFRAME.fields_by_name["rotated_bounding_box"].message_type = _NORMALIZEDBOUNDINGPOLY -_TEXTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TEXTANNOTATION.fields_by_name["segments"].message_type = _TEXTSEGMENT -_OBJECTTRACKINGFRAME.fields_by_name[ - "normalized_bounding_box" -].message_type = _NORMALIZEDBOUNDINGBOX -_OBJECTTRACKINGFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_OBJECTTRACKINGANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_OBJECTTRACKINGANNOTATION.fields_by_name["frames"].message_type = _OBJECTTRACKINGFRAME -_OBJECTTRACKINGANNOTATION.fields_by_name["segment"].message_type = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["AnnotateVideoRequest"] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name["VideoContext"] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name["LabelDetectionConfig"] = _LABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ShotChangeDetectionConfig" -] = _SHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ExplicitContentDetectionConfig" -] = _EXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["TextDetectionConfig"] = _TEXTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["VideoSegment"] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["LabelSegment"] = _LABELSEGMENT -DESCRIPTOR.message_types_by_name["LabelFrame"] = _LABELFRAME -DESCRIPTOR.message_types_by_name["Entity"] = _ENTITY -DESCRIPTOR.message_types_by_name["LabelAnnotation"] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name["ExplicitContentFrame"] = _EXPLICITCONTENTFRAME -DESCRIPTOR.message_types_by_name[ - "ExplicitContentAnnotation" -] = _EXPLICITCONTENTANNOTATION -DESCRIPTOR.message_types_by_name["NormalizedBoundingBox"] = _NORMALIZEDBOUNDINGBOX -DESCRIPTOR.message_types_by_name["VideoAnnotationResults"] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["AnnotateVideoResponse"] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name["VideoAnnotationProgress"] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoProgress"] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY -DESCRIPTOR.message_types_by_name["TextSegment"] = _TEXTSEGMENT -DESCRIPTOR.message_types_by_name["TextFrame"] = _TEXTFRAME -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["ObjectTrackingFrame"] = _OBJECTTRACKINGFRAME -DESCRIPTOR.message_types_by_name["ObjectTrackingAnnotation"] = _OBJECTTRACKINGANNOTATION -DESCRIPTOR.enum_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.enum_types_by_name["LabelDetectionMode"] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. If unset, the input video(s) should be - specified via ``input_uri``. If set, ``input_uri`` should be - unset. - features: - Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType( - "VideoContext", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCONTEXT, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_config: - Config for LABEL\_DETECTION. - shot_change_detection_config: - Config for SHOT\_CHANGE\_DETECTION. - explicit_content_detection_config: - Config for EXPLICIT\_CONTENT\_DETECTION. - text_detection_config: - Config for TEXT\_DETECTION. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoContext) - ), -) -_sym_db.RegisterMessage(VideoContext) - -LabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "LabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Config for LABEL\_DETECTION. - - - Attributes: - label_detection_mode: - What labels should be detected with LABEL\_DETECTION, in - addition to video-level labels or segment-level labels. If - unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. Should be used with - ``SHOT_AND_FRAME_MODE`` enabled. - model: - Model to use for label detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(LabelDetectionConfig) - -ShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Config for SHOT\_CHANGE\_DETECTION. - - - Attributes: - model: - Model to use for shot change detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(ShotChangeDetectionConfig) - -ExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Config for EXPLICIT\_CONTENT\_DETECTION. - - - Attributes: - model: - Model to use for explicit content detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(ExplicitContentDetectionConfig) - -TextDetectionConfig = _reflection.GeneratedProtocolMessageType( - "TextDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Config for TEXT\_DETECTION. - - - Attributes: - language_hints: - Language hint can be specified if the language to be detected - is known a priori. It can increase the accuracy of the - detection. Language hint must be language code in BCP-47 - format. Automatic language detection is performed if no hint - is provided. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextDetectionConfig) - ), -) -_sym_db.RegisterMessage(TextDetectionConfig) - -VideoSegment = _reflection.GeneratedProtocolMessageType( - "VideoSegment", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOSEGMENT, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video segment. - - - Attributes: - start_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the start of the segment (inclusive). - end_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the end of the segment (inclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoSegment) - ), -) -_sym_db.RegisterMessage(VideoSegment) - -LabelSegment = _reflection.GeneratedProtocolMessageType( - "LabelSegment", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSEGMENT, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for label detection. - - - Attributes: - segment: - Video segment where a label was detected. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelSegment) - ), -) -_sym_db.RegisterMessage(LabelSegment) - -LabelFrame = _reflection.GeneratedProtocolMessageType( - "LabelFrame", - (_message.Message,), - dict( - DESCRIPTOR=_LABELFRAME, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for label detection. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelFrame) - ), -) -_sym_db.RegisterMessage(LabelFrame) - -Entity = _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITY, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Detected entity from video analysis. - - - Attributes: - entity_id: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.Entity) - ), -) -_sym_db.RegisterMessage(Entity) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType( - "LabelAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LABELANNOTATION, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Label annotation. - - - Attributes: - entity: - Detected entity. - category_entities: - Common categories for the detected entity. E.g. when the label - is ``Terrier`` the category is likely ``dog``. And in some - cases there might be more than one categories e.g. ``Terrier`` - could also be a ``pet``. - segments: - All video segments where a label was detected. - frames: - All video frames where a label was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.LabelAnnotation) - ), -) -_sym_db.RegisterMessage(LabelAnnotation) - -ExplicitContentFrame = _reflection.GeneratedProtocolMessageType( - "ExplicitContentFrame", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTFRAME, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for explicit content. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - pornography_likelihood: - Likelihood of the pornography content.. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentFrame) - ), -) -_sym_db.RegisterMessage(ExplicitContentFrame) - -ExplicitContentAnnotation = _reflection.GeneratedProtocolMessageType( - "ExplicitContentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTANNOTATION, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Explicit content annotation (based on per-frame visual signals only). If - no explicit content has been detected in a frame, no annotations are - present for that frame. - - - Attributes: - frames: - All video frames where explicit content was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ExplicitContentAnnotation) - ), -) -_sym_db.RegisterMessage(ExplicitContentAnnotation) - -NormalizedBoundingBox = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingBox", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGBOX, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding box. The normalized vertex coordinates are relative - to the original image. Range: [0, 1]. - - - Attributes: - left: - Left X coordinate. - top: - Top Y coordinate. - right: - Right X coordinate. - bottom: - Bottom Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingBox) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingBox) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Annotation results for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - segment_label_annotations: - Label annotations on video level or user specified segment - level. There is exactly one element for each unique label. - shot_label_annotations: - Label annotations on shot level. There is exactly one element - for each unique label. - frame_label_annotations: - Label annotations on frame level. There is exactly one element - for each unique label. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - explicit_annotation: - Explicit content annotation. - text_annotations: - OCR text detection and tracking. Annotations for list of - detected text snippets. Each will have list of frame - information associated with it. - object_annotations: - Annotations for list of objects detected and tracked in video. - error: - If set, indicates an error. Note that for a single - ``AnnotateVideoRequest`` some videos may succeed and some may - fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationProgress", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONPROGRESS, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Annotation progress for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - progress_percent: - Approximate percentage processed thus far. Guaranteed to be - 100 when fully processed. - start_time: - Time when the request was received. - update_time: - Time of the most recent update. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.VideoAnnotationProgress) - ), -) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoProgress", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOPROGRESS, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.AnnotateVideoProgress) - ), -) -_sym_db.RegisterMessage(AnnotateVideoProgress) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding polygon for text (that might not be aligned with - axis). Contains list of the corner points in clockwise order starting - from top-left corner. For example, for a rectangular bounding box: When - the text is horizontal it might look like: 0----1 \| \| 3----2 - - When it's clockwise rotated 180 degrees around the top-left corner it - becomes: 2----3 \| \| 1----0 - - and the vertex order will still be (0, 1, 2, 3). Note that values can be - less than 0, or greater than 1 due to trignometric calculations for - location of the box. - - - Attributes: - vertices: - Normalized vertices of the bounding polygon. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.NormalizedBoundingPoly) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingPoly) - -TextSegment = _reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSEGMENT, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for text detection. - - - Attributes: - segment: - Video segment where a text snippet was detected. - confidence: - Confidence for the track of detected text. It is calculated as - the highest over all frames where OCR detected text appears. - frames: - Information related to the frames where OCR detected text - appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextSegment) - ), -) -_sym_db.RegisterMessage(TextSegment) - -TextFrame = _reflection.GeneratedProtocolMessageType( - "TextFrame", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTFRAME, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for text annotation (OCR). Contains - information regarding timestamp and bounding box locations for the - frames containing detected OCR text snippets. - - - Attributes: - rotated_bounding_box: - Bounding polygon of the detected text for this frame. - time_offset: - Timestamp of this frame. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextFrame) - ), -) -_sym_db.RegisterMessage(TextFrame) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Annotations related to one detected OCR text snippet. This will contain - the corresponding text, confidence value, and frame level information - for each detection. - - - Attributes: - text: - The detected text. - segments: - All video segments where OCR detected text appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) - -ObjectTrackingFrame = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingFrame", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGFRAME, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotations for object detection and tracking. This - field stores per frame location, time offset, and confidence. - - - Attributes: - normalized_bounding_box: - The normalized bounding box location of this object track for - the frame. - time_offset: - The timestamp of the frame in microseconds. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ObjectTrackingFrame) - ), -) -_sym_db.RegisterMessage(ObjectTrackingFrame) - -ObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGANNOTATION, - __module__="google.cloud.videointelligence_v1p2beta1.proto.video_intelligence_pb2", - __doc__="""Annotations corresponding to one tracked object. - - - Attributes: - entity: - Entity to specify the object category that this track is - labeled as. - confidence: - Object category's labeling confidence of this track. - frames: - Information corresponding to all frames where this object - track appears. - segment: - Each object track corresponds to one video segment where it - appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p2beta1.ObjectTrackingAnnotation) - ), -) -_sym_db.RegisterMessage(ObjectTrackingAnnotation) - - -DESCRIPTOR._options = None - -_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="VideoIntelligenceService", - full_name="google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=4923, - serialized_end=5101, - methods=[ - _descriptor.MethodDescriptor( - name="AnnotateVideo", - full_name="google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService.AnnotateVideo", - index=0, - containing_service=None, - input_type=_ANNOTATEVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p2beta1/videos:annotate:\001*' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name["VideoIntelligenceService"] = _VIDEOINTELLIGENCESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2_grpc.py deleted file mode 100644 index 72674da5e4ef..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/proto/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,56 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.videointelligence_v1p2beta1.proto import ( - video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1p2beta1_dot_proto_dot_video__intelligence__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - "/google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService/AnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1p2beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AnnotateVideo": grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1p2beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1p2beta1.VideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1p2beta1/types.py b/videointelligence/google/cloud/videointelligence_v1p2beta1/types.py deleted file mode 100644 index 0b70adb8a73f..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p2beta1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [video_intelligence_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.videointelligence_v1p2beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py deleted file mode 100644 index fd8f0071f62a..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import - -from google.cloud.videointelligence_v1p3beta1 import types -from google.cloud.videointelligence_v1p3beta1.gapic import enums -from google.cloud.videointelligence_v1p3beta1.gapic import ( - streaming_video_intelligence_service_client, -) -from google.cloud.videointelligence_v1p3beta1.gapic import ( - video_intelligence_service_client, -) - - -class VideoIntelligenceServiceClient( - video_intelligence_service_client.VideoIntelligenceServiceClient -): - __doc__ = video_intelligence_service_client.VideoIntelligenceServiceClient.__doc__ - enums = enums - - -class StreamingVideoIntelligenceServiceClient( - streaming_video_intelligence_service_client.StreamingVideoIntelligenceServiceClient -): - __doc__ = ( - streaming_video_intelligence_service_client.StreamingVideoIntelligenceServiceClient.__doc__ - ) - enums = enums - - -__all__ = ( - "enums", - "types", - "VideoIntelligenceServiceClient", - "StreamingVideoIntelligenceServiceClient", -) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/__init__.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/enums.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/enums.py deleted file mode 100644 index 4aa081ac73a0..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/enums.py +++ /dev/null @@ -1,107 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Feature(enum.IntEnum): - """ - Video annotation feature. - - Attributes: - FEATURE_UNSPECIFIED (int): Unspecified. - LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - SHOT_CHANGE_DETECTION (int): Shot change detection. - EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - SPEECH_TRANSCRIPTION (int): Speech transcription. - TEXT_DETECTION (int): OCR text detection and tracking. - OBJECT_TRACKING (int): Object detection and tracking. - LOGO_RECOGNITION (int): Logo detection, tracking, and recognition. - CELEBRITY_RECOGNITION (int): Celebrity recognition. - """ - - FEATURE_UNSPECIFIED = 0 - LABEL_DETECTION = 1 - SHOT_CHANGE_DETECTION = 2 - EXPLICIT_CONTENT_DETECTION = 3 - SPEECH_TRANSCRIPTION = 6 - TEXT_DETECTION = 7 - OBJECT_TRACKING = 9 - LOGO_RECOGNITION = 12 - CELEBRITY_RECOGNITION = 13 - - -class LabelDetectionMode(enum.IntEnum): - """ - Label detection mode. - - Attributes: - LABEL_DETECTION_MODE_UNSPECIFIED (int): Unspecified. - SHOT_MODE (int): Detect shot-level labels. - FRAME_MODE (int): Detect frame-level labels. - SHOT_AND_FRAME_MODE (int): Detect both shot-level and frame-level labels. - """ - - LABEL_DETECTION_MODE_UNSPECIFIED = 0 - SHOT_MODE = 1 - FRAME_MODE = 2 - SHOT_AND_FRAME_MODE = 3 - - -class Likelihood(enum.IntEnum): - """ - Bucketized representation of likelihood. - - Attributes: - LIKELIHOOD_UNSPECIFIED (int): Unspecified likelihood. - VERY_UNLIKELY (int): Very unlikely. - UNLIKELY (int): Unlikely. - POSSIBLE (int): Possible. - LIKELY (int): Likely. - VERY_LIKELY (int): Very likely. - """ - - LIKELIHOOD_UNSPECIFIED = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class StreamingFeature(enum.IntEnum): - """ - Streaming video annotation feature. - - Attributes: - STREAMING_FEATURE_UNSPECIFIED (int): Unspecified. - STREAMING_LABEL_DETECTION (int): Label detection. Detect objects, such as dog or flower. - STREAMING_SHOT_CHANGE_DETECTION (int): Shot change detection. - STREAMING_EXPLICIT_CONTENT_DETECTION (int): Explicit content detection. - STREAMING_OBJECT_TRACKING (int): Object detection and tracking. - STREAMING_AUTOML_CLASSIFICATION (int): Video classification based on AutoML model. - STREAMING_AUTOML_OBJECT_TRACKING (int): Object detection and tracking based on AutoML model. - """ - - STREAMING_FEATURE_UNSPECIFIED = 0 - STREAMING_LABEL_DETECTION = 1 - STREAMING_SHOT_CHANGE_DETECTION = 2 - STREAMING_EXPLICIT_CONTENT_DETECTION = 3 - STREAMING_OBJECT_TRACKING = 4 - STREAMING_AUTOML_CLASSIFICATION = 21 - STREAMING_AUTOML_OBJECT_TRACKING = 22 diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client.py deleted file mode 100644 index 6445359b9cce..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client.py +++ /dev/null @@ -1,254 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1p3beta1 StreamingVideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.videointelligence_v1p3beta1.gapic import enums -from google.cloud.videointelligence_v1p3beta1.gapic import ( - streaming_video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1p3beta1.gapic.transports import ( - streaming_video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class StreamingVideoIntelligenceServiceClient(object): - """Service that implements streaming Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = ( - "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService" - ) - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - StreamingVideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.StreamingVideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.StreamingVideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = streaming_video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=streaming_video_intelligence_service_grpc_transport.StreamingVideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = streaming_video_intelligence_service_grpc_transport.StreamingVideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def streaming_annotate_video( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs video annotation with bidirectional streaming: emitting results - while sending video/audio bytes. - This method is only available via the gRPC API (not REST). - - EXPERIMENTAL: This method interface might change in the future. - - Example: - >>> from google.cloud import videointelligence_v1p3beta1 - >>> - >>> client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() - >>> - >>> request = {} - >>> - >>> requests = [request] - >>> for element in client.streaming_annotate_video(requests): - ... # process element - ... pass - - Args: - requests (iterator[dict|google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2.StreamingAnnotateVideoRequest]): The input objects. If a dict is provided, it must be of the - same form as the protobuf message :class:`~google.cloud.videointelligence_v1p3beta1.types.StreamingAnnotateVideoRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - Iterable[~google.cloud.videointelligence_v1p3beta1.types.StreamingAnnotateVideoResponse]. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "streaming_annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "streaming_annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.streaming_annotate_video, - default_retry=self._method_configs["StreamingAnnotateVideo"].retry, - default_timeout=self._method_configs["StreamingAnnotateVideo"].timeout, - client_info=self._client_info, - ) - - return self._inner_api_calls["streaming_annotate_video"]( - requests, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client_config.py deleted file mode 100644 index 53bb98727164..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/streaming_video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 10800000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 10800000, - "total_timeout_millis": 10800000, - } - }, - "methods": { - "StreamingAnnotateVideo": { - "timeout_millis": 10800000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/__init__.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/streaming_video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/streaming_video_intelligence_service_grpc_transport.py deleted file mode 100644 index d51a8f145472..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/streaming_video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,130 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers - -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2_grpc - - -class StreamingVideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1p3beta1 StreamingVideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "streaming_video_intelligence_service_stub": video_intelligence_pb2_grpc.StreamingVideoIntelligenceServiceStub( - channel - ) - } - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def streaming_annotate_video(self): - """Return the gRPC stub for :meth:`StreamingVideoIntelligenceServiceClient.streaming_annotate_video`. - - Performs video annotation with bidirectional streaming: emitting results - while sending video/audio bytes. - This method is only available via the gRPC API (not REST). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs[ - "streaming_video_intelligence_service_stub" - ].StreamingAnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/video_intelligence_service_grpc_transport.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/video_intelligence_service_grpc_transport.py deleted file mode 100644 index ecd2f03c054b..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/transports/video_intelligence_service_grpc_transport.py +++ /dev/null @@ -1,137 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -import google.api_core.grpc_helpers -import google.api_core.operations_v1 - -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2_grpc - - -class VideoIntelligenceServiceGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.videointelligence.v1p3beta1 VideoIntelligenceService API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ("https://www.googleapis.com/auth/cloud-platform",) - - def __init__( - self, - channel=None, - credentials=None, - address="videointelligence.googleapis.com:443", - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "video_intelligence_service_stub": video_intelligence_pb2_grpc.VideoIntelligenceServiceStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="videointelligence.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def annotate_video(self): - """Return the gRPC stub for :meth:`VideoIntelligenceServiceClient.annotate_video`. - - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["video_intelligence_service_stub"].AnnotateVideo diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client.py deleted file mode 100644 index 0175c889f53d..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client.py +++ /dev/null @@ -1,308 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Accesses the google.cloud.videointelligence.v1p3beta1 VideoIntelligenceService API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -import google.api_core.operations_v1 -import grpc - -from google.cloud.videointelligence_v1p3beta1.gapic import enums -from google.cloud.videointelligence_v1p3beta1.gapic import ( - video_intelligence_service_client_config, -) -from google.cloud.videointelligence_v1p3beta1.gapic.transports import ( - video_intelligence_service_grpc_transport, -) -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2 -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution( - "google-cloud-videointelligence" -).version - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = "videointelligence.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = ( - "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService" - ) - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - VideoIntelligenceServiceClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.VideoIntelligenceServiceGrpcTransport, - Callable[[~.Credentials, type], ~.VideoIntelligenceServiceGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = video_intelligence_service_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = video_intelligence_service_grpc_transport.VideoIntelligenceServiceGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def annotate_video( - self, - input_uri=None, - input_content=None, - features=None, - video_context=None, - output_uri=None, - location_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Performs asynchronous video annotation. Progress and results can be - retrieved through the ``google.longrunning.Operations`` interface. - ``Operation.metadata`` contains ``AnnotateVideoProgress`` (progress). - ``Operation.response`` contains ``AnnotateVideoResponse`` (results). - - Example: - >>> from google.cloud import videointelligence_v1p3beta1 - >>> from google.cloud.videointelligence_v1p3beta1 import enums - >>> - >>> client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() - >>> - >>> input_uri = 'gs://cloud-samples-data/video/cat.mp4' - >>> features_element = enums.Feature.LABEL_DETECTION - >>> features = [features_element] - >>> - >>> response = client.annotate_video(input_uri=input_uri, features=features) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (str): Input video location. Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. A video - URI may include wildcards in ``object-id``, and thus identify multiple - videos. Supported wildcards: '\*' to match 0 or more characters; '?' to - match 1 character. If unset, the input video should be embedded in the - request as ``input_content``. If set, ``input_content`` should be unset. - input_content (bytes): The video data bytes. If unset, the input video(s) should be specified - via ``input_uri``. If set, ``input_uri`` should be unset. - features (list[~google.cloud.videointelligence_v1p3beta1.types.Feature]): Required. Requested video annotation features. - video_context (Union[dict, ~google.cloud.videointelligence_v1p3beta1.types.VideoContext]): Additional video context and/or feature-specific parameters. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.videointelligence_v1p3beta1.types.VideoContext` - output_uri (str): Optional. Location where the output (in JSON format) should be stored. - Currently, only `Google Cloud - Storage `__ URIs are supported, which - must be specified in the following format: ``gs://bucket-id/object-id`` - (other URI formats return ``google.rpc.Code.INVALID_ARGUMENT``). For - more information, see `Request - URIs `__. - location_id (str): Optional. Cloud region where annotation should take place. Supported - cloud regions: ``us-east1``, ``us-west1``, ``europe-west1``, - ``asia-east1``. If no region is specified, a region will be determined - based on video file location. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.videointelligence_v1p3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "annotate_video" not in self._inner_api_calls: - self._inner_api_calls[ - "annotate_video" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.annotate_video, - default_retry=self._method_configs["AnnotateVideo"].retry, - default_timeout=self._method_configs["AnnotateVideo"].timeout, - client_info=self._client_info, - ) - - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - input_content=input_content, - features=features, - video_context=video_context, - output_uri=output_uri, - location_id=location_id, - ) - operation = self._inner_api_calls["annotate_video"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - metadata_type=video_intelligence_pb2.AnnotateVideoProgress, - ) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client_config.py deleted file mode 100644 index c15923a1f64e..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/gapic/video_intelligence_service_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 2.5, - "max_retry_delay_millis": 120000, - "initial_rpc_timeout_millis": 120000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 120000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "AnnotateVideo": { - "timeout_millis": 600000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto b/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto deleted file mode 100644 index 1203b3152838..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto +++ /dev/null @@ -1,989 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.videointelligence.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.VideoIntelligence.V1P3Beta1"; -option go_package = "google.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence"; -option java_multiple_files = true; -option java_outer_classname = "VideoIntelligenceServiceProto"; -option java_package = "com.google.cloud.videointelligence.v1p3beta1"; -option php_namespace = "Google\\Cloud\\VideoIntelligence\\V1p3beta1"; - -// Service that implements Google Cloud Video Intelligence API. -service VideoIntelligenceService { - option (google.api.default_host) = "videointelligence.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Performs asynchronous video annotation. Progress and results can be - // retrieved through the `google.longrunning.Operations` interface. - // `Operation.metadata` contains `AnnotateVideoProgress` (progress). - // `Operation.response` contains `AnnotateVideoResponse` (results). - rpc AnnotateVideo(AnnotateVideoRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p3beta1/videos:annotate" - body: "*" - }; - option (google.api.method_signature) = "input_uri,features"; - option (google.longrunning.operation_info) = { - response_type: "AnnotateVideoResponse" - metadata_type: "AnnotateVideoProgress" - }; - } -} - -// Service that implements streaming Google Cloud Video Intelligence API. -service StreamingVideoIntelligenceService { - option (google.api.default_host) = "videointelligence.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Performs video annotation with bidirectional streaming: emitting results - // while sending video/audio bytes. - // This method is only available via the gRPC API (not REST). - rpc StreamingAnnotateVideo(stream StreamingAnnotateVideoRequest) - returns (stream StreamingAnnotateVideoResponse) {} -} - -// Video annotation request. -message AnnotateVideoRequest { - // Input video location. Currently, only - // [Google Cloud Storage](https://cloud.google.com/storage/) URIs are - // supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). A video - // URI may include wildcards in `object-id`, and thus identify multiple - // videos. Supported wildcards: '*' to match 0 or more characters; - // '?' to match 1 character. If unset, the input video should be embedded - // in the request as `input_content`. If set, `input_content` should be unset. - string input_uri = 1; - - // The video data bytes. - // If unset, the input video(s) should be specified via `input_uri`. - // If set, `input_uri` should be unset. - bytes input_content = 6; - - // Required. Requested video annotation features. - repeated Feature features = 2 [(google.api.field_behavior) = REQUIRED]; - - // Additional video context and/or feature-specific parameters. - VideoContext video_context = 3; - - // Optional. Location where the output (in JSON format) should be stored. - // Currently, only [Google Cloud Storage](https://cloud.google.com/storage/) - // URIs are supported, which must be specified in the following format: - // `gs://bucket-id/object-id` (other URI formats return - // [google.rpc.Code.INVALID_ARGUMENT][google.rpc.Code.INVALID_ARGUMENT]). For - // more information, see [Request URIs](/storage/docs/reference-uris). - string output_uri = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Cloud region where annotation should take place. Supported cloud - // regions: `us-east1`, `us-west1`, `europe-west1`, `asia-east1`. If no region - // is specified, a region will be determined based on video file location. - string location_id = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Video context and/or feature-specific parameters. -message VideoContext { - // Video segments to annotate. The segments may overlap and are not required - // to be contiguous or span the whole video. If unspecified, each video is - // treated as a single segment. - repeated VideoSegment segments = 1; - - // Config for LABEL_DETECTION. - LabelDetectionConfig label_detection_config = 2; - - // Config for SHOT_CHANGE_DETECTION. - ShotChangeDetectionConfig shot_change_detection_config = 3; - - // Config for EXPLICIT_CONTENT_DETECTION. - ExplicitContentDetectionConfig explicit_content_detection_config = 4; - - // Config for SPEECH_TRANSCRIPTION. - SpeechTranscriptionConfig speech_transcription_config = 6; - - // Config for TEXT_DETECTION. - TextDetectionConfig text_detection_config = 8; - - // Config for OBJECT_TRACKING. - ObjectTrackingConfig object_tracking_config = 13; -} - -// Config for LABEL_DETECTION. -message LabelDetectionConfig { - // What labels should be detected with LABEL_DETECTION, in addition to - // video-level labels or segment-level labels. - // If unspecified, defaults to `SHOT_MODE`. - LabelDetectionMode label_detection_mode = 1; - - // Whether the video has been shot from a stationary (i.e. non-moving) camera. - // When set to true, might improve detection accuracy for moving objects. - // Should be used with `SHOT_AND_FRAME_MODE` enabled. - bool stationary_camera = 2; - - // Model to use for label detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; - - // The confidence threshold we perform filtering on the labels from - // frame-level detection. If not set, it is set to 0.4 by default. The valid - // range for this threshold is [0.1, 0.9]. Any value set outside of this - // range will be clipped. - // Note: for best results please follow the default threshold. We will update - // the default threshold everytime when we release a new model. - float frame_confidence_threshold = 4; - - // The confidence threshold we perform filtering on the labels from - // video-level and shot-level detections. If not set, it is set to 0.3 by - // default. The valid range for this threshold is [0.1, 0.9]. Any value set - // outside of this range will be clipped. - // Note: for best results please follow the default threshold. We will update - // the default threshold everytime when we release a new model. - float video_confidence_threshold = 5; -} - -// Config for SHOT_CHANGE_DETECTION. -message ShotChangeDetectionConfig { - // Model to use for shot change detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for OBJECT_TRACKING. -message ObjectTrackingConfig { - // Model to use for object tracking. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for EXPLICIT_CONTENT_DETECTION. -message ExplicitContentDetectionConfig { - // Model to use for explicit content detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 1; -} - -// Config for TEXT_DETECTION. -message TextDetectionConfig { - // Language hint can be specified if the language to be detected is known a - // priori. It can increase the accuracy of the detection. Language hint must - // be language code in BCP-47 format. - // - // Automatic language detection is performed if no hint is provided. - repeated string language_hints = 1; - - // Model to use for text detection. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 2; -} - -// Video segment. -message VideoSegment { - // Time-offset, relative to the beginning of the video, - // corresponding to the start of the segment (inclusive). - google.protobuf.Duration start_time_offset = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the end of the segment (inclusive). - google.protobuf.Duration end_time_offset = 2; -} - -// Video segment level annotation results for label detection. -message LabelSegment { - // Video segment where a label was detected. - VideoSegment segment = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Video frame level annotation results for label detection. -message LabelFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Confidence that the label is accurate. Range: [0, 1]. - float confidence = 2; -} - -// Detected entity from video analysis. -message Entity { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string entity_id = 1; - - // Textual description, e.g. `Fixed-gear bicycle`. - string description = 2; - - // Language code for `description` in BCP-47 format. - string language_code = 3; -} - -// Label annotation. -message LabelAnnotation { - // Detected entity. - Entity entity = 1; - - // Common categories for the detected entity. - // E.g. when the label is `Terrier` the category is likely `dog`. And in some - // cases there might be more than one categories e.g. `Terrier` could also be - // a `pet`. - repeated Entity category_entities = 2; - - // All video segments where a label was detected. - repeated LabelSegment segments = 3; - - // All video frames where a label was detected. - repeated LabelFrame frames = 4; -} - -// Video frame level annotation results for explicit content. -message ExplicitContentFrame { - // Time-offset, relative to the beginning of the video, corresponding to the - // video frame for this location. - google.protobuf.Duration time_offset = 1; - - // Likelihood of the pornography content.. - Likelihood pornography_likelihood = 2; -} - -// Explicit content annotation (based on per-frame visual signals only). -// If no explicit content has been detected in a frame, no annotations are -// present for that frame. -message ExplicitContentAnnotation { - // All video frames where explicit content was detected. - repeated ExplicitContentFrame frames = 1; -} - -// Normalized bounding box. -// The normalized vertex coordinates are relative to the original image. -// Range: [0, 1]. -message NormalizedBoundingBox { - // Left X coordinate. - float left = 1; - - // Top Y coordinate. - float top = 2; - - // Right X coordinate. - float right = 3; - - // Bottom Y coordinate. - float bottom = 4; -} - -// For tracking related features. -// An object at time_offset with attributes, and located with -// normalized_bounding_box. -message TimestampedObject { - // Normalized Bounding box in a frame, where the object is located. - NormalizedBoundingBox normalized_bounding_box = 1; - - // Time-offset, relative to the beginning of the video, - // corresponding to the video frame for this object. - google.protobuf.Duration time_offset = 2; - - // Optional. The attributes of the object in the bounding box. - repeated DetectedAttribute attributes = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A track of an object instance. -message Track { - // Video segment of a track. - VideoSegment segment = 1; - - // The object with timestamp and attributes per frame in the track. - repeated TimestampedObject timestamped_objects = 2; - - // Optional. Attributes in the track level. - repeated DetectedAttribute attributes = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The confidence score of the tracked object. - float confidence = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// A generic detected attribute represented by name in string format. -message DetectedAttribute { - // The name of the attribute, i.e. glasses, dark_glasses, mouth_open etc. - // A full list of supported type names will be provided in the document. - string name = 1; - - // Detected attribute confidence. Range [0, 1]. - float confidence = 2; - - // Text value of the detection result. For example, the value for "HairColor" - // can be "black", "blonde", etc. - string value = 3; -} - -// Celebrity definition. -message Celebrity { - // The resource name of the celebrity. Have the format - // `video-intelligence/kg-mid` indicates a celebrity from preloaded gallery. - // kg-mid is the id in Google knowledge graph, which is unique for the - // celebrity. - string name = 1; - - // The celebrity name. - string display_name = 2; - - // Textual description of additional information about the celebrity, if - // applicable. - string description = 3; -} - -// The annotation result of a celebrity face track. RecognizedCelebrity field -// could be empty if the face track does not have any matched celebrities. -message CelebrityTrack { - // The recognized celebrity with confidence score. - message RecognizedCelebrity { - // The recognized celebrity. - Celebrity celebrity = 1; - - // Recognition confidence. Range [0, 1]. - float confidence = 2; - } - - // Top N match of the celebrities for the face in this track. - repeated RecognizedCelebrity celebrities = 1; - - // A track of a person's face. - Track face_track = 3; -} - -// Celebrity recognition annotation per video. -message CelebrityRecognitionAnnotation { - // The tracks detected from the input video, including recognized celebrities - // and other detected faces in the video. - repeated CelebrityTrack celebrity_tracks = 1; -} - -// Annotation results for a single video. -message VideoAnnotationResults { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Video segment on which the annotation is run. - VideoSegment segment = 10; - - // Topical label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. - repeated LabelAnnotation segment_label_annotations = 2; - - // Presence label annotations on video level or user specified segment level. - // There is exactly one element for each unique label. Compared to the - // existing topical `segment_label_annotations`, this field presents more - // fine-grained, segment-level labels detected in video content and is made - // available only when the client sets `LabelDetectionConfig.model` to - // "builtin/latest" in the request. - repeated LabelAnnotation segment_presence_label_annotations = 23; - - // Topical label annotations on shot level. - // There is exactly one element for each unique label. - repeated LabelAnnotation shot_label_annotations = 3; - - // Presence label annotations on shot level. There is exactly one element for - // each unique label. Compared to the existing topical - // `shot_label_annotations`, this field presents more fine-grained, shot-level - // labels detected in video content and is made available only when the client - // sets `LabelDetectionConfig.model` to "builtin/latest" in the request. - repeated LabelAnnotation shot_presence_label_annotations = 24; - - // Label annotations on frame level. - // There is exactly one element for each unique label. - repeated LabelAnnotation frame_label_annotations = 4; - - // Shot annotations. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 6; - - // Explicit content annotation. - ExplicitContentAnnotation explicit_annotation = 7; - - // Speech transcription. - repeated SpeechTranscription speech_transcriptions = 11; - - // OCR text detection and tracking. - // Annotations for list of detected text snippets. Each will have list of - // frame information associated with it. - repeated TextAnnotation text_annotations = 12; - - // Annotations for list of objects detected and tracked in video. - repeated ObjectTrackingAnnotation object_annotations = 14; - - // Annotations for list of logos detected, tracked and recognized in video. - repeated LogoRecognitionAnnotation logo_recognition_annotations = 19; - - // Celebrity recognition annotations. - CelebrityRecognitionAnnotation celebrity_recognition_annotations = 21; - - // If set, indicates an error. Note that for a single `AnnotateVideoRequest` - // some videos may succeed and some may fail. - google.rpc.Status error = 9; -} - -// Video annotation response. Included in the `response` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoResponse { - // Annotation results for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationResults annotation_results = 1; -} - -// Annotation progress for a single video. -message VideoAnnotationProgress { - // Video file location in - // [Google Cloud Storage](https://cloud.google.com/storage/). - string input_uri = 1; - - // Approximate percentage processed thus far. Guaranteed to be - // 100 when fully processed. - int32 progress_percent = 2; - - // Time when the request was received. - google.protobuf.Timestamp start_time = 3; - - // Time of the most recent update. - google.protobuf.Timestamp update_time = 4; - - // Specifies which feature is being tracked if the request contains more than - // one features. - Feature feature = 5; - - // Specifies which segment is being tracked if the request contains more than - // one segments. - VideoSegment segment = 6; -} - -// Video annotation progress. Included in the `metadata` -// field of the `Operation` returned by the `GetOperation` -// call of the `google::longrunning::Operations` service. -message AnnotateVideoProgress { - // Progress metadata for all videos specified in `AnnotateVideoRequest`. - repeated VideoAnnotationProgress annotation_progress = 1; -} - -// Config for SPEECH_TRANSCRIPTION. -message SpeechTranscriptionConfig { - // Required. *Required* The language of the supplied audio as a - // [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) language tag. - // Example: "en-US". - // See [Language Support](https://cloud.google.com/speech/docs/languages) - // for a list of the currently supported language codes. - string language_code = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Maximum number of recognition hypotheses to be returned. - // Specifically, the maximum number of `SpeechRecognitionAlternative` messages - // within each `SpeechTranscription`. The server may return fewer than - // `max_alternatives`. Valid values are `0`-`30`. A value of `0` or `1` will - // return a maximum of one. If omitted, will return a maximum of one. - int32 max_alternatives = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to `true`, the server will attempt to filter out - // profanities, replacing all but the initial character in each filtered word - // with asterisks, e.g. "f***". If set to `false` or omitted, profanities - // won't be filtered out. - bool filter_profanity = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A means to provide context to assist the speech recognition. - repeated SpeechContext speech_contexts = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If 'true', adds punctuation to recognition result hypotheses. - // This feature is only available in select languages. Setting this for - // requests in other languages has no effect at all. The default 'false' value - // does not add punctuation to result hypotheses. NOTE: "This is currently - // offered as an experimental service, complimentary to all users. In the - // future this may be exclusively available as a premium feature." - bool enable_automatic_punctuation = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. For file formats, such as MXF or MKV, supporting multiple audio - // tracks, specify up to two tracks. Default: track 0. - repeated int32 audio_tracks = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If 'true', enables speaker detection for each recognized word in - // the top alternative of the recognition result using a speaker_tag provided - // in the WordInfo. - // Note: When this is true, we send all the words from the beginning of the - // audio for the top alternative in every consecutive responses. - // This is done in order to improve our speaker tags as our models learn to - // identify the speakers in the conversation over time. - bool enable_speaker_diarization = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set, specifies the estimated number of speakers in the - // conversation. If not set, defaults to '2'. Ignored unless - // enable_speaker_diarization is set to true. - int32 diarization_speaker_count = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If `true`, the top result includes a list of words and the - // confidence for those words. If `false`, no word-level confidence - // information is returned. The default is `false`. - bool enable_word_confidence = 9 [(google.api.field_behavior) = OPTIONAL]; -} - -// Provides "hints" to the speech recognizer to favor specific words and phrases -// in the results. -message SpeechContext { - // Optional. A list of strings containing words and phrases "hints" so that - // the speech recognition is more likely to recognize them. This can be used - // to improve the accuracy for specific words and phrases, for example, if - // specific commands are typically spoken by the user. This can also be used - // to add additional words to the vocabulary of the recognizer. See - // [usage limits](https://cloud.google.com/speech/limits#content). - repeated string phrases = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// A speech recognition result corresponding to a portion of the audio. -message SpeechTranscription { - // May contain one or more recognition hypotheses (up to the maximum specified - // in `max_alternatives`). These alternatives are ordered in terms of - // accuracy, with the top (first) alternative being the most probable, as - // ranked by the recognizer. - repeated SpeechRecognitionAlternative alternatives = 1; - - // Output only. The [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) - // language tag of the language in this result. This language code was - // detected to have the most likelihood of being spoken in the audio. - string language_code = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Alternative hypotheses (a.k.a. n-best list). -message SpeechRecognitionAlternative { - // Transcript text representing the words that the user spoke. - string transcript = 1; - - // Output only. The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A list of word-specific information for each recognized word. - // Note: When `enable_speaker_diarization` is true, you will see all the words - // from the beginning of the audio. - repeated WordInfo words = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Word-specific information for recognized words. Word information is only -// included in the response when certain request parameters are set, such -// as `enable_word_time_offsets`. -message WordInfo { - // Time offset relative to the beginning of the audio, and - // corresponding to the start of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration start_time = 1; - - // Time offset relative to the beginning of the audio, and - // corresponding to the end of the spoken word. This field is only set if - // `enable_word_time_offsets=true` and only in the top hypothesis. This is an - // experimental feature and the accuracy of the time offset can vary. - google.protobuf.Duration end_time = 2; - - // The word corresponding to this set of information. - string word = 3; - - // Output only. The confidence estimate between 0.0 and 1.0. A higher number - // indicates an estimated greater likelihood that the recognized words are - // correct. This field is set only for the top alternative. - // This field is not guaranteed to be accurate and users should not rely on it - // to be always provided. - // The default of 0.0 is a sentinel value indicating `confidence` was not set. - float confidence = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. A distinct integer value is assigned for every speaker within - // the audio. This field specifies which one of those speakers was detected to - // have spoken this word. Value ranges from 1 up to diarization_speaker_count, - // and is only set if speaker diarization is enabled. - int32 speaker_tag = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// Normalized bounding polygon for text (that might not be aligned with axis). -// Contains list of the corner points in clockwise order starting from -// top-left corner. For example, for a rectangular bounding box: -// When the text is horizontal it might look like: -// 0----1 -// | | -// 3----2 -// -// When it's clockwise rotated 180 degrees around the top-left corner it -// becomes: -// 2----3 -// | | -// 1----0 -// -// and the vertex order will still be (0, 1, 2, 3). Note that values can be less -// than 0, or greater than 1 due to trignometric calculations for location of -// the box. -message NormalizedBoundingPoly { - // Normalized vertices of the bounding polygon. - repeated NormalizedVertex vertices = 1; -} - -// Video segment level annotation results for text detection. -message TextSegment { - // Video segment where a text snippet was detected. - VideoSegment segment = 1; - - // Confidence for the track of detected text. It is calculated as the highest - // over all frames where OCR detected text appears. - float confidence = 2; - - // Information related to the frames where OCR detected text appears. - repeated TextFrame frames = 3; -} - -// Video frame level annotation results for text annotation (OCR). -// Contains information regarding timestamp and bounding box locations for the -// frames containing detected OCR text snippets. -message TextFrame { - // Bounding polygon of the detected text for this frame. - NormalizedBoundingPoly rotated_bounding_box = 1; - - // Timestamp of this frame. - google.protobuf.Duration time_offset = 2; -} - -// Annotations related to one detected OCR text snippet. This will contain the -// corresponding text, confidence value, and frame level information for each -// detection. -message TextAnnotation { - // The detected text. - string text = 1; - - // All video segments where OCR detected text appears. - repeated TextSegment segments = 2; -} - -// Video frame level annotations for object detection and tracking. This field -// stores per frame location, time offset, and confidence. -message ObjectTrackingFrame { - // The normalized bounding box location of this object track for the frame. - NormalizedBoundingBox normalized_bounding_box = 1; - - // The timestamp of the frame in microseconds. - google.protobuf.Duration time_offset = 2; -} - -// Annotations corresponding to one tracked object. -message ObjectTrackingAnnotation { - // Entity to specify the object category that this track is labeled as. - Entity entity = 1; - - // Object category's labeling confidence of this track. - float confidence = 4; - - // Information corresponding to all frames where this object track appears. - // Non-streaming batch mode: it may be one or multiple ObjectTrackingFrame - // messages in frames. - // Streaming mode: it can only be one ObjectTrackingFrame message in frames. - repeated ObjectTrackingFrame frames = 2; - - // Different representation of tracking info in non-streaming batch - // and streaming modes. - oneof track_info { - // Non-streaming batch mode ONLY. - // Each object track corresponds to one video segment where it appears. - VideoSegment segment = 3; - - // Streaming mode ONLY. - // In streaming mode, we do not know the end time of a tracked object - // before it is completed. Hence, there is no VideoSegment info returned. - // Instead, we provide a unique identifiable integer track_id so that - // the customers can correlate the results of the ongoing - // ObjectTrackAnnotation of the same track_id over time. - int64 track_id = 5; - } -} - -// Annotation corresponding to one detected, tracked and recognized logo class. -message LogoRecognitionAnnotation { - // Entity category information to specify the logo class that all the logo - // tracks within this LogoRecognitionAnnotation are recognized as. - Entity entity = 1; - - // All logo tracks where the recognized logo appears. Each track corresponds - // to one logo instance appearing in consecutive frames. - repeated Track tracks = 2; - - // All video segments where the recognized logo appears. There might be - // multiple instances of the same logo class appearing in one VideoSegment. - repeated VideoSegment segments = 3; -} - -// The top-level message sent by the client for the `StreamingAnnotateVideo` -// method. Multiple `StreamingAnnotateVideoRequest` messages are sent. -// The first message must only contain a `StreamingVideoConfig` message. -// All subsequent messages must only contain `input_content` data. -message StreamingAnnotateVideoRequest { - // *Required* The streaming request, which is either a streaming config or - // video content. - oneof streaming_request { - // Provides information to the annotator, specifing how to process the - // request. The first `AnnotateStreamingVideoRequest` message must only - // contain a `video_config` message. - StreamingVideoConfig video_config = 1; - - // The video data to be annotated. Chunks of video data are sequentially - // sent in `StreamingAnnotateVideoRequest` messages. Except the initial - // `StreamingAnnotateVideoRequest` message containing only - // `video_config`, all subsequent `AnnotateStreamingVideoRequest` - // messages must only contain `input_content` field. - // Note: as with all bytes fields, protobuffers use a pure binary - // representation (not base64). - bytes input_content = 2; - } -} - -// `StreamingAnnotateVideoResponse` is the only message returned to the client -// by `StreamingAnnotateVideo`. A series of zero or more -// `StreamingAnnotateVideoResponse` messages are streamed back to the client. -message StreamingAnnotateVideoResponse { - // If set, returns a [google.rpc.Status][google.rpc.Status] message that - // specifies the error for the operation. - google.rpc.Status error = 1; - - // Streaming annotation results. - StreamingVideoAnnotationResults annotation_results = 2; - - // GCS URI that stores annotation results of one streaming session. - // It is a directory that can hold multiple files in JSON format. - // Example uri format: - // gs://bucket_id/object_id/cloud_project_name-session_id - string annotation_results_uri = 3; -} - -// Config for STREAMING_AUTOML_CLASSIFICATION. -message StreamingAutomlClassificationConfig { - // Resource name of AutoML model. - // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` - string model_name = 1; -} - -// Config for STREAMING_AUTOML_OBJECT_TRACKING. -message StreamingAutomlObjectTrackingConfig { - // Resource name of AutoML model. - // Format: `projects/{project_id}/locations/{location_id}/models/{model_id}` - string model_name = 1; -} - -// Config for STREAMING_EXPLICIT_CONTENT_DETECTION. -message StreamingExplicitContentDetectionConfig {} - -// Config for STREAMING_LABEL_DETECTION. -message StreamingLabelDetectionConfig { - // Whether the video has been captured from a stationary (i.e. non-moving) - // camera. When set to true, might improve detection accuracy for moving - // objects. Default: false. - bool stationary_camera = 1; -} - -// Config for STREAMING_OBJECT_TRACKING. -message StreamingObjectTrackingConfig {} - -// Config for STREAMING_SHOT_CHANGE_DETECTION. -message StreamingShotChangeDetectionConfig {} - -// Config for streaming storage option. -message StreamingStorageConfig { - // Enable streaming storage. Default: false. - bool enable_storage_annotation_result = 1; - - // GCS URI to store all annotation results for one client. Client should - // specify this field as the top-level storage directory. Annotation results - // of different sessions will be put into different sub-directories denoted - // by project_name and session_id. All sub-directories will be auto generated - // by program and will be made accessible to client in response proto. - // URIs must be specified in the following format: `gs://bucket-id/object-id` - // `bucket-id` should be a valid GCS bucket created by client and bucket - // permission shall also be configured properly. `object-id` can be arbitrary - // string that make sense to client. Other URI formats will return error and - // cause GCS write failure. - string annotation_result_storage_directory = 3; -} - -// Streaming annotation results corresponding to a portion of the video -// that is currently being processed. -message StreamingVideoAnnotationResults { - // Shot annotation results. Each shot is represented as a video segment. - repeated VideoSegment shot_annotations = 1; - - // Label annotation results. - repeated LabelAnnotation label_annotations = 2; - - // Explicit content annotation results. - ExplicitContentAnnotation explicit_annotation = 3; - - // Object tracking results. - repeated ObjectTrackingAnnotation object_annotations = 4; -} - -// Provides information to the annotator that specifies how to process the -// request. -message StreamingVideoConfig { - // Requested annotation feature. - StreamingFeature feature = 1; - - // Config for requested annotation feature. - oneof streaming_config { - // Config for STREAMING_SHOT_CHANGE_DETECTION. - StreamingShotChangeDetectionConfig shot_change_detection_config = 2; - - // Config for STREAMING_LABEL_DETECTION. - StreamingLabelDetectionConfig label_detection_config = 3; - - // Config for STREAMING_EXPLICIT_CONTENT_DETECTION. - StreamingExplicitContentDetectionConfig explicit_content_detection_config = - 4; - - // Config for STREAMING_OBJECT_TRACKING. - StreamingObjectTrackingConfig object_tracking_config = 5; - - // Config for STREAMING_AUTOML_CLASSIFICATION. - StreamingAutomlClassificationConfig automl_classification_config = 21; - - // Config for STREAMING_AUTOML_OBJECT_TRACKING. - StreamingAutomlObjectTrackingConfig automl_object_tracking_config = 22; - } - - // Streaming storage option. By default: storage is disabled. - StreamingStorageConfig storage_config = 30; -} - -// Video annotation feature. -enum Feature { - // Unspecified. - FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - LABEL_DETECTION = 1; - - // Shot change detection. - SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - EXPLICIT_CONTENT_DETECTION = 3; - - // Speech transcription. - SPEECH_TRANSCRIPTION = 6; - - // OCR text detection and tracking. - TEXT_DETECTION = 7; - - // Object detection and tracking. - OBJECT_TRACKING = 9; - - // Logo detection, tracking, and recognition. - LOGO_RECOGNITION = 12; - - // Celebrity recognition. - CELEBRITY_RECOGNITION = 13; -} - -// Label detection mode. -enum LabelDetectionMode { - // Unspecified. - LABEL_DETECTION_MODE_UNSPECIFIED = 0; - - // Detect shot-level labels. - SHOT_MODE = 1; - - // Detect frame-level labels. - FRAME_MODE = 2; - - // Detect both shot-level and frame-level labels. - SHOT_AND_FRAME_MODE = 3; -} - -// Bucketized representation of likelihood. -enum Likelihood { - // Unspecified likelihood. - LIKELIHOOD_UNSPECIFIED = 0; - - // Very unlikely. - VERY_UNLIKELY = 1; - - // Unlikely. - UNLIKELY = 2; - - // Possible. - POSSIBLE = 3; - - // Likely. - LIKELY = 4; - - // Very likely. - VERY_LIKELY = 5; -} - -// Streaming video annotation feature. -enum StreamingFeature { - // Unspecified. - STREAMING_FEATURE_UNSPECIFIED = 0; - - // Label detection. Detect objects, such as dog or flower. - STREAMING_LABEL_DETECTION = 1; - - // Shot change detection. - STREAMING_SHOT_CHANGE_DETECTION = 2; - - // Explicit content detection. - STREAMING_EXPLICIT_CONTENT_DETECTION = 3; - - // Object detection and tracking. - STREAMING_OBJECT_TRACKING = 4; - - // Video classification based on AutoML model. - STREAMING_AUTOML_CLASSIFICATION = 21; - - // Object detection and tracking based on AutoML model. - STREAMING_AUTOML_OBJECT_TRACKING = 22; -} diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2.py deleted file mode 100644 index fd02c615e624..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2.py +++ /dev/null @@ -1,5760 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import duration_pb2 as google_dot_protobuf_dot_duration__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto", - package="google.cloud.videointelligence.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n,com.google.cloud.videointelligence.v1p3beta1B\035VideoIntelligenceServiceProtoP\001ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence\252\002(Google.Cloud.VideoIntelligence.V1P3Beta1\312\002(Google\\Cloud\\VideoIntelligence\\V1p3beta1" - ), - serialized_pb=_b( - '\nGgoogle/cloud/videointelligence_v1p3beta1/proto/video_intelligence.proto\x12(google.cloud.videointelligence.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a#google/longrunning/operations.proto\x1a\x1egoogle/protobuf/duration.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\x8c\x02\n\x14\x41nnotateVideoRequest\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x15\n\rinput_content\x18\x06 \x01(\x0c\x12H\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32\x31.google.cloud.videointelligence.v1p3beta1.FeatureB\x03\xe0\x41\x02\x12M\n\rvideo_context\x18\x03 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoContext\x12\x17\n\noutput_uri\x18\x04 \x01(\tB\x03\xe0\x41\x01\x12\x18\n\x0blocation_id\x18\x05 \x01(\tB\x03\xe0\x41\x01"\xc0\x05\n\x0cVideoContext\x12H\n\x08segments\x18\x01 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12^\n\x16label_detection_config\x18\x02 \x01(\x0b\x32>.google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig\x12i\n\x1cshot_change_detection_config\x18\x03 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig\x12s\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32H.google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig\x12h\n\x1bspeech_transcription_config\x18\x06 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig\x12\\\n\x15text_detection_config\x18\x08 \x01(\x0b\x32=.google.cloud.videointelligence.v1p3beta1.TextDetectionConfig\x12^\n\x16object_tracking_config\x18\r \x01(\x0b\x32>.google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig"\xe4\x01\n\x14LabelDetectionConfig\x12Z\n\x14label_detection_mode\x18\x01 \x01(\x0e\x32<.google.cloud.videointelligence.v1p3beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x02 \x01(\x08\x12\r\n\x05model\x18\x03 \x01(\t\x12"\n\x1a\x66rame_confidence_threshold\x18\x04 \x01(\x02\x12"\n\x1avideo_confidence_threshold\x18\x05 \x01(\x02"*\n\x19ShotChangeDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"%\n\x14ObjectTrackingConfig\x12\r\n\x05model\x18\x01 \x01(\t"/\n\x1e\x45xplicitContentDetectionConfig\x12\r\n\x05model\x18\x01 \x01(\t"<\n\x13TextDetectionConfig\x12\x16\n\x0elanguage_hints\x18\x01 \x03(\t\x12\r\n\x05model\x18\x02 \x01(\t"x\n\x0cVideoSegment\x12\x34\n\x11start_time_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x32\n\x0f\x65nd_time_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"k\n\x0cLabelSegment\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02"P\n\nLabelFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x12\n\nconfidence\x18\x02 \x01(\x02"G\n\x06\x45ntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x02 \x01(\t\x12\x15\n\rlanguage_code\x18\x03 \x01(\t"\xb0\x02\n\x0fLabelAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p3beta1.Entity\x12K\n\x11\x63\x61tegory_entities\x18\x02 \x03(\x0b\x32\x30.google.cloud.videointelligence.v1p3beta1.Entity\x12H\n\x08segments\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.LabelSegment\x12\x44\n\x06\x66rames\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1p3beta1.LabelFrame"\x9c\x01\n\x14\x45xplicitContentFrame\x12.\n\x0btime_offset\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12T\n\x16pornography_likelihood\x18\x02 \x01(\x0e\x32\x34.google.cloud.videointelligence.v1p3beta1.Likelihood"k\n\x19\x45xplicitContentAnnotation\x12N\n\x06\x66rames\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame"Q\n\x15NormalizedBoundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x02\x12\x0b\n\x03top\x18\x02 \x01(\x02\x12\r\n\x05right\x18\x03 \x01(\x02\x12\x0e\n\x06\x62ottom\x18\x04 \x01(\x02"\xfb\x01\n\x11TimestampedObject\x12`\n\x17normalized_bounding_box\x18\x01 \x01(\x0b\x32?.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12T\n\nattributes\x18\x03 \x03(\x0b\x32;.google.cloud.videointelligence.v1p3beta1.DetectedAttributeB\x03\xe0\x41\x01"\x99\x02\n\x05Track\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12X\n\x13timestamped_objects\x18\x02 \x03(\x0b\x32;.google.cloud.videointelligence.v1p3beta1.TimestampedObject\x12T\n\nattributes\x18\x03 \x03(\x0b\x32;.google.cloud.videointelligence.v1p3beta1.DetectedAttributeB\x03\xe0\x41\x01\x12\x17\n\nconfidence\x18\x04 \x01(\x02\x42\x03\xe0\x41\x01"D\n\x11\x44\x65tectedAttribute\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\r\n\x05value\x18\x03 \x01(\t"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t"\xab\x02\n\x0e\x43\x65lebrityTrack\x12\x61\n\x0b\x63\x65lebrities\x18\x01 \x03(\x0b\x32L.google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity\x12\x43\n\nface_track\x18\x03 \x01(\x0b\x32/.google.cloud.videointelligence.v1p3beta1.Track\x1aq\n\x13RecognizedCelebrity\x12\x46\n\tcelebrity\x18\x01 \x01(\x0b\x32\x33.google.cloud.videointelligence.v1p3beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02"t\n\x1e\x43\x65lebrityRecognitionAnnotation\x12R\n\x10\x63\x65lebrity_tracks\x18\x01 \x03(\x0b\x32\x38.google.cloud.videointelligence.v1p3beta1.CelebrityTrack"\x9d\n\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12G\n\x07segment\x18\n \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12\\\n\x19segment_label_annotations\x18\x02 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12\x65\n"segment_presence_label_annotations\x18\x17 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12Y\n\x16shot_label_annotations\x18\x03 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12\x62\n\x1fshot_presence_label_annotations\x18\x18 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12Z\n\x17\x66rame_label_annotations\x18\x04 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12P\n\x10shot_annotations\x18\x06 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12`\n\x13\x65xplicit_annotation\x18\x07 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation\x12\\\n\x15speech_transcriptions\x18\x0b \x03(\x0b\x32=.google.cloud.videointelligence.v1p3beta1.SpeechTranscription\x12R\n\x10text_annotations\x18\x0c \x03(\x0b\x32\x38.google.cloud.videointelligence.v1p3beta1.TextAnnotation\x12^\n\x12object_annotations\x18\x0e \x03(\x0b\x32\x42.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation\x12i\n\x1clogo_recognition_annotations\x18\x13 \x03(\x0b\x32\x43.google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation\x12s\n!celebrity_recognition_annotations\x18\x15 \x01(\x0b\x32H.google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"u\n\x15\x41nnotateVideoResponse\x12\\\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32@.google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults"\xb4\x02\n\x17VideoAnnotationProgress\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12\x18\n\x10progress_percent\x18\x02 \x01(\x05\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x42\n\x07\x66\x65\x61ture\x18\x05 \x01(\x0e\x32\x31.google.cloud.videointelligence.v1p3beta1.Feature\x12G\n\x07segment\x18\x06 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment"w\n\x15\x41nnotateVideoProgress\x12^\n\x13\x61nnotation_progress\x18\x01 \x03(\x0b\x32\x41.google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress"\x88\x03\n\x19SpeechTranscriptionConfig\x12\x1a\n\rlanguage_code\x18\x01 \x01(\tB\x03\xe0\x41\x02\x12\x1d\n\x10max_alternatives\x18\x02 \x01(\x05\x42\x03\xe0\x41\x01\x12\x1d\n\x10\x66ilter_profanity\x18\x03 \x01(\x08\x42\x03\xe0\x41\x01\x12U\n\x0fspeech_contexts\x18\x04 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1p3beta1.SpeechContextB\x03\xe0\x41\x01\x12)\n\x1c\x65nable_automatic_punctuation\x18\x05 \x01(\x08\x42\x03\xe0\x41\x01\x12\x19\n\x0c\x61udio_tracks\x18\x06 \x03(\x05\x42\x03\xe0\x41\x01\x12\'\n\x1a\x65nable_speaker_diarization\x18\x07 \x01(\x08\x42\x03\xe0\x41\x01\x12&\n\x19\x64iarization_speaker_count\x18\x08 \x01(\x05\x42\x03\xe0\x41\x01\x12#\n\x16\x65nable_word_confidence\x18\t \x01(\x08\x42\x03\xe0\x41\x01"%\n\rSpeechContext\x12\x14\n\x07phrases\x18\x01 \x03(\tB\x03\xe0\x41\x01"\x8f\x01\n\x13SpeechTranscription\x12\\\n\x0c\x61lternatives\x18\x01 \x03(\x0b\x32\x46.google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative\x12\x1a\n\rlanguage_code\x18\x02 \x01(\tB\x03\xe0\x41\x03"\x93\x01\n\x1cSpeechRecognitionAlternative\x12\x12\n\ntranscript\x18\x01 \x01(\t\x12\x17\n\nconfidence\x18\x02 \x01(\x02\x42\x03\xe0\x41\x03\x12\x46\n\x05words\x18\x03 \x03(\x0b\x32\x32.google.cloud.videointelligence.v1p3beta1.WordInfoB\x03\xe0\x41\x03"\xa7\x01\n\x08WordInfo\x12-\n\nstart_time\x18\x01 \x01(\x0b\x32\x19.google.protobuf.Duration\x12+\n\x08\x65nd_time\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration\x12\x0c\n\x04word\x18\x03 \x01(\t\x12\x17\n\nconfidence\x18\x04 \x01(\x02\x42\x03\xe0\x41\x03\x12\x18\n\x0bspeaker_tag\x18\x05 \x01(\x05\x42\x03\xe0\x41\x03"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"f\n\x16NormalizedBoundingPoly\x12L\n\x08vertices\x18\x01 \x03(\x0b\x32:.google.cloud.videointelligence.v1p3beta1.NormalizedVertex"\xaf\x01\n\x0bTextSegment\x12G\n\x07segment\x18\x01 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x43\n\x06\x66rames\x18\x03 \x03(\x0b\x32\x33.google.cloud.videointelligence.v1p3beta1.TextFrame"\x9b\x01\n\tTextFrame\x12^\n\x14rotated_bounding_box\x18\x01 \x01(\x0b\x32@.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"g\n\x0eTextAnnotation\x12\x0c\n\x04text\x18\x01 \x01(\t\x12G\n\x08segments\x18\x02 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1p3beta1.TextSegment"\xa7\x01\n\x13ObjectTrackingFrame\x12`\n\x17normalized_bounding_box\x18\x01 \x01(\x0b\x32?.google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox\x12.\n\x0btime_offset\x18\x02 \x01(\x0b\x32\x19.google.protobuf.Duration"\xac\x02\n\x18ObjectTrackingAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p3beta1.Entity\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x12M\n\x06\x66rames\x18\x02 \x03(\x0b\x32=.google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame\x12I\n\x07segment\x18\x03 \x01(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegmentH\x00\x12\x12\n\x08track_id\x18\x05 \x01(\x03H\x00\x42\x0c\n\ntrack_info"\xe8\x01\n\x19LogoRecognitionAnnotation\x12@\n\x06\x65ntity\x18\x01 \x01(\x0b\x32\x30.google.cloud.videointelligence.v1p3beta1.Entity\x12?\n\x06tracks\x18\x02 \x03(\x0b\x32/.google.cloud.videointelligence.v1p3beta1.Track\x12H\n\x08segments\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment"\xa5\x01\n\x1dStreamingAnnotateVideoRequest\x12V\n\x0cvideo_config\x18\x01 \x01(\x0b\x32>.google.cloud.videointelligence.v1p3beta1.StreamingVideoConfigH\x00\x12\x17\n\rinput_content\x18\x02 \x01(\x0cH\x00\x42\x13\n\x11streaming_request"\xca\x01\n\x1eStreamingAnnotateVideoResponse\x12!\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x12.google.rpc.Status\x12\x65\n\x12\x61nnotation_results\x18\x02 \x01(\x0b\x32I.google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults\x12\x1e\n\x16\x61nnotation_results_uri\x18\x03 \x01(\t"9\n#StreamingAutomlClassificationConfig\x12\x12\n\nmodel_name\x18\x01 \x01(\t"9\n#StreamingAutomlObjectTrackingConfig\x12\x12\n\nmodel_name\x18\x01 \x01(\t")\n\'StreamingExplicitContentDetectionConfig":\n\x1dStreamingLabelDetectionConfig\x12\x19\n\x11stationary_camera\x18\x01 \x01(\x08"\x1f\n\x1dStreamingObjectTrackingConfig"$\n"StreamingShotChangeDetectionConfig"o\n\x16StreamingStorageConfig\x12(\n enable_storage_annotation_result\x18\x01 \x01(\x08\x12+\n#annotation_result_storage_directory\x18\x03 \x01(\t"\x8b\x03\n\x1fStreamingVideoAnnotationResults\x12P\n\x10shot_annotations\x18\x01 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1p3beta1.VideoSegment\x12T\n\x11label_annotations\x18\x02 \x03(\x0b\x32\x39.google.cloud.videointelligence.v1p3beta1.LabelAnnotation\x12`\n\x13\x65xplicit_annotation\x18\x03 \x01(\x0b\x32\x43.google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation\x12^\n\x12object_annotations\x18\x04 \x03(\x0b\x32\x42.google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation"\x8c\x07\n\x14StreamingVideoConfig\x12K\n\x07\x66\x65\x61ture\x18\x01 \x01(\x0e\x32:.google.cloud.videointelligence.v1p3beta1.StreamingFeature\x12t\n\x1cshot_change_detection_config\x18\x02 \x01(\x0b\x32L.google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfigH\x00\x12i\n\x16label_detection_config\x18\x03 \x01(\x0b\x32G.google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfigH\x00\x12~\n!explicit_content_detection_config\x18\x04 \x01(\x0b\x32Q.google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfigH\x00\x12i\n\x16object_tracking_config\x18\x05 \x01(\x0b\x32G.google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfigH\x00\x12u\n\x1c\x61utoml_classification_config\x18\x15 \x01(\x0b\x32M.google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfigH\x00\x12v\n\x1d\x61utoml_object_tracking_config\x18\x16 \x01(\x0b\x32M.google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfigH\x00\x12X\n\x0estorage_config\x18\x1e \x01(\x0b\x32@.google.cloud.videointelligence.v1p3beta1.StreamingStorageConfigB\x12\n\x10streaming_config*\xe6\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x02\x12\x1e\n\x1a\x45XPLICIT_CONTENT_DETECTION\x10\x03\x12\x18\n\x14SPEECH_TRANSCRIPTION\x10\x06\x12\x12\n\x0eTEXT_DETECTION\x10\x07\x12\x13\n\x0fOBJECT_TRACKING\x10\t\x12\x14\n\x10LOGO_RECOGNITION\x10\x0c\x12\x19\n\x15\x43\x45LEBRITY_RECOGNITION\x10\r*r\n\x12LabelDetectionMode\x12$\n LABEL_DETECTION_MODE_UNSPECIFIED\x10\x00\x12\r\n\tSHOT_MODE\x10\x01\x12\x0e\n\nFRAME_MODE\x10\x02\x12\x17\n\x13SHOT_AND_FRAME_MODE\x10\x03*t\n\nLikelihood\x12\x1a\n\x16LIKELIHOOD_UNSPECIFIED\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05*\x8d\x02\n\x10StreamingFeature\x12!\n\x1dSTREAMING_FEATURE_UNSPECIFIED\x10\x00\x12\x1d\n\x19STREAMING_LABEL_DETECTION\x10\x01\x12#\n\x1fSTREAMING_SHOT_CHANGE_DETECTION\x10\x02\x12(\n$STREAMING_EXPLICIT_CONTENT_DETECTION\x10\x03\x12\x1d\n\x19STREAMING_OBJECT_TRACKING\x10\x04\x12#\n\x1fSTREAMING_AUTOML_CLASSIFICATION\x10\x15\x12$\n STREAMING_AUTOML_OBJECT_TRACKING\x10\x16\x32\xce\x02\n\x18VideoIntelligenceService\x12\xdb\x01\n\rAnnotateVideo\x12>.google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation"k\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p3beta1/videos:annotate:\x01*\xda\x41\x12input_uri,features\xca\x41.\n\x15\x41nnotateVideoResponse\x12\x15\x41nnotateVideoProgress\x1aT\xca\x41 videointelligence.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platform2\xad\x02\n!StreamingVideoIntelligenceService\x12\xb1\x01\n\x16StreamingAnnotateVideo\x12G.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest\x1aH.google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse"\x00(\x01\x30\x01\x1aT\xca\x41 videointelligence.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformB\x80\x02\n,com.google.cloud.videointelligence.v1p3beta1B\x1dVideoIntelligenceServiceProtoP\x01ZYgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1p3beta1;videointelligence\xaa\x02(Google.Cloud.VideoIntelligence.V1P3Beta1\xca\x02(Google\\Cloud\\VideoIntelligence\\V1p3beta1b\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_duration__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - -_FEATURE = _descriptor.EnumDescriptor( - name="Feature", - full_name="google.cloud.videointelligence.v1p3beta1.Feature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SPEECH_TRANSCRIPTION", - index=4, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=5, number=7, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_TRACKING", - index=6, - number=9, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOGO_RECOGNITION", - index=7, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CELEBRITY_RECOGNITION", - index=8, - number=13, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=10023, - serialized_end=10253, -) -_sym_db.RegisterEnumDescriptor(_FEATURE) - -Feature = enum_type_wrapper.EnumTypeWrapper(_FEATURE) -_LABELDETECTIONMODE = _descriptor.EnumDescriptor( - name="LabelDetectionMode", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionMode", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION_MODE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOT_MODE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FRAME_MODE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SHOT_AND_FRAME_MODE", - index=3, - number=3, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=10255, - serialized_end=10369, -) -_sym_db.RegisterEnumDescriptor(_LABELDETECTIONMODE) - -LabelDetectionMode = enum_type_wrapper.EnumTypeWrapper(_LABELDETECTIONMODE) -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.videointelligence.v1p3beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="LIKELIHOOD_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=10371, - serialized_end=10487, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -_STREAMINGFEATURE = _descriptor.EnumDescriptor( - name="StreamingFeature", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingFeature", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STREAMING_FEATURE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_LABEL_DETECTION", - index=1, - number=1, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_SHOT_CHANGE_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_EXPLICIT_CONTENT_DETECTION", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_OBJECT_TRACKING", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_AUTOML_CLASSIFICATION", - index=5, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="STREAMING_AUTOML_OBJECT_TRACKING", - index=6, - number=22, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=10490, - serialized_end=10759, -) -_sym_db.RegisterEnumDescriptor(_STREAMINGFEATURE) - -StreamingFeature = enum_type_wrapper.EnumTypeWrapper(_STREAMINGFEATURE) -FEATURE_UNSPECIFIED = 0 -LABEL_DETECTION = 1 -SHOT_CHANGE_DETECTION = 2 -EXPLICIT_CONTENT_DETECTION = 3 -SPEECH_TRANSCRIPTION = 6 -TEXT_DETECTION = 7 -OBJECT_TRACKING = 9 -LOGO_RECOGNITION = 12 -CELEBRITY_RECOGNITION = 13 -LABEL_DETECTION_MODE_UNSPECIFIED = 0 -SHOT_MODE = 1 -FRAME_MODE = 2 -SHOT_AND_FRAME_MODE = 3 -LIKELIHOOD_UNSPECIFIED = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 -STREAMING_FEATURE_UNSPECIFIED = 0 -STREAMING_LABEL_DETECTION = 1 -STREAMING_SHOT_CHANGE_DETECTION = 2 -STREAMING_EXPLICIT_CONTENT_DETECTION = 3 -STREAMING_OBJECT_TRACKING = 4 -STREAMING_AUTOML_CLASSIFICATION = 21 -STREAMING_AUTOML_OBJECT_TRACKING = 22 - - -_ANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="AnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.input_content", - index=1, - number=6, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.features", - index=2, - number=2, - type=14, - cpp_type=8, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_context", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.video_context", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_uri", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.output_uri", - index=4, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="location_id", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest.location_id", - index=5, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=333, - serialized_end=601, -) - - -_VIDEOCONTEXT = _descriptor.Descriptor( - name="VideoContext", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.segments", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.label_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.shot_change_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcription_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.speech_transcription_config", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.text_detection_config", - index=5, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_config", - full_name="google.cloud.videointelligence.v1p3beta1.VideoContext.object_tracking_config", - index=6, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=604, - serialized_end=1308, -) - - -_LABELDETECTIONCONFIG = _descriptor.Descriptor( - name="LabelDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label_detection_mode", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.label_detection_mode", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.stationary_camera", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_confidence_threshold", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.frame_confidence_threshold", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="video_confidence_threshold", - full_name="google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig.video_confidence_threshold", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1311, - serialized_end=1539, -) - - -_SHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="ShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1541, - serialized_end=1583, -) - - -_OBJECTTRACKINGCONFIG = _descriptor.Descriptor( - name="ObjectTrackingConfig", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1585, - serialized_end=1622, -) - - -_EXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="ExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig.model", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1624, - serialized_end=1671, -) - - -_TEXTDETECTIONCONFIG = _descriptor.Descriptor( - name="TextDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.TextDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.language_hints", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.videointelligence.v1p3beta1.TextDetectionConfig.model", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1673, - serialized_end=1733, -) - - -_VIDEOSEGMENT = _descriptor.Descriptor( - name="VideoSegment", - full_name="google.cloud.videointelligence.v1p3beta1.VideoSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.VideoSegment.start_time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.VideoSegment.end_time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1735, - serialized_end=1855, -) - - -_LABELSEGMENT = _descriptor.Descriptor( - name="LabelSegment", - full_name="google.cloud.videointelligence.v1p3beta1.LabelSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.LabelSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.LabelSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1857, - serialized_end=1964, -) - - -_LABELFRAME = _descriptor.Descriptor( - name="LabelFrame", - full_name="google.cloud.videointelligence.v1p3beta1.LabelFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.LabelFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.LabelFrame.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1966, - serialized_end=2046, -) - - -_ENTITY = _descriptor.Descriptor( - name="Entity", - full_name="google.cloud.videointelligence.v1p3beta1.Entity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.videointelligence.v1p3beta1.Entity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1p3beta1.Entity.description", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p3beta1.Entity.language_code", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2048, - serialized_end=2119, -) - - -_LABELANNOTATION = _descriptor.Descriptor( - name="LabelAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.LabelAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p3beta1.LabelAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category_entities", - full_name="google.cloud.videointelligence.v1p3beta1.LabelAnnotation.category_entities", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p3beta1.LabelAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p3beta1.LabelAnnotation.frames", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2122, - serialized_end=2426, -) - - -_EXPLICITCONTENTFRAME = _descriptor.Descriptor( - name="ExplicitContentFrame", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.time_offset", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pornography_likelihood", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame.pornography_likelihood", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2429, - serialized_end=2585, -) - - -_EXPLICITCONTENTANNOTATION = _descriptor.Descriptor( - name="ExplicitContentAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation.frames", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2587, - serialized_end=2694, -) - - -_NORMALIZEDBOUNDINGBOX = _descriptor.Descriptor( - name="NormalizedBoundingBox", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="left", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.left", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="top", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.top", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="right", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.right", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bottom", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox.bottom", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2696, - serialized_end=2777, -) - - -_TIMESTAMPEDOBJECT = _descriptor.Descriptor( - name="TimestampedObject", - full_name="google.cloud.videointelligence.v1p3beta1.TimestampedObject", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_box", - full_name="google.cloud.videointelligence.v1p3beta1.TimestampedObject.normalized_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.TimestampedObject.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.cloud.videointelligence.v1p3beta1.TimestampedObject.attributes", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2780, - serialized_end=3031, -) - - -_TRACK = _descriptor.Descriptor( - name="Track", - full_name="google.cloud.videointelligence.v1p3beta1.Track", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.Track.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="timestamped_objects", - full_name="google.cloud.videointelligence.v1p3beta1.Track.timestamped_objects", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="attributes", - full_name="google.cloud.videointelligence.v1p3beta1.Track.attributes", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.Track.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3034, - serialized_end=3315, -) - - -_DETECTEDATTRIBUTE = _descriptor.Descriptor( - name="DetectedAttribute", - full_name="google.cloud.videointelligence.v1p3beta1.DetectedAttribute", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.videointelligence.v1p3beta1.DetectedAttribute.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.DetectedAttribute.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.videointelligence.v1p3beta1.DetectedAttribute.value", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3317, - serialized_end=3385, -) - - -_CELEBRITY = _descriptor.Descriptor( - name="Celebrity", - full_name="google.cloud.videointelligence.v1p3beta1.Celebrity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.videointelligence.v1p3beta1.Celebrity.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.videointelligence.v1p3beta1.Celebrity.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.videointelligence.v1p3beta1.Celebrity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3387, - serialized_end=3455, -) - - -_CELEBRITYTRACK_RECOGNIZEDCELEBRITY = _descriptor.Descriptor( - name="RecognizedCelebrity", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="celebrity", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.celebrity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3644, - serialized_end=3757, -) - -_CELEBRITYTRACK = _descriptor.Descriptor( - name="CelebrityTrack", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="celebrities", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack.celebrities", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_track", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityTrack.face_track", - index=1, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_CELEBRITYTRACK_RECOGNIZEDCELEBRITY], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3458, - serialized_end=3757, -) - - -_CELEBRITYRECOGNITIONANNOTATION = _descriptor.Descriptor( - name="CelebrityRecognitionAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="celebrity_tracks", - full_name="google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation.celebrity_tracks", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3759, - serialized_end=3875, -) - - -_VIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="VideoAnnotationResults", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segment", - index=1, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segment_label_annotations", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment_presence_label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.segment_presence_label_annotations", - index=3, - number=23, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shot_label_annotations", - index=4, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_presence_label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shot_presence_label_annotations", - index=5, - number=24, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frame_label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.frame_label_annotations", - index=6, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.shot_annotations", - index=7, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.explicit_annotation", - index=8, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_transcriptions", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.speech_transcriptions", - index=9, - number=11, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.text_annotations", - index=10, - number=12, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.object_annotations", - index=11, - number=14, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logo_recognition_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.logo_recognition_annotations", - index=12, - number=19, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="celebrity_recognition_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.celebrity_recognition_annotations", - index=13, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults.error", - index=14, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3878, - serialized_end=5187, -) - - -_ANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="AnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse.annotation_results", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5189, - serialized_end=5306, -) - - -_VIDEOANNOTATIONPROGRESS = _descriptor.Descriptor( - name="VideoAnnotationProgress", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_uri", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.input_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="progress_percent", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.progress_percent", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.start_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.update_time", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.feature", - index=4, - number=5, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress.segment", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5309, - serialized_end=5617, -) - - -_ANNOTATEVIDEOPROGRESS = _descriptor.Descriptor( - name="AnnotateVideoProgress", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="annotation_progress", - full_name="google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress.annotation_progress", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5619, - serialized_end=5738, -) - - -_SPEECHTRANSCRIPTIONCONFIG = _descriptor.Descriptor( - name="SpeechTranscriptionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_alternatives", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.max_alternatives", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter_profanity", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.filter_profanity", - index=2, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speech_contexts", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.speech_contexts", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_automatic_punctuation", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.enable_automatic_punctuation", - index=4, - number=5, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="audio_tracks", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.audio_tracks", - index=5, - number=6, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_speaker_diarization", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.enable_speaker_diarization", - index=6, - number=7, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="diarization_speaker_count", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.diarization_speaker_count", - index=7, - number=8, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="enable_word_confidence", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig.enable_word_confidence", - index=8, - number=9, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5741, - serialized_end=6133, -) - - -_SPEECHCONTEXT = _descriptor.Descriptor( - name="SpeechContext", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="phrases", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechContext.phrases", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6135, - serialized_end=6172, -) - - -_SPEECHTRANSCRIPTION = _descriptor.Descriptor( - name="SpeechTranscription", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscription", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="alternatives", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscription.alternatives", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechTranscription.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6175, - serialized_end=6318, -) - - -_SPEECHRECOGNITIONALTERNATIVE = _descriptor.Descriptor( - name="SpeechRecognitionAlternative", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="transcript", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.transcript", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6321, - serialized_end=6468, -) - - -_WORDINFO = _descriptor.Descriptor( - name="WordInfo", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="start_time", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo.start_time", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo.end_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="word", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo.word", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="speaker_tag", - full_name="google.cloud.videointelligence.v1p3beta1.WordInfo.speaker_tag", - index=4, - number=5, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6471, - serialized_end=6638, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6640, - serialized_end=6680, -) - - -_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( - name="NormalizedBoundingPoly", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6682, - serialized_end=6784, -) - - -_TEXTSEGMENT = _descriptor.Descriptor( - name="TextSegment", - full_name="google.cloud.videointelligence.v1p3beta1.TextSegment", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.TextSegment.segment", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.TextSegment.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p3beta1.TextSegment.frames", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6787, - serialized_end=6962, -) - - -_TEXTFRAME = _descriptor.Descriptor( - name="TextFrame", - full_name="google.cloud.videointelligence.v1p3beta1.TextFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="rotated_bounding_box", - full_name="google.cloud.videointelligence.v1p3beta1.TextFrame.rotated_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.TextFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6965, - serialized_end=7120, -) - - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.videointelligence.v1p3beta1.TextAnnotation.text", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p3beta1.TextAnnotation.segments", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7122, - serialized_end=7225, -) - - -_OBJECTTRACKINGFRAME = _descriptor.Descriptor( - name="ObjectTrackingFrame", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="normalized_bounding_box", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.normalized_bounding_box", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="time_offset", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame.time_offset", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7228, - serialized_end=7395, -) - - -_OBJECTTRACKINGANNOTATION = _descriptor.Descriptor( - name="ObjectTrackingAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.confidence", - index=1, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="frames", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.frames", - index=2, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segment", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.segment", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="track_id", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.track_id", - index=4, - number=5, - type=3, - cpp_type=2, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="track_info", - full_name="google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation.track_info", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=7398, - serialized_end=7698, -) - - -_LOGORECOGNITIONANNOTATION = _descriptor.Descriptor( - name="LogoRecognitionAnnotation", - full_name="google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity", - full_name="google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.entity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tracks", - full_name="google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.tracks", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="segments", - full_name="google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation.segments", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7701, - serialized_end=7933, -) - - -_STREAMINGANNOTATEVIDEOREQUEST = _descriptor.Descriptor( - name="StreamingAnnotateVideoRequest", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="video_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.video_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_content", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.input_content", - index=1, - number=2, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="streaming_request", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest.streaming_request", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=7936, - serialized_end=8101, -) - - -_STREAMINGANNOTATEVIDEORESPONSE = _descriptor.Descriptor( - name="StreamingAnnotateVideoResponse", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.error", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_results", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.annotation_results", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_results_uri", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse.annotation_results_uri", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8104, - serialized_end=8306, -) - - -_STREAMINGAUTOMLCLASSIFICATIONCONFIG = _descriptor.Descriptor( - name="StreamingAutomlClassificationConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model_name", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig.model_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8308, - serialized_end=8365, -) - - -_STREAMINGAUTOMLOBJECTTRACKINGCONFIG = _descriptor.Descriptor( - name="StreamingAutomlObjectTrackingConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="model_name", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig.model_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8367, - serialized_end=8424, -) - - -_STREAMINGEXPLICITCONTENTDETECTIONCONFIG = _descriptor.Descriptor( - name="StreamingExplicitContentDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8426, - serialized_end=8467, -) - - -_STREAMINGLABELDETECTIONCONFIG = _descriptor.Descriptor( - name="StreamingLabelDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="stationary_camera", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig.stationary_camera", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8469, - serialized_end=8527, -) - - -_STREAMINGOBJECTTRACKINGCONFIG = _descriptor.Descriptor( - name="StreamingObjectTrackingConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8529, - serialized_end=8560, -) - - -_STREAMINGSHOTCHANGEDETECTIONCONFIG = _descriptor.Descriptor( - name="StreamingShotChangeDetectionConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8562, - serialized_end=8598, -) - - -_STREAMINGSTORAGECONFIG = _descriptor.Descriptor( - name="StreamingStorageConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="enable_storage_annotation_result", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.enable_storage_annotation_result", - index=0, - number=1, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="annotation_result_storage_directory", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig.annotation_result_storage_directory", - index=1, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8600, - serialized_end=8711, -) - - -_STREAMINGVIDEOANNOTATIONRESULTS = _descriptor.Descriptor( - name="StreamingVideoAnnotationResults", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="shot_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.shot_annotations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.label_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_annotation", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.explicit_annotation", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_annotations", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults.object_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8714, - serialized_end=9109, -) - - -_STREAMINGVIDEOCONFIG = _descriptor.Descriptor( - name="StreamingVideoConfig", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="feature", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.feature", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="shot_change_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.shot_change_detection_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.label_detection_config", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="explicit_content_detection_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.explicit_content_detection_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_tracking_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.object_tracking_config", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="automl_classification_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.automl_classification_config", - index=5, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="automl_object_tracking_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.automl_object_tracking_config", - index=6, - number=22, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="storage_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.storage_config", - index=7, - number=30, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="streaming_config", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig.streaming_config", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=9112, - serialized_end=10020, -) - -_ANNOTATEVIDEOREQUEST.fields_by_name["features"].enum_type = _FEATURE -_ANNOTATEVIDEOREQUEST.fields_by_name["video_context"].message_type = _VIDEOCONTEXT -_VIDEOCONTEXT.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_VIDEOCONTEXT.fields_by_name[ - "label_detection_config" -].message_type = _LABELDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "shot_change_detection_config" -].message_type = _SHOTCHANGEDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "explicit_content_detection_config" -].message_type = _EXPLICITCONTENTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "speech_transcription_config" -].message_type = _SPEECHTRANSCRIPTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "text_detection_config" -].message_type = _TEXTDETECTIONCONFIG -_VIDEOCONTEXT.fields_by_name[ - "object_tracking_config" -].message_type = _OBJECTTRACKINGCONFIG -_LABELDETECTIONCONFIG.fields_by_name[ - "label_detection_mode" -].enum_type = _LABELDETECTIONMODE -_VIDEOSEGMENT.fields_by_name[ - "start_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_VIDEOSEGMENT.fields_by_name[ - "end_time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_LABELFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_LABELANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["category_entities"].message_type = _ENTITY -_LABELANNOTATION.fields_by_name["segments"].message_type = _LABELSEGMENT -_LABELANNOTATION.fields_by_name["frames"].message_type = _LABELFRAME -_EXPLICITCONTENTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_EXPLICITCONTENTFRAME.fields_by_name["pornography_likelihood"].enum_type = _LIKELIHOOD -_EXPLICITCONTENTANNOTATION.fields_by_name["frames"].message_type = _EXPLICITCONTENTFRAME -_TIMESTAMPEDOBJECT.fields_by_name[ - "normalized_bounding_box" -].message_type = _NORMALIZEDBOUNDINGBOX -_TIMESTAMPEDOBJECT.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TIMESTAMPEDOBJECT.fields_by_name["attributes"].message_type = _DETECTEDATTRIBUTE -_TRACK.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_TRACK.fields_by_name["timestamped_objects"].message_type = _TIMESTAMPEDOBJECT -_TRACK.fields_by_name["attributes"].message_type = _DETECTEDATTRIBUTE -_CELEBRITYTRACK_RECOGNIZEDCELEBRITY.fields_by_name[ - "celebrity" -].message_type = _CELEBRITY -_CELEBRITYTRACK_RECOGNIZEDCELEBRITY.containing_type = _CELEBRITYTRACK -_CELEBRITYTRACK.fields_by_name[ - "celebrities" -].message_type = _CELEBRITYTRACK_RECOGNIZEDCELEBRITY -_CELEBRITYTRACK.fields_by_name["face_track"].message_type = _TRACK -_CELEBRITYRECOGNITIONANNOTATION.fields_by_name[ - "celebrity_tracks" -].message_type = _CELEBRITYTRACK -_VIDEOANNOTATIONRESULTS.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "segment_presence_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_presence_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "frame_label_annotations" -].message_type = _LABELANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name["shot_annotations"].message_type = _VIDEOSEGMENT -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "speech_transcriptions" -].message_type = _SPEECHTRANSCRIPTION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "text_annotations" -].message_type = _TEXTANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "object_annotations" -].message_type = _OBJECTTRACKINGANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "logo_recognition_annotations" -].message_type = _LOGORECOGNITIONANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "celebrity_recognition_annotations" -].message_type = _CELEBRITYRECOGNITIONANNOTATION -_VIDEOANNOTATIONRESULTS.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _VIDEOANNOTATIONRESULTS -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_VIDEOANNOTATIONPROGRESS.fields_by_name["feature"].enum_type = _FEATURE -_VIDEOANNOTATIONPROGRESS.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_ANNOTATEVIDEOPROGRESS.fields_by_name[ - "annotation_progress" -].message_type = _VIDEOANNOTATIONPROGRESS -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name[ - "speech_contexts" -].message_type = _SPEECHCONTEXT -_SPEECHTRANSCRIPTION.fields_by_name[ - "alternatives" -].message_type = _SPEECHRECOGNITIONALTERNATIVE -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"].message_type = _WORDINFO -_WORDINFO.fields_by_name[ - "start_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_WORDINFO.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_NORMALIZEDBOUNDINGPOLY.fields_by_name["vertices"].message_type = _NORMALIZEDVERTEX -_TEXTSEGMENT.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_TEXTSEGMENT.fields_by_name["frames"].message_type = _TEXTFRAME -_TEXTFRAME.fields_by_name["rotated_bounding_box"].message_type = _NORMALIZEDBOUNDINGPOLY -_TEXTFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_TEXTANNOTATION.fields_by_name["segments"].message_type = _TEXTSEGMENT -_OBJECTTRACKINGFRAME.fields_by_name[ - "normalized_bounding_box" -].message_type = _NORMALIZEDBOUNDINGBOX -_OBJECTTRACKINGFRAME.fields_by_name[ - "time_offset" -].message_type = google_dot_protobuf_dot_duration__pb2._DURATION -_OBJECTTRACKINGANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_OBJECTTRACKINGANNOTATION.fields_by_name["frames"].message_type = _OBJECTTRACKINGFRAME -_OBJECTTRACKINGANNOTATION.fields_by_name["segment"].message_type = _VIDEOSEGMENT -_OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"].fields.append( - _OBJECTTRACKINGANNOTATION.fields_by_name["segment"] -) -_OBJECTTRACKINGANNOTATION.fields_by_name[ - "segment" -].containing_oneof = _OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"] -_OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"].fields.append( - _OBJECTTRACKINGANNOTATION.fields_by_name["track_id"] -) -_OBJECTTRACKINGANNOTATION.fields_by_name[ - "track_id" -].containing_oneof = _OBJECTTRACKINGANNOTATION.oneofs_by_name["track_info"] -_LOGORECOGNITIONANNOTATION.fields_by_name["entity"].message_type = _ENTITY -_LOGORECOGNITIONANNOTATION.fields_by_name["tracks"].message_type = _TRACK -_LOGORECOGNITIONANNOTATION.fields_by_name["segments"].message_type = _VIDEOSEGMENT -_STREAMINGANNOTATEVIDEOREQUEST.fields_by_name[ - "video_config" -].message_type = _STREAMINGVIDEOCONFIG -_STREAMINGANNOTATEVIDEOREQUEST.oneofs_by_name["streaming_request"].fields.append( - _STREAMINGANNOTATEVIDEOREQUEST.fields_by_name["video_config"] -) -_STREAMINGANNOTATEVIDEOREQUEST.fields_by_name[ - "video_config" -].containing_oneof = _STREAMINGANNOTATEVIDEOREQUEST.oneofs_by_name["streaming_request"] -_STREAMINGANNOTATEVIDEOREQUEST.oneofs_by_name["streaming_request"].fields.append( - _STREAMINGANNOTATEVIDEOREQUEST.fields_by_name["input_content"] -) -_STREAMINGANNOTATEVIDEOREQUEST.fields_by_name[ - "input_content" -].containing_oneof = _STREAMINGANNOTATEVIDEOREQUEST.oneofs_by_name["streaming_request"] -_STREAMINGANNOTATEVIDEORESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_STREAMINGANNOTATEVIDEORESPONSE.fields_by_name[ - "annotation_results" -].message_type = _STREAMINGVIDEOANNOTATIONRESULTS -_STREAMINGVIDEOANNOTATIONRESULTS.fields_by_name[ - "shot_annotations" -].message_type = _VIDEOSEGMENT -_STREAMINGVIDEOANNOTATIONRESULTS.fields_by_name[ - "label_annotations" -].message_type = _LABELANNOTATION -_STREAMINGVIDEOANNOTATIONRESULTS.fields_by_name[ - "explicit_annotation" -].message_type = _EXPLICITCONTENTANNOTATION -_STREAMINGVIDEOANNOTATIONRESULTS.fields_by_name[ - "object_annotations" -].message_type = _OBJECTTRACKINGANNOTATION -_STREAMINGVIDEOCONFIG.fields_by_name["feature"].enum_type = _STREAMINGFEATURE -_STREAMINGVIDEOCONFIG.fields_by_name[ - "shot_change_detection_config" -].message_type = _STREAMINGSHOTCHANGEDETECTIONCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "label_detection_config" -].message_type = _STREAMINGLABELDETECTIONCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "explicit_content_detection_config" -].message_type = _STREAMINGEXPLICITCONTENTDETECTIONCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "object_tracking_config" -].message_type = _STREAMINGOBJECTTRACKINGCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "automl_classification_config" -].message_type = _STREAMINGAUTOMLCLASSIFICATIONCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "automl_object_tracking_config" -].message_type = _STREAMINGAUTOMLOBJECTTRACKINGCONFIG -_STREAMINGVIDEOCONFIG.fields_by_name[ - "storage_config" -].message_type = _STREAMINGSTORAGECONFIG -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["shot_change_detection_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "shot_change_detection_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["label_detection_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "label_detection_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["explicit_content_detection_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "explicit_content_detection_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["object_tracking_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "object_tracking_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["automl_classification_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "automl_classification_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -_STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"].fields.append( - _STREAMINGVIDEOCONFIG.fields_by_name["automl_object_tracking_config"] -) -_STREAMINGVIDEOCONFIG.fields_by_name[ - "automl_object_tracking_config" -].containing_oneof = _STREAMINGVIDEOCONFIG.oneofs_by_name["streaming_config"] -DESCRIPTOR.message_types_by_name["AnnotateVideoRequest"] = _ANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name["VideoContext"] = _VIDEOCONTEXT -DESCRIPTOR.message_types_by_name["LabelDetectionConfig"] = _LABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "ShotChangeDetectionConfig" -] = _SHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["ObjectTrackingConfig"] = _OBJECTTRACKINGCONFIG -DESCRIPTOR.message_types_by_name[ - "ExplicitContentDetectionConfig" -] = _EXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["TextDetectionConfig"] = _TEXTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["VideoSegment"] = _VIDEOSEGMENT -DESCRIPTOR.message_types_by_name["LabelSegment"] = _LABELSEGMENT -DESCRIPTOR.message_types_by_name["LabelFrame"] = _LABELFRAME -DESCRIPTOR.message_types_by_name["Entity"] = _ENTITY -DESCRIPTOR.message_types_by_name["LabelAnnotation"] = _LABELANNOTATION -DESCRIPTOR.message_types_by_name["ExplicitContentFrame"] = _EXPLICITCONTENTFRAME -DESCRIPTOR.message_types_by_name[ - "ExplicitContentAnnotation" -] = _EXPLICITCONTENTANNOTATION -DESCRIPTOR.message_types_by_name["NormalizedBoundingBox"] = _NORMALIZEDBOUNDINGBOX -DESCRIPTOR.message_types_by_name["TimestampedObject"] = _TIMESTAMPEDOBJECT -DESCRIPTOR.message_types_by_name["Track"] = _TRACK -DESCRIPTOR.message_types_by_name["DetectedAttribute"] = _DETECTEDATTRIBUTE -DESCRIPTOR.message_types_by_name["Celebrity"] = _CELEBRITY -DESCRIPTOR.message_types_by_name["CelebrityTrack"] = _CELEBRITYTRACK -DESCRIPTOR.message_types_by_name[ - "CelebrityRecognitionAnnotation" -] = _CELEBRITYRECOGNITIONANNOTATION -DESCRIPTOR.message_types_by_name["VideoAnnotationResults"] = _VIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["AnnotateVideoResponse"] = _ANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name["VideoAnnotationProgress"] = _VIDEOANNOTATIONPROGRESS -DESCRIPTOR.message_types_by_name["AnnotateVideoProgress"] = _ANNOTATEVIDEOPROGRESS -DESCRIPTOR.message_types_by_name[ - "SpeechTranscriptionConfig" -] = _SPEECHTRANSCRIPTIONCONFIG -DESCRIPTOR.message_types_by_name["SpeechContext"] = _SPEECHCONTEXT -DESCRIPTOR.message_types_by_name["SpeechTranscription"] = _SPEECHTRANSCRIPTION -DESCRIPTOR.message_types_by_name[ - "SpeechRecognitionAlternative" -] = _SPEECHRECOGNITIONALTERNATIVE -DESCRIPTOR.message_types_by_name["WordInfo"] = _WORDINFO -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY -DESCRIPTOR.message_types_by_name["TextSegment"] = _TEXTSEGMENT -DESCRIPTOR.message_types_by_name["TextFrame"] = _TEXTFRAME -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["ObjectTrackingFrame"] = _OBJECTTRACKINGFRAME -DESCRIPTOR.message_types_by_name["ObjectTrackingAnnotation"] = _OBJECTTRACKINGANNOTATION -DESCRIPTOR.message_types_by_name[ - "LogoRecognitionAnnotation" -] = _LOGORECOGNITIONANNOTATION -DESCRIPTOR.message_types_by_name[ - "StreamingAnnotateVideoRequest" -] = _STREAMINGANNOTATEVIDEOREQUEST -DESCRIPTOR.message_types_by_name[ - "StreamingAnnotateVideoResponse" -] = _STREAMINGANNOTATEVIDEORESPONSE -DESCRIPTOR.message_types_by_name[ - "StreamingAutomlClassificationConfig" -] = _STREAMINGAUTOMLCLASSIFICATIONCONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingAutomlObjectTrackingConfig" -] = _STREAMINGAUTOMLOBJECTTRACKINGCONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingExplicitContentDetectionConfig" -] = _STREAMINGEXPLICITCONTENTDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingLabelDetectionConfig" -] = _STREAMINGLABELDETECTIONCONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingObjectTrackingConfig" -] = _STREAMINGOBJECTTRACKINGCONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingShotChangeDetectionConfig" -] = _STREAMINGSHOTCHANGEDETECTIONCONFIG -DESCRIPTOR.message_types_by_name["StreamingStorageConfig"] = _STREAMINGSTORAGECONFIG -DESCRIPTOR.message_types_by_name[ - "StreamingVideoAnnotationResults" -] = _STREAMINGVIDEOANNOTATIONRESULTS -DESCRIPTOR.message_types_by_name["StreamingVideoConfig"] = _STREAMINGVIDEOCONFIG -DESCRIPTOR.enum_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.enum_types_by_name["LabelDetectionMode"] = _LABELDETECTIONMODE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -DESCRIPTOR.enum_types_by_name["StreamingFeature"] = _STREAMINGFEATURE -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -AnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation request. - - - Attributes: - input_uri: - Input video location. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. A video URI may include - wildcards in ``object-id``, and thus identify multiple videos. - Supported wildcards: '\*' to match 0 or more characters; '?' - to match 1 character. If unset, the input video should be - embedded in the request as ``input_content``. If set, - ``input_content`` should be unset. - input_content: - The video data bytes. If unset, the input video(s) should be - specified via ``input_uri``. If set, ``input_uri`` should be - unset. - features: - Required. Requested video annotation features. - video_context: - Additional video context and/or feature-specific parameters. - output_uri: - Optional. Location where the output (in JSON format) should be - stored. Currently, only `Google Cloud Storage - `__ URIs are supported, - which must be specified in the following format: - ``gs://bucket-id/object-id`` (other URI formats return [google - .rpc.Code.INVALID\_ARGUMENT][google.rpc.Code.INVALID\_ARGUMENT - ]). For more information, see `Request URIs - `__. - location_id: - Optional. Cloud region where annotation should take place. - Supported cloud regions: ``us-east1``, ``us-west1``, ``europe- - west1``, ``asia-east1``. If no region is specified, a region - will be determined based on video file location. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.AnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(AnnotateVideoRequest) - -VideoContext = _reflection.GeneratedProtocolMessageType( - "VideoContext", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOCONTEXT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video context and/or feature-specific parameters. - - - Attributes: - segments: - Video segments to annotate. The segments may overlap and are - not required to be contiguous or span the whole video. If - unspecified, each video is treated as a single segment. - label_detection_config: - Config for LABEL\_DETECTION. - shot_change_detection_config: - Config for SHOT\_CHANGE\_DETECTION. - explicit_content_detection_config: - Config for EXPLICIT\_CONTENT\_DETECTION. - speech_transcription_config: - Config for SPEECH\_TRANSCRIPTION. - text_detection_config: - Config for TEXT\_DETECTION. - object_tracking_config: - Config for OBJECT\_TRACKING. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.VideoContext) - ), -) -_sym_db.RegisterMessage(VideoContext) - -LabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "LabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_LABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for LABEL\_DETECTION. - - - Attributes: - label_detection_mode: - What labels should be detected with LABEL\_DETECTION, in - addition to video-level labels or segment-level labels. If - unspecified, defaults to ``SHOT_MODE``. - stationary_camera: - Whether the video has been shot from a stationary (i.e. non- - moving) camera. When set to true, might improve detection - accuracy for moving objects. Should be used with - ``SHOT_AND_FRAME_MODE`` enabled. - model: - Model to use for label detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - frame_confidence_threshold: - The confidence threshold we perform filtering on the labels - from frame-level detection. If not set, it is set to 0.4 by - default. The valid range for this threshold is [0.1, 0.9]. Any - value set outside of this range will be clipped. Note: for - best results please follow the default threshold. We will - update the default threshold everytime when we release a new - model. - video_confidence_threshold: - The confidence threshold we perform filtering on the labels - from video-level and shot-level detections. If not set, it is - set to 0.3 by default. The valid range for this threshold is - [0.1, 0.9]. Any value set outside of this range will be - clipped. Note: for best results please follow the default - threshold. We will update the default threshold everytime when - we release a new model. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.LabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(LabelDetectionConfig) - -ShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for SHOT\_CHANGE\_DETECTION. - - - Attributes: - model: - Model to use for shot change detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(ShotChangeDetectionConfig) - -ObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for OBJECT\_TRACKING. - - - Attributes: - model: - Model to use for object tracking. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ObjectTrackingConfig) - ), -) -_sym_db.RegisterMessage(ObjectTrackingConfig) - -ExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "ExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for EXPLICIT\_CONTENT\_DETECTION. - - - Attributes: - model: - Model to use for explicit content detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(ExplicitContentDetectionConfig) - -TextDetectionConfig = _reflection.GeneratedProtocolMessageType( - "TextDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for TEXT\_DETECTION. - - - Attributes: - language_hints: - Language hint can be specified if the language to be detected - is known a priori. It can increase the accuracy of the - detection. Language hint must be language code in BCP-47 - format. Automatic language detection is performed if no hint - is provided. - model: - Model to use for text detection. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.TextDetectionConfig) - ), -) -_sym_db.RegisterMessage(TextDetectionConfig) - -VideoSegment = _reflection.GeneratedProtocolMessageType( - "VideoSegment", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOSEGMENT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video segment. - - - Attributes: - start_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the start of the segment (inclusive). - end_time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the end of the segment (inclusive). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.VideoSegment) - ), -) -_sym_db.RegisterMessage(VideoSegment) - -LabelSegment = _reflection.GeneratedProtocolMessageType( - "LabelSegment", - (_message.Message,), - dict( - DESCRIPTOR=_LABELSEGMENT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for label detection. - - - Attributes: - segment: - Video segment where a label was detected. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.LabelSegment) - ), -) -_sym_db.RegisterMessage(LabelSegment) - -LabelFrame = _reflection.GeneratedProtocolMessageType( - "LabelFrame", - (_message.Message,), - dict( - DESCRIPTOR=_LABELFRAME, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for label detection. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - confidence: - Confidence that the label is accurate. Range: [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.LabelFrame) - ), -) -_sym_db.RegisterMessage(LabelFrame) - -Entity = _reflection.GeneratedProtocolMessageType( - "Entity", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITY, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Detected entity from video analysis. - - - Attributes: - entity_id: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - description: - Textual description, e.g. ``Fixed-gear bicycle``. - language_code: - Language code for ``description`` in BCP-47 format. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.Entity) - ), -) -_sym_db.RegisterMessage(Entity) - -LabelAnnotation = _reflection.GeneratedProtocolMessageType( - "LabelAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LABELANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Label annotation. - - - Attributes: - entity: - Detected entity. - category_entities: - Common categories for the detected entity. E.g. when the label - is ``Terrier`` the category is likely ``dog``. And in some - cases there might be more than one categories e.g. ``Terrier`` - could also be a ``pet``. - segments: - All video segments where a label was detected. - frames: - All video frames where a label was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.LabelAnnotation) - ), -) -_sym_db.RegisterMessage(LabelAnnotation) - -ExplicitContentFrame = _reflection.GeneratedProtocolMessageType( - "ExplicitContentFrame", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTFRAME, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for explicit content. - - - Attributes: - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this location. - pornography_likelihood: - Likelihood of the pornography content.. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ExplicitContentFrame) - ), -) -_sym_db.RegisterMessage(ExplicitContentFrame) - -ExplicitContentAnnotation = _reflection.GeneratedProtocolMessageType( - "ExplicitContentAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_EXPLICITCONTENTANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Explicit content annotation (based on per-frame visual signals only). If - no explicit content has been detected in a frame, no annotations are - present for that frame. - - - Attributes: - frames: - All video frames where explicit content was detected. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ExplicitContentAnnotation) - ), -) -_sym_db.RegisterMessage(ExplicitContentAnnotation) - -NormalizedBoundingBox = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingBox", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGBOX, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding box. The normalized vertex coordinates are relative - to the original image. Range: [0, 1]. - - - Attributes: - left: - Left X coordinate. - top: - Top Y coordinate. - right: - Right X coordinate. - bottom: - Bottom Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.NormalizedBoundingBox) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingBox) - -TimestampedObject = _reflection.GeneratedProtocolMessageType( - "TimestampedObject", - (_message.Message,), - dict( - DESCRIPTOR=_TIMESTAMPEDOBJECT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""For tracking related features. An object at time\_offset with - attributes, and located with normalized\_bounding\_box. - - - Attributes: - normalized_bounding_box: - Normalized Bounding box in a frame, where the object is - located. - time_offset: - Time-offset, relative to the beginning of the video, - corresponding to the video frame for this object. - attributes: - Optional. The attributes of the object in the bounding box. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.TimestampedObject) - ), -) -_sym_db.RegisterMessage(TimestampedObject) - -Track = _reflection.GeneratedProtocolMessageType( - "Track", - (_message.Message,), - dict( - DESCRIPTOR=_TRACK, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""A track of an object instance. - - - Attributes: - segment: - Video segment of a track. - timestamped_objects: - The object with timestamp and attributes per frame in the - track. - attributes: - Optional. Attributes in the track level. - confidence: - Optional. The confidence score of the tracked object. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.Track) - ), -) -_sym_db.RegisterMessage(Track) - -DetectedAttribute = _reflection.GeneratedProtocolMessageType( - "DetectedAttribute", - (_message.Message,), - dict( - DESCRIPTOR=_DETECTEDATTRIBUTE, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""A generic detected attribute represented by name in string format. - - - Attributes: - name: - The name of the attribute, i.e. glasses, dark\_glasses, - mouth\_open etc. A full list of supported type names will be - provided in the document. - confidence: - Detected attribute confidence. Range [0, 1]. - value: - Text value of the detection result. For example, the value for - "HairColor" can be "black", "blonde", etc. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.DetectedAttribute) - ), -) -_sym_db.RegisterMessage(DetectedAttribute) - -Celebrity = _reflection.GeneratedProtocolMessageType( - "Celebrity", - (_message.Message,), - dict( - DESCRIPTOR=_CELEBRITY, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Celebrity definition. - - - Attributes: - name: - The resource name of the celebrity. Have the format ``video- - intelligence/kg-mid`` indicates a celebrity from preloaded - gallery. kg-mid is the id in Google knowledge graph, which is - unique for the celebrity. - display_name: - The celebrity name. - description: - Textual description of additional information about the - celebrity, if applicable. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.Celebrity) - ), -) -_sym_db.RegisterMessage(Celebrity) - -CelebrityTrack = _reflection.GeneratedProtocolMessageType( - "CelebrityTrack", - (_message.Message,), - dict( - RecognizedCelebrity=_reflection.GeneratedProtocolMessageType( - "RecognizedCelebrity", - (_message.Message,), - dict( - DESCRIPTOR=_CELEBRITYTRACK_RECOGNIZEDCELEBRITY, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""The recognized celebrity with confidence score. - - - Attributes: - celebrity: - The recognized celebrity. - confidence: - Recognition confidence. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.CelebrityTrack.RecognizedCelebrity) - ), - ), - DESCRIPTOR=_CELEBRITYTRACK, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""The annotation result of a celebrity face track. RecognizedCelebrity - field could be empty if the face track does not have any matched - celebrities. - - - Attributes: - celebrities: - Top N match of the celebrities for the face in this track. - face_track: - A track of a person's face. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.CelebrityTrack) - ), -) -_sym_db.RegisterMessage(CelebrityTrack) -_sym_db.RegisterMessage(CelebrityTrack.RecognizedCelebrity) - -CelebrityRecognitionAnnotation = _reflection.GeneratedProtocolMessageType( - "CelebrityRecognitionAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CELEBRITYRECOGNITIONANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Celebrity recognition annotation per video. - - - Attributes: - celebrity_tracks: - The tracks detected from the input video, including recognized - celebrities and other detected faces in the video. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.CelebrityRecognitionAnnotation) - ), -) -_sym_db.RegisterMessage(CelebrityRecognitionAnnotation) - -VideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Annotation results for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - segment: - Video segment on which the annotation is run. - segment_label_annotations: - Topical label annotations on video level or user specified - segment level. There is exactly one element for each unique - label. - segment_presence_label_annotations: - Presence label annotations on video level or user specified - segment level. There is exactly one element for each unique - label. Compared to the existing topical - ``segment_label_annotations``, this field presents more fine- - grained, segment-level labels detected in video content and is - made available only when the client sets - ``LabelDetectionConfig.model`` to "builtin/latest" in the - request. - shot_label_annotations: - Topical label annotations on shot level. There is exactly one - element for each unique label. - shot_presence_label_annotations: - Presence label annotations on shot level. There is exactly one - element for each unique label. Compared to the existing - topical ``shot_label_annotations``, this field presents more - fine-grained, shot-level labels detected in video content and - is made available only when the client sets - ``LabelDetectionConfig.model`` to "builtin/latest" in the - request. - frame_label_annotations: - Label annotations on frame level. There is exactly one element - for each unique label. - shot_annotations: - Shot annotations. Each shot is represented as a video segment. - explicit_annotation: - Explicit content annotation. - speech_transcriptions: - Speech transcription. - text_annotations: - OCR text detection and tracking. Annotations for list of - detected text snippets. Each will have list of frame - information associated with it. - object_annotations: - Annotations for list of objects detected and tracked in video. - logo_recognition_annotations: - Annotations for list of logos detected, tracked and recognized - in video. - celebrity_recognition_annotations: - Celebrity recognition annotations. - error: - If set, indicates an error. Note that for a single - ``AnnotateVideoRequest`` some videos may succeed and some may - fail. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.VideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(VideoAnnotationResults) - -AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation response. Included in the ``response`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_results: - Annotation results for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.AnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(AnnotateVideoResponse) - -VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType( - "VideoAnnotationProgress", - (_message.Message,), - dict( - DESCRIPTOR=_VIDEOANNOTATIONPROGRESS, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Annotation progress for a single video. - - - Attributes: - input_uri: - Video file location in `Google Cloud Storage - `__. - progress_percent: - Approximate percentage processed thus far. Guaranteed to be - 100 when fully processed. - start_time: - Time when the request was received. - update_time: - Time of the most recent update. - feature: - Specifies which feature is being tracked if the request - contains more than one features. - segment: - Specifies which segment is being tracked if the request - contains more than one segments. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.VideoAnnotationProgress) - ), -) -_sym_db.RegisterMessage(VideoAnnotationProgress) - -AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType( - "AnnotateVideoProgress", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEVIDEOPROGRESS, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video annotation progress. Included in the ``metadata`` field of the - ``Operation`` returned by the ``GetOperation`` call of the - ``google::longrunning::Operations`` service. - - - Attributes: - annotation_progress: - Progress metadata for all videos specified in - ``AnnotateVideoRequest``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.AnnotateVideoProgress) - ), -) -_sym_db.RegisterMessage(AnnotateVideoProgress) - -SpeechTranscriptionConfig = _reflection.GeneratedProtocolMessageType( - "SpeechTranscriptionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for SPEECH\_TRANSCRIPTION. - - - Attributes: - language_code: - Required. *Required* The language of the supplied audio as a - `BCP-47 `__ - language tag. Example: "en-US". See `Language Support - `__ for a list - of the currently supported language codes. - max_alternatives: - Optional. Maximum number of recognition hypotheses to be - returned. Specifically, the maximum number of - ``SpeechRecognitionAlternative`` messages within each - ``SpeechTranscription``. The server may return fewer than - ``max_alternatives``. Valid values are ``0``-``30``. A value - of ``0`` or ``1`` will return a maximum of one. If omitted, - will return a maximum of one. - filter_profanity: - Optional. If set to ``true``, the server will attempt to - filter out profanities, replacing all but the initial - character in each filtered word with asterisks, e.g. - "f\*\*\*". If set to ``false`` or omitted, profanities won't - be filtered out. - speech_contexts: - Optional. A means to provide context to assist the speech - recognition. - enable_automatic_punctuation: - Optional. If 'true', adds punctuation to recognition result - hypotheses. This feature is only available in select - languages. Setting this for requests in other languages has no - effect at all. The default 'false' value does not add - punctuation to result hypotheses. NOTE: "This is currently - offered as an experimental service, complimentary to all - users. In the future this may be exclusively available as a - premium feature." - audio_tracks: - Optional. For file formats, such as MXF or MKV, supporting - multiple audio tracks, specify up to two tracks. Default: - track 0. - enable_speaker_diarization: - Optional. If 'true', enables speaker detection for each - recognized word in the top alternative of the recognition - result using a speaker\_tag provided in the WordInfo. Note: - When this is true, we send all the words from the beginning of - the audio for the top alternative in every consecutive - responses. This is done in order to improve our speaker tags - as our models learn to identify the speakers in the - conversation over time. - diarization_speaker_count: - Optional. If set, specifies the estimated number of speakers - in the conversation. If not set, defaults to '2'. Ignored - unless enable\_speaker\_diarization is set to true. - enable_word_confidence: - Optional. If ``true``, the top result includes a list of words - and the confidence for those words. If ``false``, no word- - level confidence information is returned. The default is - ``false``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.SpeechTranscriptionConfig) - ), -) -_sym_db.RegisterMessage(SpeechTranscriptionConfig) - -SpeechContext = _reflection.GeneratedProtocolMessageType( - "SpeechContext", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHCONTEXT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Provides "hints" to the speech recognizer to favor specific words and - phrases in the results. - - - Attributes: - phrases: - Optional. A list of strings containing words and phrases - "hints" so that the speech recognition is more likely to - recognize them. This can be used to improve the accuracy for - specific words and phrases, for example, if specific commands - are typically spoken by the user. This can also be used to add - additional words to the vocabulary of the recognizer. See - `usage limits - `__. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.SpeechContext) - ), -) -_sym_db.RegisterMessage(SpeechContext) - -SpeechTranscription = _reflection.GeneratedProtocolMessageType( - "SpeechTranscription", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHTRANSCRIPTION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""A speech recognition result corresponding to a portion of the audio. - - - Attributes: - alternatives: - May contain one or more recognition hypotheses (up to the - maximum specified in ``max_alternatives``). These alternatives - are ordered in terms of accuracy, with the top (first) - alternative being the most probable, as ranked by the - recognizer. - language_code: - Output only. The `BCP-47 `__ language tag of the language - in this result. This language code was detected to have the - most likelihood of being spoken in the audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.SpeechTranscription) - ), -) -_sym_db.RegisterMessage(SpeechTranscription) - -SpeechRecognitionAlternative = _reflection.GeneratedProtocolMessageType( - "SpeechRecognitionAlternative", - (_message.Message,), - dict( - DESCRIPTOR=_SPEECHRECOGNITIONALTERNATIVE, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Alternative hypotheses (a.k.a. n-best list). - - - Attributes: - transcript: - Transcript text representing the words that the user spoke. - confidence: - Output only. The confidence estimate between 0.0 and 1.0. A - higher number indicates an estimated greater likelihood that - the recognized words are correct. This field is set only for - the top alternative. This field is not guaranteed to be - accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - words: - Output only. A list of word-specific information for each - recognized word. Note: When ``enable_speaker_diarization`` is - true, you will see all the words from the beginning of the - audio. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.SpeechRecognitionAlternative) - ), -) -_sym_db.RegisterMessage(SpeechRecognitionAlternative) - -WordInfo = _reflection.GeneratedProtocolMessageType( - "WordInfo", - (_message.Message,), - dict( - DESCRIPTOR=_WORDINFO, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Word-specific information for recognized words. Word information is only - included in the response when certain request parameters are set, such - as ``enable_word_time_offsets``. - - - Attributes: - start_time: - Time offset relative to the beginning of the audio, and - corresponding to the start of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - end_time: - Time offset relative to the beginning of the audio, and - corresponding to the end of the spoken word. This field is - only set if ``enable_word_time_offsets=true`` and only in the - top hypothesis. This is an experimental feature and the - accuracy of the time offset can vary. - word: - The word corresponding to this set of information. - confidence: - Output only. The confidence estimate between 0.0 and 1.0. A - higher number indicates an estimated greater likelihood that - the recognized words are correct. This field is set only for - the top alternative. This field is not guaranteed to be - accurate and users should not rely on it to be always - provided. The default of 0.0 is a sentinel value indicating - ``confidence`` was not set. - speaker_tag: - Output only. A distinct integer value is assigned for every - speaker within the audio. This field specifies which one of - those speakers was detected to have spoken this word. Value - ranges from 1 up to diarization\_speaker\_count, and is only - set if speaker diarization is enabled. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.WordInfo) - ), -) -_sym_db.RegisterMessage(WordInfo) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Normalized bounding polygon for text (that might not be aligned with - axis). Contains list of the corner points in clockwise order starting - from top-left corner. For example, for a rectangular bounding box: When - the text is horizontal it might look like: 0----1 \| \| 3----2 - - When it's clockwise rotated 180 degrees around the top-left corner it - becomes: 2----3 \| \| 1----0 - - and the vertex order will still be (0, 1, 2, 3). Note that values can be - less than 0, or greater than 1 due to trignometric calculations for - location of the box. - - - Attributes: - vertices: - Normalized vertices of the bounding polygon. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.NormalizedBoundingPoly) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingPoly) - -TextSegment = _reflection.GeneratedProtocolMessageType( - "TextSegment", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTSEGMENT, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video segment level annotation results for text detection. - - - Attributes: - segment: - Video segment where a text snippet was detected. - confidence: - Confidence for the track of detected text. It is calculated as - the highest over all frames where OCR detected text appears. - frames: - Information related to the frames where OCR detected text - appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.TextSegment) - ), -) -_sym_db.RegisterMessage(TextSegment) - -TextFrame = _reflection.GeneratedProtocolMessageType( - "TextFrame", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTFRAME, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotation results for text annotation (OCR). Contains - information regarding timestamp and bounding box locations for the - frames containing detected OCR text snippets. - - - Attributes: - rotated_bounding_box: - Bounding polygon of the detected text for this frame. - time_offset: - Timestamp of this frame. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.TextFrame) - ), -) -_sym_db.RegisterMessage(TextFrame) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Annotations related to one detected OCR text snippet. This will contain - the corresponding text, confidence value, and frame level information - for each detection. - - - Attributes: - text: - The detected text. - segments: - All video segments where OCR detected text appears. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) - -ObjectTrackingFrame = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingFrame", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGFRAME, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Video frame level annotations for object detection and tracking. This - field stores per frame location, time offset, and confidence. - - - Attributes: - normalized_bounding_box: - The normalized bounding box location of this object track for - the frame. - time_offset: - The timestamp of the frame in microseconds. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ObjectTrackingFrame) - ), -) -_sym_db.RegisterMessage(ObjectTrackingFrame) - -ObjectTrackingAnnotation = _reflection.GeneratedProtocolMessageType( - "ObjectTrackingAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_OBJECTTRACKINGANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Annotations corresponding to one tracked object. - - - Attributes: - entity: - Entity to specify the object category that this track is - labeled as. - confidence: - Object category's labeling confidence of this track. - frames: - Information corresponding to all frames where this object - track appears. Non-streaming batch mode: it may be one or - multiple ObjectTrackingFrame messages in frames. Streaming - mode: it can only be one ObjectTrackingFrame message in - frames. - track_info: - Different representation of tracking info in non-streaming - batch and streaming modes. - segment: - Non-streaming batch mode ONLY. Each object track corresponds - to one video segment where it appears. - track_id: - Streaming mode ONLY. In streaming mode, we do not know the end - time of a tracked object before it is completed. Hence, there - is no VideoSegment info returned. Instead, we provide a unique - identifiable integer track\_id so that the customers can - correlate the results of the ongoing ObjectTrackAnnotation of - the same track\_id over time. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.ObjectTrackingAnnotation) - ), -) -_sym_db.RegisterMessage(ObjectTrackingAnnotation) - -LogoRecognitionAnnotation = _reflection.GeneratedProtocolMessageType( - "LogoRecognitionAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LOGORECOGNITIONANNOTATION, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Annotation corresponding to one detected, tracked and recognized logo - class. - - - Attributes: - entity: - Entity category information to specify the logo class that all - the logo tracks within this LogoRecognitionAnnotation are - recognized as. - tracks: - All logo tracks where the recognized logo appears. Each track - corresponds to one logo instance appearing in consecutive - frames. - segments: - All video segments where the recognized logo appears. There - might be multiple instances of the same logo class appearing - in one VideoSegment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.LogoRecognitionAnnotation) - ), -) -_sym_db.RegisterMessage(LogoRecognitionAnnotation) - -StreamingAnnotateVideoRequest = _reflection.GeneratedProtocolMessageType( - "StreamingAnnotateVideoRequest", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGANNOTATEVIDEOREQUEST, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""The top-level message sent by the client for the - ``StreamingAnnotateVideo`` method. Multiple - ``StreamingAnnotateVideoRequest`` messages are sent. The first message - must only contain a ``StreamingVideoConfig`` message. All subsequent - messages must only contain ``input_content`` data. - - - Attributes: - streaming_request: - *Required* The streaming request, which is either a streaming - config or video content. - video_config: - Provides information to the annotator, specifing how to - process the request. The first - ``AnnotateStreamingVideoRequest`` message must only contain a - ``video_config`` message. - input_content: - The video data to be annotated. Chunks of video data are - sequentially sent in ``StreamingAnnotateVideoRequest`` - messages. Except the initial ``StreamingAnnotateVideoRequest`` - message containing only ``video_config``, all subsequent - ``AnnotateStreamingVideoRequest`` messages must only contain - ``input_content`` field. Note: as with all bytes fields, - protobuffers use a pure binary representation (not base64). - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoRequest) - ), -) -_sym_db.RegisterMessage(StreamingAnnotateVideoRequest) - -StreamingAnnotateVideoResponse = _reflection.GeneratedProtocolMessageType( - "StreamingAnnotateVideoResponse", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGANNOTATEVIDEORESPONSE, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""``StreamingAnnotateVideoResponse`` is the only message returned to the - client by ``StreamingAnnotateVideo``. A series of zero or more - ``StreamingAnnotateVideoResponse`` messages are streamed back to the - client. - - - Attributes: - error: - If set, returns a [google.rpc.Status][google.rpc.Status] - message that specifies the error for the operation. - annotation_results: - Streaming annotation results. - annotation_results_uri: - GCS URI that stores annotation results of one streaming - session. It is a directory that can hold multiple files in - JSON format. Example uri format: - gs://bucket\_id/object\_id/cloud\_project\_name-session\_id - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingAnnotateVideoResponse) - ), -) -_sym_db.RegisterMessage(StreamingAnnotateVideoResponse) - -StreamingAutomlClassificationConfig = _reflection.GeneratedProtocolMessageType( - "StreamingAutomlClassificationConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGAUTOMLCLASSIFICATIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_AUTOML\_CLASSIFICATION. - - - Attributes: - model_name: - Resource name of AutoML model. Format: ``projects/{project_id} - /locations/{location_id}/models/{model_id}`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingAutomlClassificationConfig) - ), -) -_sym_db.RegisterMessage(StreamingAutomlClassificationConfig) - -StreamingAutomlObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( - "StreamingAutomlObjectTrackingConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGAUTOMLOBJECTTRACKINGCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_AUTOML\_OBJECT\_TRACKING. - - - Attributes: - model_name: - Resource name of AutoML model. Format: ``projects/{project_id} - /locations/{location_id}/models/{model_id}`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingAutomlObjectTrackingConfig) - ), -) -_sym_db.RegisterMessage(StreamingAutomlObjectTrackingConfig) - -StreamingExplicitContentDetectionConfig = _reflection.GeneratedProtocolMessageType( - "StreamingExplicitContentDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGEXPLICITCONTENTDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_EXPLICIT\_CONTENT\_DETECTION. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingExplicitContentDetectionConfig) - ), -) -_sym_db.RegisterMessage(StreamingExplicitContentDetectionConfig) - -StreamingLabelDetectionConfig = _reflection.GeneratedProtocolMessageType( - "StreamingLabelDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGLABELDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_LABEL\_DETECTION. - - - Attributes: - stationary_camera: - Whether the video has been captured from a stationary (i.e. - non-moving) camera. When set to true, might improve detection - accuracy for moving objects. Default: false. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingLabelDetectionConfig) - ), -) -_sym_db.RegisterMessage(StreamingLabelDetectionConfig) - -StreamingObjectTrackingConfig = _reflection.GeneratedProtocolMessageType( - "StreamingObjectTrackingConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGOBJECTTRACKINGCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_OBJECT\_TRACKING. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingObjectTrackingConfig) - ), -) -_sym_db.RegisterMessage(StreamingObjectTrackingConfig) - -StreamingShotChangeDetectionConfig = _reflection.GeneratedProtocolMessageType( - "StreamingShotChangeDetectionConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGSHOTCHANGEDETECTIONCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for STREAMING\_SHOT\_CHANGE\_DETECTION. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingShotChangeDetectionConfig) - ), -) -_sym_db.RegisterMessage(StreamingShotChangeDetectionConfig) - -StreamingStorageConfig = _reflection.GeneratedProtocolMessageType( - "StreamingStorageConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGSTORAGECONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Config for streaming storage option. - - - Attributes: - enable_storage_annotation_result: - Enable streaming storage. Default: false. - annotation_result_storage_directory: - GCS URI to store all annotation results for one client. Client - should specify this field as the top-level storage directory. - Annotation results of different sessions will be put into - different sub-directories denoted by project\_name and - session\_id. All sub-directories will be auto generated by - program and will be made accessible to client in response - proto. URIs must be specified in the following format: - ``gs://bucket-id/object-id`` ``bucket-id`` should be a valid - GCS bucket created by client and bucket permission shall also - be configured properly. ``object-id`` can be arbitrary string - that make sense to client. Other URI formats will return error - and cause GCS write failure. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingStorageConfig) - ), -) -_sym_db.RegisterMessage(StreamingStorageConfig) - -StreamingVideoAnnotationResults = _reflection.GeneratedProtocolMessageType( - "StreamingVideoAnnotationResults", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGVIDEOANNOTATIONRESULTS, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Streaming annotation results corresponding to a portion of the video - that is currently being processed. - - - Attributes: - shot_annotations: - Shot annotation results. Each shot is represented as a video - segment. - label_annotations: - Label annotation results. - explicit_annotation: - Explicit content annotation results. - object_annotations: - Object tracking results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingVideoAnnotationResults) - ), -) -_sym_db.RegisterMessage(StreamingVideoAnnotationResults) - -StreamingVideoConfig = _reflection.GeneratedProtocolMessageType( - "StreamingVideoConfig", - (_message.Message,), - dict( - DESCRIPTOR=_STREAMINGVIDEOCONFIG, - __module__="google.cloud.videointelligence_v1p3beta1.proto.video_intelligence_pb2", - __doc__="""Provides information to the annotator that specifies how to process the - request. - - - Attributes: - feature: - Requested annotation feature. - streaming_config: - Config for requested annotation feature. - shot_change_detection_config: - Config for STREAMING\_SHOT\_CHANGE\_DETECTION. - label_detection_config: - Config for STREAMING\_LABEL\_DETECTION. - explicit_content_detection_config: - Config for STREAMING\_EXPLICIT\_CONTENT\_DETECTION. - object_tracking_config: - Config for STREAMING\_OBJECT\_TRACKING. - automl_classification_config: - Config for STREAMING\_AUTOML\_CLASSIFICATION. - automl_object_tracking_config: - Config for STREAMING\_AUTOML\_OBJECT\_TRACKING. - storage_config: - Streaming storage option. By default: storage is disabled. - """, - # @@protoc_insertion_point(class_scope:google.cloud.videointelligence.v1p3beta1.StreamingVideoConfig) - ), -) -_sym_db.RegisterMessage(StreamingVideoConfig) - - -DESCRIPTOR._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["features"]._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["output_uri"]._options = None -_ANNOTATEVIDEOREQUEST.fields_by_name["location_id"]._options = None -_TIMESTAMPEDOBJECT.fields_by_name["attributes"]._options = None -_TRACK.fields_by_name["attributes"]._options = None -_TRACK.fields_by_name["confidence"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["language_code"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["max_alternatives"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["filter_profanity"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["speech_contexts"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name[ - "enable_automatic_punctuation" -]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["audio_tracks"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["enable_speaker_diarization"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["diarization_speaker_count"]._options = None -_SPEECHTRANSCRIPTIONCONFIG.fields_by_name["enable_word_confidence"]._options = None -_SPEECHCONTEXT.fields_by_name["phrases"]._options = None -_SPEECHTRANSCRIPTION.fields_by_name["language_code"]._options = None -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["confidence"]._options = None -_SPEECHRECOGNITIONALTERNATIVE.fields_by_name["words"]._options = None -_WORDINFO.fields_by_name["confidence"]._options = None -_WORDINFO.fields_by_name["speaker_tag"]._options = None - -_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="VideoIntelligenceService", - full_name="google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A videointelligence.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=10762, - serialized_end=11096, - methods=[ - _descriptor.MethodDescriptor( - name="AnnotateVideo", - full_name="google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService.AnnotateVideo", - index=0, - containing_service=None, - input_type=_ANNOTATEVIDEOREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p3beta1/videos:annotate:\001*\332A\022input_uri,features\312A.\n\025AnnotateVideoResponse\022\025AnnotateVideoProgress' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name["VideoIntelligenceService"] = _VIDEOINTELLIGENCESERVICE - - -_STREAMINGVIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( - name="StreamingVideoIntelligenceService", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService", - file=DESCRIPTOR, - index=1, - serialized_options=_b( - "\312A videointelligence.googleapis.com\322A.https://www.googleapis.com/auth/cloud-platform" - ), - serialized_start=11099, - serialized_end=11400, - methods=[ - _descriptor.MethodDescriptor( - name="StreamingAnnotateVideo", - full_name="google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService.StreamingAnnotateVideo", - index=0, - containing_service=None, - input_type=_STREAMINGANNOTATEVIDEOREQUEST, - output_type=_STREAMINGANNOTATEVIDEORESPONSE, - serialized_options=None, - ) - ], -) -_sym_db.RegisterServiceDescriptor(_STREAMINGVIDEOINTELLIGENCESERVICE) - -DESCRIPTOR.services_by_name[ - "StreamingVideoIntelligenceService" -] = _STREAMINGVIDEOINTELLIGENCESERVICE - -# @@protoc_insertion_point(module_scope) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2_grpc.py deleted file mode 100644 index 4e25eb647900..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/proto/video_intelligence_pb2_grpc.py +++ /dev/null @@ -1,102 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.videointelligence_v1p3beta1.proto import ( - video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class VideoIntelligenceServiceStub(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.AnnotateVideo = channel.unary_unary( - "/google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService/AnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class VideoIntelligenceServiceServicer(object): - """Service that implements Google Cloud Video Intelligence API. - """ - - def AnnotateVideo(self, request, context): - """Performs asynchronous video annotation. Progress and results can be - retrieved through the `google.longrunning.Operations` interface. - `Operation.metadata` contains `AnnotateVideoProgress` (progress). - `Operation.response` contains `AnnotateVideoResponse` (results). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_VideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "AnnotateVideo": grpc.unary_unary_rpc_method_handler( - servicer.AnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1p3beta1.VideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) - - -class StreamingVideoIntelligenceServiceStub(object): - """Service that implements streaming Google Cloud Video Intelligence API. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.StreamingAnnotateVideo = channel.stream_stream( - "/google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService/StreamingAnnotateVideo", - request_serializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.StreamingAnnotateVideoRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.StreamingAnnotateVideoResponse.FromString, - ) - - -class StreamingVideoIntelligenceServiceServicer(object): - """Service that implements streaming Google Cloud Video Intelligence API. - """ - - def StreamingAnnotateVideo(self, request_iterator, context): - """Performs video annotation with bidirectional streaming: emitting results - while sending video/audio bytes. - This method is only available via the gRPC API (not REST). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_StreamingVideoIntelligenceServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - "StreamingAnnotateVideo": grpc.stream_stream_rpc_method_handler( - servicer.StreamingAnnotateVideo, - request_deserializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.StreamingAnnotateVideoRequest.FromString, - response_serializer=google_dot_cloud_dot_videointelligence__v1p3beta1_dot_proto_dot_video__intelligence__pb2.StreamingAnnotateVideoResponse.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.videointelligence.v1p3beta1.StreamingVideoIntelligenceService", - rpc_method_handlers, - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/videointelligence/google/cloud/videointelligence_v1p3beta1/types.py b/videointelligence/google/cloud/videointelligence_v1p3beta1/types.py deleted file mode 100644 index a56aaf9c8aa6..000000000000 --- a/videointelligence/google/cloud/videointelligence_v1p3beta1/types.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import duration_pb2 -from google.protobuf import timestamp_pb2 -from google.rpc import status_pb2 - - -_shared_modules = [operations_pb2, any_pb2, duration_pb2, timestamp_pb2, status_pb2] - -_local_modules = [video_intelligence_pb2] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.videointelligence_v1p3beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/videointelligence/noxfile.py b/videointelligence/noxfile.py deleted file mode 100644 index 9a0e46e83078..000000000000 --- a/videointelligence/noxfile.py +++ /dev/null @@ -1,168 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", ".") - - # Additional set up for VPC SC. - env = { - "PROJECT_NUMBER": "570941833855", - "GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_IP": "10.1.1.1", - "GOOGLE_CLOUD_TESTS_VPCSC_INSIDE_IP": "55.55.0.0", - } - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, env=env, *session.posargs) - if system_test_folder_exists: - session.run( - "py.test", "--quiet", system_test_folder_path, env=env * session.posargs - ) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/videointelligence/pylint.config.py b/videointelligence/pylint.config.py deleted file mode 100644 index 5d64b9d2f256..000000000000 --- a/videointelligence/pylint.config.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -# Library configuration - -# library_additions = {} -# library_replacements = {} - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/videointelligence/setup.cfg b/videointelligence/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/videointelligence/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/videointelligence/setup.py b/videointelligence/setup.py deleted file mode 100644 index 956126c8a7da..000000000000 --- a/videointelligence/setup.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -import io -import os - -import setuptools - - -# Package metadata. - -name = "google-cloud-videointelligence" -description = "Google Cloud Video Intelligence API client library" -version = "1.12.1" -# Should be one of: -# 'Development Status :: 3 - Alpha' -# 'Development Status :: 4 - Beta' -# 'Development Status :: 5 - Production/Stable' -release_status = "Development Status :: 5 - Production/Stable" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] -extras = {} - - -# Setup boilerplate below this line. - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -# Only include packages under the 'google' namespace. Do not include tests, -# benchmarks, etc. -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -# Determine which namespaces are needed. -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - extras_require=extras, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/videointelligence/synth.metadata b/videointelligence/synth.metadata deleted file mode 100644 index 31ed0d4141dd..000000000000 --- a/videointelligence/synth.metadata +++ /dev/null @@ -1,79 +0,0 @@ -{ - "updateTime": "2019-11-06T13:41:12.139653Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.41.0", - "dockerImage": "googleapis/artman@sha256:75b38a3b073a7b243545f2332463096624c802bb1e56b8cb6f22ba1ecd325fa9" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "5691fcb7c1a926b52577aa1834f31d9c50efda54", - "internalRef": "278731899" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "videointelligence", - "apiVersion": "v1beta2", - "language": "python", - "generator": "gapic", - "config": "google/cloud/videointelligence/artman_videointelligence_v1beta2.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "videointelligence", - "apiVersion": "v1p1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/videointelligence/artman_videointelligence_v1p1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "videointelligence", - "apiVersion": "v1p2beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/videointelligence/artman_videointelligence_v1p2beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "videointelligence", - "apiVersion": "v1p3beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/videointelligence/artman_videointelligence_v1p3beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "videointelligence", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/videointelligence/artman_videointelligence_v1.yaml" - } - } - ] -} \ No newline at end of file diff --git a/videointelligence/synth.py b/videointelligence/synth.py deleted file mode 100644 index 8cb0ac1d98cb..000000000000 --- a/videointelligence/synth.py +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1beta2", "v1p1beta1", "v1p2beta1", "v1p3beta1", "v1"] - - -# ---------------------------------------------------------------------------- -# Generate videointelligence GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library( - "videointelligence", - version, - artman_output_name=f"video-intelligence-{version}", - include_protos=True, - ) - - # TODO: stop excluding tests and nox.py (excluded as we lack system tests) - s.move( - library, - excludes=[ - "setup.py", - "nox*.py", - "README.rst", - "docs/index.rst", - f"tests/system/gapic/{version}/" - f"test_system_video_intelligence_service_{version}.py", - # f'tests/unit/gapic/{version}/' - # f'test_video_intelligence_service_client_{version}.py', - ], - ) - s.replace( - f"google/cloud/videointelligence_{version}/gapic/" - f"*video_intelligence_service_client.py", - "google-cloud-video-intelligence", - "google-cloud-videointelligence", - ) - -s.replace( - "tests/unit/gapic/**/test_video_intelligence_service_client_*.py", - "^(\s+)expected_request = video_intelligence_pb2.AnnotateVideoRequest\(\)", - "\g<1>expected_request = video_intelligence_pb2.AnnotateVideoRequest(\n" - "\g<1> input_uri=input_uri, features=features)", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library(unit_cov_level=97, cov_level=100) -s.move(templated_files, excludes="noxfile.py") - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/videointelligence/tests/system.py b/videointelligence/tests/system.py deleted file mode 100644 index a73e4edc1634..000000000000 --- a/videointelligence/tests/system.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. -"""System tests for VideoIntelligence API.""" - -import json -import os -import requests -import unittest - -from google.auth.transport import requests as goog_auth_requests -from google.cloud import videointelligence -from google.oauth2 import service_account - -CLOUD_PLATFORM_SCOPE = "https://www.googleapis.com/auth/cloud-platform" -CREDENTIALS_FILE = os.environ.get("GOOGLE_APPLICATION_CREDENTIALS") -OUTSIDE_BUCKET = os.environ.get("GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_BUCKET") -INSIDE_BUCKET = os.environ.get("GOOGLE_CLOUD_TESTS_VPCSC_INSIDE_PERIMETER_BUCKET") -IS_INSIDE_VPCSC = os.environ.get("GOOGLE_CLOUD_TESTS_IN_VPCSC") - - -def get_access_token(): - """Returns an access token. - - Generates access tokens using the provided service account key file. - """ - creds = service_account.Credentials.from_service_account_file( - CREDENTIALS_FILE, scopes=[CLOUD_PLATFORM_SCOPE] - ) - with requests.Session() as session: - creds.refresh(goog_auth_requests.Request(session=session)) - return creds.token - - -class VideoIntelligenceSystemTestBase(unittest.TestCase): - client = None - - -def setUpModule(): - VideoIntelligenceSystemTestBase.client = ( - videointelligence.VideoIntelligenceServiceClient() - ) - - -@unittest.skipUnless( - CREDENTIALS_FILE, "GOOGLE_APPLICATION_CREDENTIALS not set in environment." -) -class TestVideoIntelligenceClientVpcSc(VideoIntelligenceSystemTestBase): - # Tests to verify VideoIntelligence service requests blocked when trying to - # access resources outside of a secure perimeter. - def setUp(self): - VideoIntelligenceSystemTestBase.setUp(self) - # api-endpoint - self.url = "https://videointelligence.googleapis.com/v1/videos:annotate" - self.body = {"features": ["LABEL_DETECTION"], "location_id": "us-west1"} - - @unittest.skipUnless( - OUTSIDE_BUCKET, - "GOOGLE_CLOUD_TESTS_VPCSC_OUTSIDE_PERIMETER_BUCKET not set in environment.", - ) - @unittest.skipUnless( - IS_INSIDE_VPCSC, "GOOGLE_CLOUD_TESTS_IN_VPCSC not set in environment." - ) - def test_outside_perimeter_blocked(self): - headers = { - "Authorization": "Bearer " + get_access_token(), - "Content-Type": "application/json", - } - self.body["input_uri"] = "gs://{bucket}/cat.mp4".format(bucket=OUTSIDE_BUCKET) - r = requests.post(url=self.url, data=json.dumps(self.body), headers=headers) - resp = json.loads(r.text) - print(resp) - # Assert it returns permission denied from VPC SC - self.assertEqual(resp["error"]["code"], 403) - self.assertEqual(resp["error"]["status"], "PERMISSION_DENIED") - - @unittest.skipUnless( - INSIDE_BUCKET, - "GOOGLE_CLOUD_TESTS_VPCSC_INSIDE_PERIMETER_BUCKET not set in environment.", - ) - @unittest.skipUnless( - IS_INSIDE_VPCSC, "GOOGLE_CLOUD_TESTS_IN_VPCSC not set in environment." - ) - def test_inside_perimeter_allowed(self): - headers = { - "Authorization": "Bearer " + get_access_token(), - "Content-Type": "application/json", - } - self.body["input_uri"] = "gs://{bucket}/cat.mp4".format(bucket=INSIDE_BUCKET) - r = requests.post(url=self.url, data=json.dumps(self.body), headers=headers) - operation = json.loads(r.text) - print(operation) - - get_op_url = "https://videointelligence.googleapis.com/v1/" + operation["name"] - get_op = requests.get(url=get_op_url, headers=headers) - get_op_resp = json.loads(get_op.text) - print(get_op_resp) - # Assert that we do not get an error. - self.assertEqual(get_op_resp["name"], operation["name"]) diff --git a/videointelligence/tests/unit/gapic/v1/test_video_intelligence_service_client_v1.py b/videointelligence/tests/unit/gapic/v1/test_video_intelligence_service_client_v1.py deleted file mode 100644 index fca6c1e165bd..000000000000 --- a/videointelligence/tests/unit/gapic/v1/test_video_intelligence_service_client_v1.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import videointelligence_v1 -from google.cloud.videointelligence_v1 import enums -from google.cloud.videointelligence_v1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(object): - def test_annotate_video(self): - # Setup Expected Response - expected_response = {} - expected_response = video_intelligence_pb2.AnnotateVideoResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_annotate_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_annotate_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_annotate_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - exception = response.exception() - assert exception.errors[0] == error diff --git a/videointelligence/tests/unit/gapic/v1beta2/test_video_intelligence_service_client_v1beta2.py b/videointelligence/tests/unit/gapic/v1beta2/test_video_intelligence_service_client_v1beta2.py deleted file mode 100644 index df1c2d2a7785..000000000000 --- a/videointelligence/tests/unit/gapic/v1beta2/test_video_intelligence_service_client_v1beta2.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import videointelligence_v1beta2 -from google.cloud.videointelligence_v1beta2 import enums -from google.cloud.videointelligence_v1beta2.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(object): - def test_annotate_video(self): - # Setup Expected Response - expected_response = {} - expected_response = video_intelligence_pb2.AnnotateVideoResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_annotate_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1beta2.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_annotate_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_annotate_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1beta2.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - exception = response.exception() - assert exception.errors[0] == error diff --git a/videointelligence/tests/unit/gapic/v1p1beta1/test_video_intelligence_service_client_v1p1beta1.py b/videointelligence/tests/unit/gapic/v1p1beta1/test_video_intelligence_service_client_v1p1beta1.py deleted file mode 100644 index 5d7ee10784e8..000000000000 --- a/videointelligence/tests/unit/gapic/v1p1beta1/test_video_intelligence_service_client_v1p1beta1.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import videointelligence_v1p1beta1 -from google.cloud.videointelligence_v1p1beta1 import enums -from google.cloud.videointelligence_v1p1beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(object): - def test_annotate_video(self): - # Setup Expected Response - expected_response = {} - expected_response = video_intelligence_pb2.AnnotateVideoResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_annotate_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_annotate_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_annotate_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - exception = response.exception() - assert exception.errors[0] == error diff --git a/videointelligence/tests/unit/gapic/v1p2beta1/test_video_intelligence_service_client_v1p2beta1.py b/videointelligence/tests/unit/gapic/v1p2beta1/test_video_intelligence_service_client_v1p2beta1.py deleted file mode 100644 index 5bc061fbd2e7..000000000000 --- a/videointelligence/tests/unit/gapic/v1p2beta1/test_video_intelligence_service_client_v1p2beta1.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import videointelligence_v1p2beta1 -from google.cloud.videointelligence_v1p2beta1 import enums -from google.cloud.videointelligence_v1p2beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(object): - def test_annotate_video(self): - # Setup Expected Response - expected_response = {} - expected_response = video_intelligence_pb2.AnnotateVideoResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_annotate_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_annotate_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_annotate_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - exception = response.exception() - assert exception.errors[0] == error diff --git a/videointelligence/tests/unit/gapic/v1p3beta1/test_streaming_video_intelligence_service_client_v1p3beta1.py b/videointelligence/tests/unit/gapic/v1p3beta1/test_streaming_video_intelligence_service_client_v1p3beta1.py deleted file mode 100644 index 0bc5741c22d5..000000000000 --- a/videointelligence/tests/unit/gapic/v1p3beta1/test_streaming_video_intelligence_service_client_v1p3beta1.py +++ /dev/null @@ -1,115 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import videointelligence_v1p3beta1 -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def stream_stream( - self, method, request_serializer=None, response_deserializer=None - ): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestStreamingVideoIntelligenceServiceClient(object): - def test_streaming_annotate_video(self): - # Setup Expected Response - annotation_results_uri = "annotationResultsUri-238075757" - expected_response = {"annotation_results_uri": annotation_results_uri} - expected_response = video_intelligence_pb2.StreamingAnnotateVideoResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[iter([expected_response])]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = ( - videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() - ) - - # Setup Request - request = {} - request = video_intelligence_pb2.StreamingAnnotateVideoRequest(**request) - requests = [request] - - response = client.streaming_annotate_video(requests) - resources = list(response) - assert len(resources) == 1 - assert expected_response == resources[0] - - assert len(channel.requests) == 1 - actual_requests = channel.requests[0][1] - assert len(actual_requests) == 1 - actual_request = list(actual_requests)[0] - assert request == actual_request - - def test_streaming_annotate_video_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = ( - videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() - ) - - # Setup request - request = {} - - request = video_intelligence_pb2.StreamingAnnotateVideoRequest(**request) - requests = [request] - - with pytest.raises(CustomException): - client.streaming_annotate_video(requests) diff --git a/videointelligence/tests/unit/gapic/v1p3beta1/test_video_intelligence_service_client_v1p3beta1.py b/videointelligence/tests/unit/gapic/v1p3beta1/test_video_intelligence_service_client_v1p3beta1.py deleted file mode 100644 index 5fac526d8678..000000000000 --- a/videointelligence/tests/unit/gapic/v1p3beta1/test_video_intelligence_service_client_v1p3beta1.py +++ /dev/null @@ -1,123 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2019 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import videointelligence_v1p3beta1 -from google.cloud.videointelligence_v1p3beta1 import enums -from google.cloud.videointelligence_v1p3beta1.proto import video_intelligence_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestVideoIntelligenceServiceClient(object): - def test_annotate_video(self): - # Setup Expected Response - expected_response = {} - expected_response = video_intelligence_pb2.AnnotateVideoResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_annotate_video", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, features=features - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_annotate_video_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_annotate_video_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() - - # Setup Request - input_uri = "gs://cloud-samples-data/video/cat.mp4" - features_element = enums.Feature.LABEL_DETECTION - features = [features_element] - - response = client.annotate_video(input_uri=input_uri, features=features) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/.coveragerc b/vision/.coveragerc deleted file mode 100644 index b178b094aa1d..000000000000 --- a/vision/.coveragerc +++ /dev/null @@ -1,19 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[run] -branch = True - -[report] -fail_under = 100 -show_missing = True -exclude_lines = - # Re-enable the standard pragma - pragma: NO COVER - # Ignore debug-only repr - def __repr__ - # Ignore abstract methods - raise NotImplementedError -omit = - */gapic/*.py - */proto/*.py - */core/*.py - */site-packages/*.py \ No newline at end of file diff --git a/vision/.flake8 b/vision/.flake8 deleted file mode 100644 index 0268ecc9c55c..000000000000 --- a/vision/.flake8 +++ /dev/null @@ -1,14 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[flake8] -ignore = E203, E266, E501, W503 -exclude = - # Exclude generated code. - **/proto/** - **/gapic/** - *_pb2.py - - # Standard linting exemptions. - __pycache__, - .git, - *.pyc, - conf.py diff --git a/vision/.repo-metadata.json b/vision/.repo-metadata.json deleted file mode 100644 index 2916236c51d2..000000000000 --- a/vision/.repo-metadata.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "name": "vision", - "name_pretty": "Cloud Vision", - "product_documentation": "https://cloud.google.com/vision/docs/", - "client_documentation": "https://googleapis.dev/python/vision/latest", - "issue_tracker": "https://issuetracker.google.com/issues?q=status:open%20componentid:187174", - "release_level": "beta", - "language": "python", - "repo": "googleapis/google-cloud-python", - "distribution_name": "google-cloud-vision", - "api_id": "vision.googleapis.com", - "requires_billing": false -} \ No newline at end of file diff --git a/vision/CHANGELOG.md b/vision/CHANGELOG.md deleted file mode 100644 index 08d6109c5596..000000000000 --- a/vision/CHANGELOG.md +++ /dev/null @@ -1,281 +0,0 @@ -# Changelog - -[PyPI History][1] - -[1]: https://pypi.org/project/google-cloud-vision/#history - -## 0.41.0 - -12-05-2019 14:49 PST - - -### New Features -- Add deprecation warning to resource name helper functions. ([#9866](https://github.com/googleapis/google-cloud-python/pull/9866)) - -### Documentation -- Add deprecation information to resource name helper function documentation. ([#9866](https://github.com/googleapis/google-cloud-python/pull/9866)) - -## 0.40.0 - -11-08-2019 09:30 PST - - -### Implementation Changes -- Add proto annotations (via synth). ([#9441](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9441)) -- Add RPC annotations, update docstrings (via synth). ([#9230](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9230)) - -### New Features -- Add celebrity recognition support to v1p4beta1 (via synth). ([#9613](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9613)) -- Add object annotation support to v1p4beta1 (via synth). ([#9613](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9613)) -- Add `purge_products` method to v1p4beta1 (via synth). ([#9613](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9613)) -- Add more product categories (via synth). ([#9224](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9224)) - -### Documentation -- Update docstring for `product_category`, change requests intersphinx url (via synth). ([#9413](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9413)) -- Fix intersphinx reference to requests. ([#9294](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9294)) -- Remove compatability badges from READMEs. ([#9035](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9035)) -- Update docstring to say at most 5 frames can be batch annotated (via synth). ([#9041](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9041)) - -### Internal / Testing Changes -- Flatten case of logo text in systest. ([#9159](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9159)) -- Docs: Remove CI for gh-pages, use googleapis.dev for `api_core` refs. ([#9085](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/9085)) - -## 0.39.0 - -08-12-2019 13:57 PDT - -### Implementation Changes -- Remove send/recv msg size limit (via synth). ([#8976](https://github.com/googleapis/google-cloud-python/pull/8976)) - -### New Features -- Add 'parent' argument to annotation requests; add 'ProductSearchClient.purge_products' method; add 'object_annotations' field to product search results (via synth). ([#8988](https://github.com/googleapis/google-cloud-python/pull/8988)) - -### Documentation -- Update intersphinx mapping for requests. ([#8805](https://github.com/googleapis/google-cloud-python/pull/8805)) - -## 0.38.1 - -07-24-2019 17:54 PDT - -### Dependencies -- Bump minimum version for google-api-core to 1.14.0. ([#8709](https://github.com/googleapis/google-cloud-python/pull/8709)) - -### Documentation -- Link to googleapis.dev documentation in READMEs. ([#8705](https://github.com/googleapis/google-cloud-python/pull/8705)) -- Add compatibility check badges to READMEs. ([#8288](https://github.com/googleapis/google-cloud-python/pull/8288)) - -## 0.38.0 - -07-09-2019 10:05 PDT - - -### Implementation Changes -- Allow kwargs to be passed to create_channel (via synth). ([#8411](https://github.com/googleapis/google-cloud-python/pull/8411)) - -### New Features -- Add 'client_options' support, update list method docstrings (via synth). ([#8529](https://github.com/googleapis/google-cloud-python/pull/8529)) - -### Internal / Testing Changes -- Pin black version (via synth). ([#8602](https://github.com/googleapis/google-cloud-python/pull/8602)) -- Add docs job to publish to googleapis.dev. ([#8464](https://github.com/googleapis/google-cloud-python/pull/8464)) -- All of the negative vision vpc sc tests should use the same file. ([#8439](https://github.com/googleapis/google-cloud-python/pull/8439)) -- In order to make sure access to the bucket is blocked by vpc sc, try to download any arbitrary file from the bucket. ([#8374](https://github.com/googleapis/google-cloud-python/pull/8374)) -- Add disclaimer to auto-generated template files (via synth). ([#8335](https://github.com/googleapis/google-cloud-python/pull/8335)) -- Add Vision API system tests to verify accessing a gcs bucket outside of a secure perimeter is blocked. ([#8276](https://github.com/googleapis/google-cloud-python/pull/8276)) -- Add Vision API Product Search tests to verify ProductSearch is blocked by VPC SC when trying to access a resource outside of a secure perimeter when run from within a secure perimeter. ([#8269](https://github.com/googleapis/google-cloud-python/pull/8269)) -- Add AsyncBatchAnnotateFiles system test ([#8260](https://github.com/googleapis/google-cloud-python/pull/8260)) -- Add ImportProductSets system test ([#8259](https://github.com/googleapis/google-cloud-python/pull/8259)) -- Suppress checking 'cov-fail-under' in nox default session (via synth). ([#8257](https://github.com/googleapis/google-cloud-python/pull/8257)) -- Declare encoding as utf-8 in pb2 files (via synth). ([#8371](https://github.com/googleapis/google-cloud-python/pull/8371)) - -## 0.37.0 - -05-30-2019 15:19 PDT - -### Implementation Changes -- Add routing header to method metadata (via synth). ([#7604](https://github.com/googleapis/google-cloud-python/pull/7604)) - -### New Features -- Add more categories to product search, update noxfile (via synth). ([#8170](https://github.com/googleapis/google-cloud-python/pull/8170)) -- Add batch annotation for images and files, reorder methods (via synth). ([#7845](https://github.com/googleapis/google-cloud-python/pull/7845)) -- Vision: Add proto files for v1p4beta1 - -### Internal / Testing Changes -- Change docstrings (via synth). ([#7983](https://github.com/googleapis/google-cloud-python/pull/7983)) -- Add system tests for Vision Product Search. Test product set resource… ([#7913](https://github.com/googleapis/google-cloud-python/pull/7913)) -- Update noxfile and docs configuration (via synth). ([#7839](https://github.com/googleapis/google-cloud-python/pull/7839)) -- Vision: Add nox session `docs`, reorder methods, modify samples in docstrings (via synth). ([#7787](https://github.com/googleapis/google-cloud-python/pull/7787)) -- Remove classifier for Python 3.4 for end-of-life. ([#7535](https://github.com/googleapis/google-cloud-python/pull/7535)) -- Copy lintified proto files (via synth). ([#7473](https://github.com/googleapis/google-cloud-python/pull/7473)) - -## 0.36.0 - -02-25-2019 15:02 PST - - -### Implementation Changes -- Remove unused message exports. ([#7280](https://github.com/googleapis/google-cloud-python/pull/7280)) -- Protoc-generated serialization update. ([#7100](https://github.com/googleapis/google-cloud-python/pull/7100)) -- GAPIC generation fixes: ([#7058](https://github.com/googleapis/google-cloud-python/pull/7058)) -- Pick up order-of-enum fix from GAPIC generator. ([#6881](https://github.com/googleapis/google-cloud-python/pull/6881)) - -### New Features -- Add vision v1p4beta1. ([#7438](https://github.com/googleapis/google-cloud-python/pull/7438)) - -### Documentation -- Updated client library documentation URLs. ([#7307](https://github.com/googleapis/google-cloud-python/pull/7307)) -- Update copyright headers. - -### Internal / Testing Changes -- Add clarifying comment to blacken nox target. ([#7408](https://github.com/googleapis/google-cloud-python/pull/7408)) -- Copy proto files alongside protoc versions -- Vision: get system logo tests healthy. ([#7245](https://github.com/googleapis/google-cloud-python/pull/7245)) -- Add protos as an artifact to library. ([#7205](https://github.com/googleapis/google-cloud-python/pull/7205)) - -## 0.35.2 - -12-17-2018 17:10 PST - - -### Implementation Changes -- Import `iam.policy` from `google.api_core`. ([#6741](https://github.com/googleapis/google-cloud-python/pull/6741)) - -### Documentation -- Document Python 2 deprecation ([#6910](https://github.com/googleapis/google-cloud-python/pull/6910)) - -### Internal / Testing Changes -- Blacken all gen'd libs ([#6792](https://github.com/googleapis/google-cloud-python/pull/6792)) -- Omit local deps ([#6701](https://github.com/googleapis/google-cloud-python/pull/6701)) -- Run black at end of synth.py ([#6698](https://github.com/googleapis/google-cloud-python/pull/6698)) -- Run Black on Generated libraries ([#6666](https://github.com/googleapis/google-cloud-python/pull/6666)) -- Add templates for flake8, coveragerc, noxfile, and black. ([#6642](https://github.com/googleapis/google-cloud-python/pull/6642)) - -## 0.35.1 - -11-21-2018 11:25 PST - -### Implementation Changes -- Add ProductSearchClient to vision.py ([#6635](https://github.com/googleapis/google-cloud-python/pull/6635)) - -### Internal / Testing Changes -- Merge fixes to GAPIC generator. ([#6632](https://github.com/googleapis/google-cloud-python/pull/6632)) - -## 0.35.0 - -11-13-2018 09:55 PST - - -### Implementation Changes -- Fix client_info bug, update docstrings via synth. ([#6437](https://github.com/googleapis/google-cloud-python/pull/6437)) - -### New Features -- Add 'product_search_client' to 'vision_v1'. ([#6361](https://github.com/googleapis/google-cloud-python/pull/6361)) - -### Dependencies -- Bump minimum 'api_core' version for all GAPIC libs to 1.4.1. ([#6391](https://github.com/googleapis/google-cloud-python/pull/6391)) - -### Documentation -- Fix GAX fossils. ([#6264](https://github.com/googleapis/google-cloud-python/pull/6264)) -- Normalize use of support level badges. ([#6159](https://github.com/googleapis/google-cloud-python/pull/6159)) -- Harmonize / DRY 'README.rst' / 'docs/index.rst'. ([#6003](https://github.com/googleapis/google-cloud-python/pull/6003)) - -### Internal / Testing Changes -- Use new Nox. ([#6175](https://github.com/googleapis/google-cloud-python/pull/6175)) - -## 0.34.0 - -### Implementation Changes - -- Clean up feature introspection. ([#5851](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5851)) - -### New Features - -- Regenerate to pick up new features in the underlying API. ([#5854](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5854)) - -## 0.33.0 - -### New Features -- Add v1p3beta1 endpoint to vision client library (#5638) - -## 0.32.0 - -### Implementation Changes -- Avoid overwriting '__module__' of messages from shared modules. (#5364) -- Regenerate underlying client library (#5467) - -### Internal / Testing Changes -- Add Test runs for Python 3.7 and remove 3.4 (#5295) -- Modify system tests to use prerelease versions of grpcio (#5304) - -## 0.31.1 - -### Packaging -- Update setuptools before packaging (#5265) - -## 0.31.0 - -- Vision v1p2beta1: PDF/TIFF OCR (#5127) -- Use `install_requires` for platform dependencies instead of `extras_require` (#4991) -- Add vision v1p2beta1 (#4998) -- Fix bad trove classifier -- Add max results to feature (#4817) - -## 0.30.1 - -### Dependencies - -- Update dependency range for api-core to include v1.0.0 releases (#4944) - -### Testing and internal changes - -- Install local dependencies when running lint (#4936) -- Re-enable lint for tests, remove usage of pylint (#4921) -- Normalize all setup.py files (#4909) -- Fix coveragerc to correctly omit generated files (#4843) - -## 0.29.0 - -### :warning: Breaking Changes - -- The HTTP/JSON based client that was deprecated in 0.25.0 is completely - removed. - -### Release Candidate - -- This is the (hopefully) final release candidate before declaring a stable - release. - -### Features - -- The `v1p1beta1` endpoint has been added. (#4493) - - This is a superset of `v1` and includes features that are still in beta - on the API side. You can opt in to this endpoint by importing it explicitly: - - ```python - from google.cloud import vision_v1p1beta1 - client = vision_v1p1beta1.ImageAnnotatorClient() - ``` - -PyPI: https://pypi.org/project/google-cloud-vision/0.29.0/ - - -## 0.28.0 - -### Notable Implementation Changes - -- Update and re-organize autogenerated code (#3952) - -### Documentation - -- Added link to "Python Development Environment Setup Guide" in - project README (#4187, h/t to @michaelawyu) - -### Dependencies - -- Upgrading to `google-cloud-core >= 0.28.0` and adding dependency - on `google-api-core` (#4221, #4280) -- Deferring to `google-api-core` for `grpcio` and - `googleapis-common-protos`dependencies (#4096, #4098) - -PyPI: https://pypi.org/project/google-cloud-vision/0.28.0/ diff --git a/vision/LICENSE b/vision/LICENSE deleted file mode 100644 index a8ee855de2aa..000000000000 --- a/vision/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - https://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/vision/MANIFEST.in b/vision/MANIFEST.in deleted file mode 100644 index 9cbf175afe6b..000000000000 --- a/vision/MANIFEST.in +++ /dev/null @@ -1,5 +0,0 @@ -include README.rst LICENSE -recursive-include google *.json *.proto -recursive-include tests * -global-exclude *.py[co] -global-exclude __pycache__ diff --git a/vision/README.rst b/vision/README.rst deleted file mode 100644 index 2b9672e62edf..000000000000 --- a/vision/README.rst +++ /dev/null @@ -1,112 +0,0 @@ -Python Client for Google Cloud Vision -===================================== - -|beta| |pypi| |versions| - -The `Google Cloud Vision`_ API enables developers to -understand the content of an image by encapsulating powerful machine -learning models in an easy to use REST API. It quickly classifies images -into thousands of categories (e.g., "sailboat", "lion", "Eiffel Tower"), -detects individual objects and faces within images, and finds and reads -printed words contained within images. You can build metadata on your -image catalog, moderate offensive content, or enable new marketing -scenarios through image sentiment analysis. Analyze images uploaded -in the request or integrate with your image storage on Google Cloud -Storage. - -- `Client Library Documentation`_ -- `Product Documentation`_ - -.. |beta| image:: https://img.shields.io/badge/support-beta-silver.svg - :target: https://github.com/googleapis/google-cloud-python/blob/master/README.rst#beta-support -.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-vision.svg - :target: https://pypi.org/project/google-cloud-vision/ -.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-vision.svg - :target: https://pypi.org/project/google-cloud-vision/ -.. _Vision: https://cloud.google.com/vision/ - -.. _Google Cloud Vision: https://cloud.google.com/vision/ -.. _Client Library Documentation: https://googleapis.dev/python/vision/latest -.. _Product Documentation: https://cloud.google.com/vision/reference/rest/ - - -Quick Start ------------ - -In order to use this library, you first need to go through the following steps: - -1. `Select or create a Cloud Platform project.`_ -2. `Enable billing for your project.`_ -3. `Enable the Google Cloud Vision API.`_ -4. `Setup Authentication.`_ - -.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project -.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project -.. _Enable the Google Cloud Vision API.: https://cloud.google.com/vision -.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html - -Installation -~~~~~~~~~~~~ - -Install this library in a `virtualenv`_ using pip. `virtualenv`_ is a tool to -create isolated Python environments. The basic problem it addresses is one of -dependencies and versions, and indirectly permissions. - -With `virtualenv`_, it's possible to install this library without needing system -install permissions, and without clashing with the installed system -dependencies. - -.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/ - - -Supported Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.5 - -Deprecated Python Versions -^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python == 2.7. Python 2.7 support will be removed on January 1, 2020. - - -Mac/Linux -^^^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - source /bin/activate - /bin/pip install google-cloud-vision - - -Windows -^^^^^^^ - -.. code-block:: console - - pip install virtualenv - virtualenv - \Scripts\activate - \Scripts\pip.exe install google-cloud-vision - - -Example Usage -~~~~~~~~~~~~~ - -.. code-block:: python - - from google.cloud import vision - - client = vision.ImageAnnotatorClient() - response = client.annotate_image({ - 'image': {'source': {'image_uri': 'gs://my-test-bucket/image.jpg'}}, - 'features': [{'type': vision.enums.Feature.Type.FACE_DETECTION}], - }) - -Next Steps -~~~~~~~~~~ - -- Read the `Client Library Documentation`_ for Google Cloud Vision API - API to see other available methods on the client. -- Read the `Product documentation`_ to learn - more about the product and see How-to Guides. diff --git a/vision/docs/README.rst b/vision/docs/README.rst deleted file mode 120000 index 89a0106941ff..000000000000 --- a/vision/docs/README.rst +++ /dev/null @@ -1 +0,0 @@ -../README.rst \ No newline at end of file diff --git a/vision/docs/_static/custom.css b/vision/docs/_static/custom.css deleted file mode 100644 index 0abaf229fce3..000000000000 --- a/vision/docs/_static/custom.css +++ /dev/null @@ -1,4 +0,0 @@ -div#python2-eol { - border-color: red; - border-width: medium; -} \ No newline at end of file diff --git a/vision/docs/_templates/layout.html b/vision/docs/_templates/layout.html deleted file mode 100644 index 228529efe2d2..000000000000 --- a/vision/docs/_templates/layout.html +++ /dev/null @@ -1,50 +0,0 @@ - -{% extends "!layout.html" %} -{%- block content %} -{%- if theme_fixed_sidebar|lower == 'true' %} -
- {{ sidebar() }} - {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} - - {%- block relbar_top %} - {%- if theme_show_relbar_top|tobool %} - - {%- endif %} - {% endblock %} - -
-
- On January 1, 2020 this library will no longer support Python 2 on the latest released version. - Previously released library versions will continue to be available. For more information please - visit Python 2 support on Google Cloud. -
- {% block body %} {% endblock %} -
- - {%- block relbar_bottom %} - {%- if theme_show_relbar_bottom|tobool %} - - {%- endif %} - {% endblock %} - - {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} -
-
-{%- else %} -{{ super() }} -{%- endif %} -{%- endblock %} diff --git a/vision/docs/changelog.md b/vision/docs/changelog.md deleted file mode 120000 index 235fc031a209..000000000000 --- a/vision/docs/changelog.md +++ /dev/null @@ -1 +0,0 @@ -../../vision/CHANGELOG.md \ No newline at end of file diff --git a/vision/docs/conf.py b/vision/docs/conf.py deleted file mode 100644 index 2fab64a5fc33..000000000000 --- a/vision/docs/conf.py +++ /dev/null @@ -1,363 +0,0 @@ -# -*- coding: utf-8 -*- -# -# google-cloud-vision documentation build configuration file -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os -import shlex - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -sys.path.insert(0, os.path.abspath("..")) - -__version__ = "0.1.0" - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -needs_sphinx = "1.6.3" - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [ - "sphinx.ext.autodoc", - "sphinx.ext.autosummary", - "sphinx.ext.intersphinx", - "sphinx.ext.coverage", - "sphinx.ext.napoleon", - "sphinx.ext.todo", - "sphinx.ext.viewcode", -] - -# autodoc/autosummary flags -autoclass_content = "both" -autodoc_default_flags = ["members"] -autosummary_generate = True - - -# Add any paths that contain templates here, relative to this directory. -templates_path = ["_templates"] - -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - -# The suffix(es) of source filenames. -# You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = [".rst", ".md"] - -# The encoding of source files. -# source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = "index" - -# General information about the project. -project = u"google-cloud-vision" -copyright = u"2017, Google" -author = u"Google APIs" - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The full version, including alpha/beta/rc tags. -release = __version__ -# The short X.Y version. -version = ".".join(release.split(".")[0:2]) - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -# -# This is also used if you do content translation via gettext catalogs. -# Usually you set "language" from the command line for these cases. -language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -# today = '' -# Else, today_fmt is used as the format for a strftime call. -# today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ["_build"] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -# default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -# add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -# add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -# show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = "sphinx" - -# A list of ignored prefixes for module index sorting. -# modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -# keep_warnings = False - -# If true, `todo` and `todoList` produce output, else they produce nothing. -todo_include_todos = True - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = "alabaster" - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -html_theme_options = { - "description": "Google Cloud Client Libraries for Python", - "github_user": "googleapis", - "github_repo": "google-cloud-python", - "github_banner": True, - "font_family": "'Roboto', Georgia, sans", - "head_font_family": "'Roboto', Georgia, serif", - "code_font_family": "'Roboto Mono', 'Consolas', monospace", -} - -# Add any paths that contain custom themes here, relative to this directory. -# html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -# html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -# html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -# html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -# html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ["_static"] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -# html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -# html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -# html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -# html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -# html_additional_pages = {} - -# If false, no module index is generated. -# html_domain_indices = True - -# If false, no index is generated. -# html_use_index = True - -# If true, the index is split into individual pages for each letter. -# html_split_index = False - -# If true, links to the reST sources are added to the pages. -# html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -# html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -# html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -# html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -# html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -# html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -# html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -# html_search_scorer = 'scorer.js' - -# Output file base name for HTML help builder. -htmlhelp_basename = "google-cloud-vision-doc" - -# -- Options for warnings ------------------------------------------------------ - - -suppress_warnings = [ - # Temporarily suppress this to avoid "more than one target found for - # cross-reference" warning, which are intractable for us to avoid while in - # a mono-repo. - # See https://github.com/sphinx-doc/sphinx/blob - # /2a65ffeef5c107c19084fabdd706cdff3f52d93c/sphinx/domains/python.py#L843 - "ref.python" -] - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { - # The paper size ('letterpaper' or 'a4paper'). - #'papersize': 'letterpaper', - # The font size ('10pt', '11pt' or '12pt'). - #'pointsize': '10pt', - # Additional stuff for the LaTeX preamble. - #'preamble': '', - # Latex figure (float) alignment - #'figure_align': 'htbp', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ( - master_doc, - "google-cloud-vision.tex", - u"google-cloud-vision Documentation", - author, - "manual", - ) -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -# latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -# latex_use_parts = False - -# If true, show page references after internal links. -# latex_show_pagerefs = False - -# If true, show URL addresses after external links. -# latex_show_urls = False - -# Documents to append as an appendix to all manuals. -# latex_appendices = [] - -# If false, no module index is generated. -# latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ( - master_doc, - "google-cloud-vision", - u"google-cloud-vision Documentation", - [author], - 1, - ) -] - -# If true, show URL addresses after external links. -# man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ( - master_doc, - "google-cloud-vision", - u"google-cloud-vision Documentation", - author, - "google-cloud-vision", - "GAPIC library for the {metadata.shortName} v1p4beta1 service", - "APIs", - ) -] - -# Documents to append as an appendix to all manuals. -# texinfo_appendices = [] - -# If false, no module index is generated. -# texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -# texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -# texinfo_no_detailmenu = False - - -# Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = { - "python": ("http://python.readthedocs.org/en/latest/", None), - "gax": ("https://gax-python.readthedocs.org/en/latest/", None), - "google-auth": ("https://google-auth.readthedocs.io/en/stable", None), - "google-gax": ("https://gax-python.readthedocs.io/en/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest", None), - "grpc": ("https://grpc.io/grpc/python/", None), - "requests": ("https://requests.kennethreitz.org/en/master/", None), - "fastavro": ("https://fastavro.readthedocs.io/en/stable/", None), - "pandas": ("https://pandas.pydata.org/pandas-docs/stable/", None), -} - - -# Napoleon settings -napoleon_google_docstring = True -napoleon_numpy_docstring = True -napoleon_include_private_with_doc = False -napoleon_include_special_with_doc = True -napoleon_use_admonition_for_examples = False -napoleon_use_admonition_for_notes = False -napoleon_use_admonition_for_references = False -napoleon_use_ivar = False -napoleon_use_param = True -napoleon_use_rtype = True diff --git a/vision/docs/gapic/v1/api.rst b/vision/docs/gapic/v1/api.rst deleted file mode 100644 index 85835a0fa34d..000000000000 --- a/vision/docs/gapic/v1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Vision API -=========================== - -.. automodule:: google.cloud.vision_v1 - :members: - :inherited-members: \ No newline at end of file diff --git a/vision/docs/gapic/v1/types.rst b/vision/docs/gapic/v1/types.rst deleted file mode 100644 index 9d8a9cce4bf2..000000000000 --- a/vision/docs/gapic/v1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Vision API Client -================================= - -.. automodule:: google.cloud.vision_v1.types - :members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p2beta1/api.rst b/vision/docs/gapic/v1p2beta1/api.rst deleted file mode 100644 index 1214abc971ff..000000000000 --- a/vision/docs/gapic/v1p2beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Google Cloud Vision API -================================== - -.. automodule:: google.cloud.vision_v1p2beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p2beta1/types.rst b/vision/docs/gapic/v1p2beta1/types.rst deleted file mode 100644 index 5099b68a3bc2..000000000000 --- a/vision/docs/gapic/v1p2beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Google Cloud Vision API Client -======================================== - -.. automodule:: google.cloud.vision_v1p2beta1.types - :members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p3beta1/api.rst b/vision/docs/gapic/v1p3beta1/api.rst deleted file mode 100644 index d04d9d99d949..000000000000 --- a/vision/docs/gapic/v1p3beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Vision API -=========================== - -.. automodule:: google.cloud.vision_v1p3beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p3beta1/types.rst b/vision/docs/gapic/v1p3beta1/types.rst deleted file mode 100644 index 3658d2d46ad7..000000000000 --- a/vision/docs/gapic/v1p3beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Vision API Client -================================= - -.. automodule:: google.cloud.vision_v1p3beta1.types - :members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p4beta1/api.rst b/vision/docs/gapic/v1p4beta1/api.rst deleted file mode 100644 index b04fc7eab60f..000000000000 --- a/vision/docs/gapic/v1p4beta1/api.rst +++ /dev/null @@ -1,6 +0,0 @@ -Client for Cloud Vision API -=========================== - -.. automodule:: google.cloud.vision_v1p4beta1 - :members: - :inherited-members: \ No newline at end of file diff --git a/vision/docs/gapic/v1p4beta1/types.rst b/vision/docs/gapic/v1p4beta1/types.rst deleted file mode 100644 index 43f20e9d297e..000000000000 --- a/vision/docs/gapic/v1p4beta1/types.rst +++ /dev/null @@ -1,5 +0,0 @@ -Types for Cloud Vision API Client -================================= - -.. automodule:: google.cloud.vision_v1p4beta1.types - :members: \ No newline at end of file diff --git a/vision/docs/index.rst b/vision/docs/index.rst deleted file mode 100644 index 3bc60512c87d..000000000000 --- a/vision/docs/index.rst +++ /dev/null @@ -1,126 +0,0 @@ -.. include:: README.rst - -Using the Library ------------------ - -Annotate an Image -~~~~~~~~~~~~~~~~~ - -You can call the :meth:`annotate_image` method directly: - -.. code-block:: python - - >>> from google.cloud import vision - >>> client = vision.ImageAnnotatorClient() - >>> response = client.annotate_image({ - ... 'image': {'source': {'image_uri': 'gs://my-test-bucket/image.jpg'}}, - ... 'features': [{'type': vision.enums.Feature.Type.FACE_DETECTION}], - ... }) - >>> len(response.annotations) - 2 - >>> for face in response.annotations[0].faces: - ... print(face.joy) - Likelihood.VERY_LIKELY - Likelihood.VERY_LIKELY - Likelihood.VERY_LIKELY - >>> for logo in response.annotations[0].logos: - ... print(logo.description) - 'google' - 'github' - - -Single-feature Shortcuts -~~~~~~~~~~~~~~~~~~~~~~~~ - -If you are only requesting a single feature, you may find it easier to ask -for it using our direct methods: - -.. code-block:: python - - >>> from google.cloud import vision - >>> client = vision.ImageAnnotatorClient() - >>> response = client.face_detection({ - ... 'source': {'image_uri': 'gs://my-test-bucket/image.jpg'}, - ... }) - >>> len(response.annotations) - 1 - >>> for face in response.annotations[0].faces: - ... print(face.joy) - Likelihood.VERY_LIKELY - Likelihood.VERY_LIKELY - Likelihood.VERY_LIKELY - - -No results found -~~~~~~~~~~~~~~~~ - -If no results for the detection performed can be extracted from the image, then -an empty list is returned. This behavior is similar with all detection types. - - -Example with :meth:`~google.cloud.vision.ImageAnnotatorClient.logo_detection`: - -.. code-block:: python - - >>> from google.cloud import vision - >>> client = vision.ImageAnnotatorClient() - >>> with open('./image.jpg', 'rb') as image_file: - ... content = image_file.read() - >>> response = client.logo_detection({ - ... 'content': content, - ... }) - >>> len(response.annotations) - 0 - -API Reference -------------- - -This package includes clients for multiple versions of the Vision -API. By default, you will get ``v1``, the latest stable version. - -.. toctree:: - :maxdepth: 2 - - gapic/v1/api - gapic/v1/types - - -A new beta release with additional features over the current stable version, -spelled ``v1p4beta1``, is provided to allow you to use these new features. -These are expected to move into the stable release soon; until then, the -usual beta admonishment (changes are possible, etc.) applies. - -.. toctree:: - :maxdepth: 2 - - gapic/v1p4beta1/api - gapic/v1p4beta1/types - -Previous beta releases ``v1p3beta1`` and ``v1p2beta1`` are provided as well. - -An API and type reference is provided for ``v1p3beta1``: - -.. toctree:: - :maxdepth: 2 - - gapic/v1p3beta1/api - gapic/v1p3beta1/types - - -An API and type reference is provided for ``v1p2beta1``: - -.. toctree:: - :maxdepth: 2 - - gapic/v1p2beta1/api - gapic/v1p2beta1/types - -Changelog ---------- - -For a list of all ``google-cloud-vision`` releases: - -.. toctree:: - :maxdepth: 2 - - changelog diff --git a/vision/google/__init__.py b/vision/google/__init__.py deleted file mode 100644 index dd3a9f485275..000000000000 --- a/vision/google/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/vision/google/cloud/__init__.py b/vision/google/cloud/__init__.py deleted file mode 100644 index 0e1bc5131ba6..000000000000 --- a/vision/google/cloud/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2016 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 -# -# http://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. - -try: - import pkg_resources - - pkg_resources.declare_namespace(__name__) -except ImportError: - import pkgutil - - __path__ = pkgutil.extend_path(__path__, __name__) diff --git a/vision/google/cloud/vision.py b/vision/google/cloud/vision.py deleted file mode 100644 index 99c0b460cecb..000000000000 --- a/vision/google/cloud/vision.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright 2018 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. - -from __future__ import absolute_import - -from google.cloud.vision_v1 import ImageAnnotatorClient -from google.cloud.vision_v1 import ProductSearchClient -from google.cloud.vision_v1 import enums -from google.cloud.vision_v1 import types - -__all__ = ("enums", "types", "ImageAnnotatorClient", "ProductSearchClient") diff --git a/vision/google/cloud/vision_helpers/__init__.py b/vision/google/cloud/vision_helpers/__init__.py deleted file mode 100644 index b89166476b71..000000000000 --- a/vision/google/cloud/vision_helpers/__init__.py +++ /dev/null @@ -1,83 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import -import io - -from google.api_core import protobuf_helpers as protobuf - - -class VisionHelpers(object): - """A set of convenience methods to make the Vision GAPIC easier to use. - - This class should be considered abstract; it is used as a superclass - in a multiple-inheritance construction alongside the applicable GAPIC. - See the :class:`~google.cloud.vision_v1.ImageAnnotatorClient`. - """ - - def annotate_image(self, request, retry=None, timeout=None): - """Run image detection and annotation for an image. - - Example: - >>> from google.cloud.vision_v1 import ImageAnnotatorClient - >>> client = ImageAnnotatorClient() - >>> request = { - ... 'image': { - ... 'source': {'image_uri': 'https://foo.com/image.jpg'}, - ... }, - ... } - >>> response = client.annotate_image(request) - - Args: - request (:class:`~.vision_v1.types.AnnotateImageRequest`) - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will not - be retried. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - - Returns: - :class:`~.vision_v1.types.AnnotateImageResponse` The API response. - """ - # If the image is a file handler, set the content. - image = protobuf.get(request, "image") - if hasattr(image, "read"): - img_bytes = image.read() - protobuf.set(request, "image", {}) - protobuf.set(request, "image.content", img_bytes) - image = protobuf.get(request, "image") - - # If a filename is provided, read the file. - filename = protobuf.get(image, "source.filename", default=None) - if filename: - with io.open(filename, "rb") as img_file: - protobuf.set(request, "image.content", img_file.read()) - protobuf.set(request, "image.source", None) - - # This method allows features not to be specified, and you get all - # of them. - protobuf.setdefault(request, "features", self._get_all_features()) - r = self.batch_annotate_images([request], retry=retry, timeout=timeout) - return r.responses[0] - - def _get_all_features(self): - """Return a list of all features. - - Returns: - list: A list of all available features. - """ - return [ - {"type": feature} for feature in self.enums.Feature.Type if feature != 0 - ] diff --git a/vision/google/cloud/vision_helpers/decorators.py b/vision/google/cloud/vision_helpers/decorators.py deleted file mode 100644 index 804a171c74f5..000000000000 --- a/vision/google/cloud/vision_helpers/decorators.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import - - -def add_single_feature_methods(cls): - """Custom decorator intended for :class:`~vision.helpers.VisionHelpers`. - - This metaclass adds a `{feature}` method for every feature - defined on the Feature enum. - """ - # Sanity check: This only makes sense if we are building the GAPIC - # subclass and have enums already attached. - if not hasattr(cls, "enums"): - return cls - - # Add each single-feature method to the class. - for feature in cls.enums.Feature.Type: - # Sanity check: Do not make a method for the falsy feature. - if feature.name == "TYPE_UNSPECIFIED": - continue - - # Assign the appropriate metadata to the function. - detect = _create_single_feature_method(feature) - - # Assign a qualified name to the function, and perform module - # replacement on the docstring. - detect.__qualname__ = "{cls}.{name}".format( - cls=cls.__name__, name=detect.__name__ - ) - detect.__doc__ = detect.__doc__.format(module=cls.__module__) - - # Place the function on the class being created. - setattr(cls, detect.__name__, detect) - - # Done; return the class. - return cls - - -def _create_single_feature_method(feature): - """Return a function that will detect a single feature. - - Args: - feature (enum): A specific feature defined as a member of - :class:`~enums.Feature.Type`. - - Returns: - function: A helper function to detect just that feature. - """ - # Define the function properties. - fx_name = feature.name.lower() - if "detection" in fx_name: - fx_doc = "Perform {0}.".format(fx_name.replace("_", " ")) - else: - fx_doc = "Return {desc} information.".format(desc=fx_name.replace("_", " ")) - - # Provide a complete docstring with argument and return value - # information. - fx_doc += """ - - Args: - image (:class:`~.{module}.types.Image`): The image to analyze. - max_results (int): - Number of results to return, does not apply for - TEXT_DETECTION, DOCUMENT_TEXT_DETECTION, or CROP_HINTS. - retry (int): Number of retries to do before giving up. - timeout (int): Number of seconds before timing out. - kwargs (dict): Additional properties to be set on the - :class:`~.{module}.types.AnnotateImageRequest`. - - Returns: - :class:`~.{module}.types.AnnotateImageResponse`: The API response. - """ - - # Get the actual feature value to send. - feature_value = {"type": feature} - - # Define the function to be returned. - def inner(self, image, max_results=None, retry=None, timeout=None, **kwargs): - """Return a single feature annotation for the given image. - - Intended for use with functools.partial, to create the particular - single-feature methods. - """ - copied_features = feature_value.copy() - if max_results is not None: - copied_features["max_results"] = max_results - request = dict(image=image, features=[copied_features], **kwargs) - response = self.annotate_image(request, retry=retry, timeout=timeout) - return response - - # Set the appropriate function metadata. - inner.__name__ = fx_name - inner.__doc__ = fx_doc - - # Return the final function. - return inner diff --git a/vision/google/cloud/vision_v1/__init__.py b/vision/google/cloud/vision_v1/__init__.py deleted file mode 100644 index 8c03349099c4..000000000000 --- a/vision/google/cloud/vision_v1/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.vision_helpers.decorators import add_single_feature_methods -from google.cloud.vision_helpers import VisionHelpers -import sys -import warnings - -from google.cloud.vision_v1 import types -from google.cloud.vision_v1.gapic import enums -from google.cloud.vision_v1.gapic import image_annotator_client as iac -from google.cloud.vision_v1.gapic import product_search_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient): - __doc__ = iac.ImageAnnotatorClient.__doc__ - enums = enums - - -class ProductSearchClient(product_search_client.ProductSearchClient): - __doc__ = product_search_client.ProductSearchClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "ImageAnnotatorClient", "ProductSearchClient") diff --git a/vision/google/cloud/vision_v1/gapic/__init__.py b/vision/google/cloud/vision_v1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1/gapic/enums.py b/vision/google/cloud/vision_v1/gapic/enums.py deleted file mode 100644 index 80aa4fcee5f4..000000000000 --- a/vision/google/cloud/vision_v1/gapic/enums.py +++ /dev/null @@ -1,255 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Likelihood(enum.IntEnum): - """ - A bucketized representation of likelihood, which is intended to give clients - highly stable results across model upgrades. - - Attributes: - UNKNOWN (int): Unknown likelihood. - VERY_UNLIKELY (int): It is very unlikely. - UNLIKELY (int): It is unlikely. - POSSIBLE (int): It is possible. - LIKELY (int): It is likely. - VERY_LIKELY (int): It is very likely. - """ - - UNKNOWN = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class BatchOperationMetadata(object): - class State(enum.IntEnum): - """ - Enumerates the possible states that the batch request can be in. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - PROCESSING (int): Request is actively being processed. - SUCCESSFUL (int): The request is done and at least one item has been successfully - processed. - FAILED (int): The request is done and no item has been successfully processed. - CANCELLED (int): The request is done after the longrunning.Operations.CancelOperation has - been called by the user. Any records that were processed before the - cancel command are output as specified in the request. - """ - - STATE_UNSPECIFIED = 0 - PROCESSING = 1 - SUCCESSFUL = 2 - FAILED = 3 - CANCELLED = 4 - - -class Block(object): - class BlockType(enum.IntEnum): - """ - Type of a block (text, image etc) as identified by OCR. - - Attributes: - UNKNOWN (int): Unknown block type. - TEXT (int): Regular text block. - TABLE (int): Table block. - PICTURE (int): Image block. - RULER (int): Horizontal/vertical line box. - BARCODE (int): Barcode block. - """ - - UNKNOWN = 0 - TEXT = 1 - TABLE = 2 - PICTURE = 3 - RULER = 4 - BARCODE = 5 - - -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. - - Attributes: - UNKNOWN_LANDMARK (int): Unknown face landmark detected. Should not be filled. - LEFT_EYE (int): Left eye. - RIGHT_EYE (int): Right eye. - LEFT_OF_LEFT_EYEBROW (int): Left of left eyebrow. - RIGHT_OF_LEFT_EYEBROW (int): Right of left eyebrow. - LEFT_OF_RIGHT_EYEBROW (int): Left of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW (int): Right of right eyebrow. - MIDPOINT_BETWEEN_EYES (int): Midpoint between eyes. - NOSE_TIP (int): Nose tip. - UPPER_LIP (int): Upper lip. - LOWER_LIP (int): Lower lip. - MOUTH_LEFT (int): Mouth left. - MOUTH_RIGHT (int): Mouth right. - MOUTH_CENTER (int): Mouth center. - NOSE_BOTTOM_RIGHT (int): Nose, bottom right. - NOSE_BOTTOM_LEFT (int): Nose, bottom left. - NOSE_BOTTOM_CENTER (int): Nose, bottom center. - LEFT_EYE_TOP_BOUNDARY (int): Left eye, top boundary. - LEFT_EYE_RIGHT_CORNER (int): Left eye, right corner. - LEFT_EYE_BOTTOM_BOUNDARY (int): Left eye, bottom boundary. - LEFT_EYE_LEFT_CORNER (int): Left eye, left corner. - RIGHT_EYE_TOP_BOUNDARY (int): Right eye, top boundary. - RIGHT_EYE_RIGHT_CORNER (int): Right eye, right corner. - RIGHT_EYE_BOTTOM_BOUNDARY (int): Right eye, bottom boundary. - RIGHT_EYE_LEFT_CORNER (int): Right eye, left corner. - LEFT_EYEBROW_UPPER_MIDPOINT (int): Left eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT (int): Right eyebrow, upper midpoint. - LEFT_EAR_TRAGION (int): Left ear tragion. - RIGHT_EAR_TRAGION (int): Right ear tragion. - LEFT_EYE_PUPIL (int): Left eye pupil. - RIGHT_EYE_PUPIL (int): Right eye pupil. - FOREHEAD_GLABELLA (int): Forehead glabella. - CHIN_GNATHION (int): Chin gnathion. - CHIN_LEFT_GONION (int): Chin left gonion. - CHIN_RIGHT_GONION (int): Chin right gonion. - """ - - UNKNOWN_LANDMARK = 0 - LEFT_EYE = 1 - RIGHT_EYE = 2 - LEFT_OF_LEFT_EYEBROW = 3 - RIGHT_OF_LEFT_EYEBROW = 4 - LEFT_OF_RIGHT_EYEBROW = 5 - RIGHT_OF_RIGHT_EYEBROW = 6 - MIDPOINT_BETWEEN_EYES = 7 - NOSE_TIP = 8 - UPPER_LIP = 9 - LOWER_LIP = 10 - MOUTH_LEFT = 11 - MOUTH_RIGHT = 12 - MOUTH_CENTER = 13 - NOSE_BOTTOM_RIGHT = 14 - NOSE_BOTTOM_LEFT = 15 - NOSE_BOTTOM_CENTER = 16 - LEFT_EYE_TOP_BOUNDARY = 17 - LEFT_EYE_RIGHT_CORNER = 18 - LEFT_EYE_BOTTOM_BOUNDARY = 19 - LEFT_EYE_LEFT_CORNER = 20 - RIGHT_EYE_TOP_BOUNDARY = 21 - RIGHT_EYE_RIGHT_CORNER = 22 - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - RIGHT_EYE_LEFT_CORNER = 24 - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - LEFT_EAR_TRAGION = 27 - RIGHT_EAR_TRAGION = 28 - LEFT_EYE_PUPIL = 29 - RIGHT_EYE_PUPIL = 30 - FOREHEAD_GLABELLA = 31 - CHIN_GNATHION = 32 - CHIN_LEFT_GONION = 33 - 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): - """ - Batch operation states. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - CREATED (int): Request is received. - RUNNING (int): Request is actively being processed. - DONE (int): The batch processing is done. - CANCELLED (int): The batch processing was cancelled. - """ - - STATE_UNSPECIFIED = 0 - CREATED = 1 - 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 diff --git a/vision/google/cloud/vision_v1/gapic/image_annotator_client.py b/vision/google/cloud/vision_v1/gapic/image_annotator_client.py deleted file mode 100644 index 1dcf9e8c3dda..000000000000 --- a/vision/google/cloud/vision_v1/gapic/image_annotator_client.py +++ /dev/null @@ -1,594 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1 ImageAnnotator API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import grpc - -from google.cloud.vision_v1.gapic import enums -from google.cloud.vision_v1.gapic import image_annotator_client_config -from google.cloud.vision_v1.gapic.transports import image_annotator_grpc_transport -from google.cloud.vision_v1.proto import image_annotator_pb2 -from google.cloud.vision_v1.proto import image_annotator_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ImageAnnotatorClient(object): - """ - 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. - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1.ImageAnnotator" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ImageAnnotatorClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ImageAnnotatorGrpcTransport, - Callable[[~.Credentials, type], ~.ImageAnnotatorGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = image_annotator_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=image_annotator_grpc_transport.ImageAnnotatorGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = image_annotator_grpc_transport.ImageAnnotatorGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_annotate_images( - self, - requests, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Run image detection and annotation for a batch of images. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_images(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateImageRequest]]): Required. 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` - parent (str): Optional. Target project and location to make a call. - - Format: ``projects/{project-id}/locations/{location-id}``. - - If no parent is specified, a region will be chosen automatically. - - Supported location-ids: ``us``: USA country only, ``asia``: East asia - areas, like Japan, Taiwan, ``eu``: The European Union. - - Example: ``projects/project-A/locations/eu``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.BatchAnnotateImagesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_images, - default_retry=self._method_configs["BatchAnnotateImages"].retry, - default_timeout=self._method_configs["BatchAnnotateImages"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_annotate_files( - self, - requests, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_files(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateFileRequest]]): Required. The list of file annotation requests. Right now we support only one - AnnotateFileRequest in BatchAnnotateFilesRequest. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.AnnotateFileRequest` - parent (str): Optional. Target project and location to make a call. - - Format: ``projects/{project-id}/locations/{location-id}``. - - If no parent is specified, a region will be chosen automatically. - - Supported location-ids: ``us``: USA country only, ``asia``: East asia - areas, like Japan, Taiwan, ``eu``: The European Union. - - Example: ``projects/project-A/locations/eu``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.BatchAnnotateFilesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_files, - default_retry=self._method_configs["BatchAnnotateFiles"].retry, - default_timeout=self._method_configs["BatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateFilesRequest( - requests=requests, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def async_batch_annotate_images( - self, - requests, - output_config, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.async_batch_annotate_images(requests, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1.types.AnnotateImageRequest]]): Required. 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` - output_config (Union[dict, ~google.cloud.vision_v1.types.OutputConfig]): Required. The desired output location and metadata (e.g. format). - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.OutputConfig` - parent (str): Optional. Target project and location to make a call. - - Format: ``projects/{project-id}/locations/{location-id}``. - - If no parent is specified, a region will be chosen automatically. - - Supported location-ids: ``us``: USA country only, ``asia``: East asia - areas, like Japan, Taiwan, ``eu``: The European Union. - - Example: ``projects/project-A/locations/eu``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_images, - default_retry=self._method_configs["AsyncBatchAnnotateImages"].retry, - default_timeout=self._method_configs[ - "AsyncBatchAnnotateImages" - ].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateImagesRequest( - requests=requests, output_config=output_config, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["async_batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateImagesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) - - def async_batch_annotate_files( - self, - requests, - parent=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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). - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.async_batch_annotate_files(requests) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1.types.AsyncAnnotateFileRequest]]): Required. 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` - parent (str): Optional. Target project and location to make a call. - - Format: ``projects/{project-id}/locations/{location-id}``. - - If no parent is specified, a region will be chosen automatically. - - Supported location-ids: ``us``: USA country only, ``asia``: East asia - areas, like Japan, Taiwan, ``eu``: The European Union. - - Example: ``projects/project-A/locations/eu``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_files, - default_retry=self._method_configs["AsyncBatchAnnotateFiles"].retry, - default_timeout=self._method_configs["AsyncBatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest( - requests=requests, parent=parent - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["async_batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateFilesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py b/vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py deleted file mode 100644 index f533bb7187f6..000000000000 --- a/vision/google/cloud/vision_v1/gapic/image_annotator_client_config.py +++ /dev/null @@ -1,43 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1.ImageAnnotator": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "BatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1/gapic/product_search_client.py b/vision/google/cloud/vision_v1/gapic/product_search_client.py deleted file mode 100644 index eb21f25a2cf9..000000000000 --- a/vision/google/cloud/vision_v1/gapic/product_search_client.py +++ /dev/null @@ -1,2026 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1 ProductSearch API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.vision_v1.gapic import enums -from google.cloud.vision_v1.gapic import product_search_client_config -from google.cloud.vision_v1.gapic.transports import product_search_grpc_transport -from google.cloud.vision_v1.proto import image_annotator_pb2 -from google.cloud.vision_v1.proto import image_annotator_pb2_grpc -from google.cloud.vision_v1.proto import product_search_service_pb2 -from google.cloud.vision_v1.proto import product_search_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ProductSearchClient(object): - """ - 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`` 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`` resources, named - ``projects/*/locations/*/products/*`` - - - Each ``Product`` has a collection of ``ReferenceImage`` resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1.ProductSearch" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ProductSearchClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - @classmethod - def product_path(cls, project, location, product): - """Return a fully-qualified product string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}", - project=project, - location=location, - product=product, - ) - - @classmethod - def product_set_path(cls, project, location, product_set): - """Return a fully-qualified product_set string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/productSets/{product_set}", - project=project, - location=location, - product_set=product_set, - ) - - @classmethod - def reference_image_path(cls, project, location, product, reference_image): - """Return a fully-qualified reference_image string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}", - project=project, - location=location, - product=product, - reference_image=reference_image, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ProductSearchGrpcTransport, - Callable[[~.Credentials, type], ~.ProductSearchGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = product_search_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=product_search_grpc_transport.ProductSearchGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = product_search_grpc_transport.ProductSearchGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_product_set( - self, - parent, - product_set, - product_set_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> response = client.create_product_set(parent, product_set) - - Args: - parent (str): Required. The project in which the ProductSet should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): Required. The ProductSet to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ProductSet` - product_set_id (str): A user-supplied resource id for this ProductSet. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product_set, - default_retry=self._method_configs["CreateProductSet"].retry, - default_timeout=self._method_configs["CreateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_product_sets( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_product_sets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_product_sets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The project from which ProductSets should be listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1.types.ProductSet` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_product_sets, - default_retry=self._method_configs["ListProductSets"].retry, - default_timeout=self._method_configs["ListProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductSetsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_product_sets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="product_sets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> response = client.get_product_set(name) - - Args: - name (str): Required. Resource name of the ProductSet to get. - - Format is: - ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product_set, - default_retry=self._method_configs["GetProductSet"].retry, - default_timeout=self._method_configs["GetProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product_set( - self, - product_set, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> response = client.update_product_set(product_set) - - Args: - product_set (Union[dict, ~google.cloud.vision_v1.types.ProductSet]): Required. The ProductSet resource which replaces the one on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ProductSet` - update_mask (Union[dict, ~google.cloud.vision_v1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask path - is ``display_name``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product_set, - default_retry=self._method_configs["UpdateProductSet"].retry, - default_timeout=self._method_configs["UpdateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product_set.name", product_set.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> client.delete_product_set(name) - - Args: - name (str): Required. Resource name of the ProductSet to delete. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product_set, - default_retry=self._method_configs["DeleteProductSet"].retry, - default_timeout=self._method_configs["DeleteProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_product( - self, - parent, - product, - product_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> response = client.create_product(parent, product) - - Args: - parent (str): Required. The project in which the Product should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product (Union[dict, ~google.cloud.vision_v1.types.Product]): Required. The product to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.Product` - product_id (str): A user-supplied resource id for this Product. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product, - default_retry=self._method_configs["CreateProduct"].retry, - default_timeout=self._method_configs["CreateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The project OR ProductSet from which Products should be - listed. - - Format: ``projects/PROJECT_ID/locations/LOC_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products, - default_retry=self._method_configs["ListProducts"].retry, - default_timeout=self._method_configs["ListProducts"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> response = client.get_product(name) - - Args: - name (str): Required. Resource name of the Product to get. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product, - default_retry=self._method_configs["GetProduct"].retry, - default_timeout=self._method_configs["GetProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product( - self, - product, - update_mask=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> response = client.update_product(product) - - Args: - product (Union[dict, ~google.cloud.vision_v1.types.Product]): Required. The Product resource which replaces the one on the server. - product.name is immutable. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.Product` - update_mask (Union[dict, ~google.cloud.vision_v1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name``, and ``description``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product, - default_retry=self._method_configs["UpdateProduct"].retry, - default_timeout=self._method_configs["UpdateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product.name", product.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> client.delete_product(name) - - Args: - name (str): Required. Resource name of product to delete. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product, - default_retry=self._method_configs["DeleteProduct"].retry, - default_timeout=self._method_configs["DeleteProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_reference_image( - self, - parent, - reference_image, - reference_image_id=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # TODO: Initialize `reference_image`: - >>> reference_image = {} - >>> - >>> response = client.create_reference_image(parent, reference_image) - - Args: - parent (str): Required. Resource name of the product in which to create the reference - image. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image (Union[dict, ~google.cloud.vision_v1.types.ReferenceImage]): Required. The reference image to create. - If an image ID is specified, it is ignored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ReferenceImage` - reference_image_id (str): A user-supplied resource id for the ReferenceImage to be added. If set, - the server will attempt to use this value as the resource id. If it is - already in use, an error is returned with code ALREADY\_EXISTS. Must be - at most 128 characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "create_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_reference_image, - default_retry=self._method_configs["CreateReferenceImage"].retry, - default_timeout=self._method_configs["CreateReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> client.delete_reference_image(name) - - Args: - name (str): Required. The resource name of the reference image to delete. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_reference_image, - default_retry=self._method_configs["DeleteReferenceImage"].retry, - default_timeout=self._method_configs["DeleteReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_reference_images( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_reference_images(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_reference_images(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Resource name of the product containing the reference images. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1.types.ReferenceImage` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_reference_images" not in self._inner_api_calls: - self._inner_api_calls[ - "list_reference_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_reference_images, - default_retry=self._method_configs["ListReferenceImages"].retry, - default_timeout=self._method_configs["ListReferenceImages"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_reference_images"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="reference_images", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> response = client.get_reference_image(name) - - Args: - name (str): Required. The resource name of the ReferenceImage to get. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "get_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_reference_image, - default_retry=self._method_configs["GetReferenceImage"].retry, - default_timeout=self._method_configs["GetReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def add_product_to_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> product = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> client.add_product_to_product_set(name, product) - - Args: - name (str): Required. The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): Required. The resource name for the Product to be added to this - ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "add_product_to_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "add_product_to_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.add_product_to_product_set, - default_retry=self._method_configs["AddProductToProductSet"].retry, - default_timeout=self._method_configs["AddProductToProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["add_product_to_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def remove_product_from_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Removes a Product from the specified ProductSet. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> product = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> client.remove_product_from_product_set(name, product) - - Args: - name (str): Required. The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): Required. The resource name for the Product to be removed from this - ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "remove_product_from_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "remove_product_from_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.remove_product_from_product_set, - default_retry=self._method_configs["RemoveProductFromProductSet"].retry, - default_timeout=self._method_configs[ - "RemoveProductFromProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["remove_product_from_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products_in_product_set( - self, - name, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products_in_product_set(name): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products_in_product_set(name).pages: - ... for element in page: - ... # process element - ... pass - - Args: - name (str): Required. The ProductSet resource for which to retrieve Products. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products_in_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products_in_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products_in_product_set, - default_retry=self._method_configs["ListProductsInProductSet"].retry, - default_timeout=self._method_configs[ - "ListProductsInProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products_in_product_set"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def import_product_sets( - self, - parent, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Asynchronous API that imports a list of reference images to specified - product sets based on a list of image information. - - The ``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``. - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_product_sets(parent, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The project in which the ProductSets should be imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - input_config (Union[dict, ~google.cloud.vision_v1.types.ImportProductSetsInputConfig]): Required. The input content for the list of requests. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ImportProductSetsInputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "import_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_product_sets, - default_retry=self._method_configs["ImportProductSets"].retry, - default_timeout=self._method_configs["ImportProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_product_sets"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - product_search_service_pb2.ImportProductSetsResponse, - metadata_type=product_search_service_pb2.BatchOperationMetadata, - ) - - def purge_products( - self, - parent, - product_set_purge_config=None, - delete_orphan_products=None, - force=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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`` API can be used to keep track of - the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - - Example: - >>> from google.cloud import vision_v1 - >>> - >>> client = vision_v1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> response = client.purge_products(parent) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The project and location in which the Products should be - deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set_purge_config (Union[dict, ~google.cloud.vision_v1.types.ProductSetPurgeConfig]): Specify which ProductSet contains the Products to be deleted. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1.types.ProductSetPurgeConfig` - delete_orphan_products (bool): If delete\_orphan\_products is true, all Products that are not in any - ProductSet will be deleted. - force (bool): The default value is false. Override this value to true to actually perform - the purge. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "purge_products" not in self._inner_api_calls: - self._inner_api_calls[ - "purge_products" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.purge_products, - default_retry=self._method_configs["PurgeProducts"].retry, - default_timeout=self._method_configs["PurgeProducts"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - product_set_purge_config=product_set_purge_config, - delete_orphan_products=delete_orphan_products, - ) - - request = product_search_service_pb2.PurgeProductsRequest( - parent=parent, - product_set_purge_config=product_set_purge_config, - delete_orphan_products=delete_orphan_products, - force=force, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["purge_products"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - empty_pb2.Empty, - metadata_type=product_search_service_pb2.BatchOperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1/gapic/product_search_client_config.py b/vision/google/cloud/vision_v1/gapic/product_search_client_config.py deleted file mode 100644 index 8753ca190b14..000000000000 --- a/vision/google/cloud/vision_v1/gapic/product_search_client_config.py +++ /dev/null @@ -1,118 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1.ProductSearch": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProducts": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "DeleteProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListReferenceImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AddProductToProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "RemoveProductFromProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListProductsInProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ImportProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "PurgeProducts": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1/gapic/transports/__init__.py b/vision/google/cloud/vision_v1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py b/vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py deleted file mode 100644 index 5c6f0de4ce5a..000000000000 --- a/vision/google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py +++ /dev/null @@ -1,191 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1.proto import image_annotator_pb2_grpc - - -class ImageAnnotatorGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1 ImageAnnotator API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "image_annotator_stub": image_annotator_pb2_grpc.ImageAnnotatorStub(channel) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`. - - Run image detection and annotation for a batch of images. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateImages - - @property - def batch_annotate_files(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_files`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateFiles - - @property - def async_batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.async_batch_annotate_images`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateImages - - @property - def async_batch_annotate_files(self): - """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 - 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). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateFiles diff --git a/vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py b/vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py deleted file mode 100644 index 61324c3c82c7..000000000000 --- a/vision/google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py +++ /dev/null @@ -1,510 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1.proto import product_search_service_pb2_grpc - - -class ProductSearchGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1 ProductSearch API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "product_search_stub": product_search_service_pb2_grpc.ProductSearchStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`. - - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProductSet - - @property - def list_product_sets(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`. - - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductSets - - @property - def get_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`. - - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProductSet - - @property - def update_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProductSet - - @property - def delete_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`. - - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProductSet - - @property - def create_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProduct - - @property - def list_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_products`. - - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProducts - - @property - def get_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product`. - - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProduct - - @property - def update_product(self): - """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. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProduct - - @property - def delete_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProduct - - @property - def create_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_reference_image`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateReferenceImage - - @property - def delete_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteReferenceImage - - @property - def list_reference_images(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListReferenceImages - - @property - def get_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`. - - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetReferenceImage - - @property - def add_product_to_product_set(self): - """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. - - One Product can be added to at most 100 ProductSets. - - Possible errors: - - - Returns NOT\_FOUND if the Product or the ProductSet doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].AddProductToProductSet - - @property - def remove_product_from_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.remove_product_from_product_set`. - - Removes a Product from the specified ProductSet. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].RemoveProductFromProductSet - - @property - def list_products_in_product_set(self): - """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 - empty. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductsInProductSet - - @property - def import_product_sets(self): - """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. - - The ``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``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ImportProductSets - - @property - def purge_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.purge_products`. - - 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`` API can be used to keep track of - the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].PurgeProducts diff --git a/vision/google/cloud/vision_v1/proto/__init__.py b/vision/google/cloud/vision_v1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1/proto/geometry.proto b/vision/google/cloud/vision_v1/proto/geometry.proto deleted file mode 100644 index 881c8f84edee..000000000000 --- a/vision/google/cloud/vision_v1/proto/geometry.proto +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.vision.v1"; -option objc_class_prefix = "GCVN"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} - -// A 3D position in the image, used primarily for Face detection landmarks. -// A valid Position must have both x and y coordinates. -// The position coordinates are in the same scale as the original image. -message Position { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; - - // Z coordinate (or depth). - float z = 3; -} diff --git a/vision/google/cloud/vision_v1/proto/geometry_pb2.py b/vision/google/cloud/vision_v1/proto/geometry_pb2.py deleted file mode 100644 index e2b73d05803c..000000000000 --- a/vision/google/cloud/vision_v1/proto/geometry_pb2.py +++ /dev/null @@ -1,371 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1/proto/geometry.proto", - package="google.cloud.vision.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.vision.v1B\rGeometryProtoP\001Zfd (face detection) prefix. - BoundingPoly fd_bounding_poly = 2; - - // Detected face landmarks. - repeated Landmark landmarks = 3; - - // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - // of the face relative to the image vertical about the axis perpendicular to - // the face. Range [-180,180]. - float roll_angle = 4; - - // Yaw angle, which indicates the leftward/rightward angle that the face is - // pointing relative to the vertical plane perpendicular to the image. Range - // [-180,180]. - float pan_angle = 5; - - // Pitch angle, which indicates the upwards/downwards angle that the face is - // pointing relative to the image's horizontal plane. Range [-180,180]. - float tilt_angle = 6; - - // Detection confidence. Range [0, 1]. - float detection_confidence = 7; - - // Face landmarking confidence. Range [0, 1]. - float landmarking_confidence = 8; - - // Joy likelihood. - Likelihood joy_likelihood = 9; - - // Sorrow likelihood. - Likelihood sorrow_likelihood = 10; - - // Anger likelihood. - Likelihood anger_likelihood = 11; - - // Surprise likelihood. - Likelihood surprise_likelihood = 12; - - // Under-exposed likelihood. - Likelihood under_exposed_likelihood = 13; - - // Blurred likelihood. - Likelihood blurred_likelihood = 14; - - // Headwear likelihood. - Likelihood headwear_likelihood = 15; -} - -// Detected entity location information. -message LocationInfo { - // lat/long location coordinates. - google.type.LatLng lat_lng = 1; -} - -// A `Property` consists of a user-supplied name/value pair. -message Property { - // Name of the property. - string name = 1; - - // Value of the property. - string value = 2; - - // Value of numeric properties. - uint64 uint64_value = 3; -} - -// Set of detected entity features. -message EntityAnnotation { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string mid = 1; - - // The language code for the locale in which the entity textual - // `description` is expressed. - string locale = 2; - - // Entity textual description, expressed in its `locale` language. - string description = 3; - - // Overall score of the result. Range [0, 1]. - float score = 4; - - // **Deprecated. Use `score` instead.** - // The accuracy of the entity detection in an image. - // For example, for an image in which the "Eiffel Tower" entity is detected, - // this field represents the confidence that there is a tower in the query - // image. Range [0, 1]. - float confidence = 5 [deprecated = true]; - - // The relevancy of the ICA (Image Content Annotation) label to the - // image. For example, the relevancy of "tower" is likely higher to an image - // containing the detected "Eiffel Tower" than to an image containing a - // detected distant towering building, even though the confidence that - // there is a tower in each image may be the same. Range [0, 1]. - float topicality = 6; - - // Image region to which this entity belongs. Not produced - // for `LABEL_DETECTION` features. - BoundingPoly bounding_poly = 7; - - // The location information for the detected entity. Multiple - // `LocationInfo` elements can be present because one location may - // indicate the location of the scene in the image, and another location - // may indicate the location of the place where the image was taken. - // Location information is usually present for landmarks. - repeated LocationInfo locations = 8; - - // Some entities may have optional user-supplied `Property` (name/value) - // fields, such a score or string that qualifies the entity. - repeated Property properties = 9; -} - -// Set of detected objects with bounding boxes. -message LocalizedObjectAnnotation { - // Object ID that should align with EntityAnnotation mid. - string mid = 1; - - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - - // Object name, expressed in its `language_code` language. - string name = 3; - - // Score of the result. Range [0, 1]. - float score = 4; - - // Image region to which this object belongs. This must be populated. - BoundingPoly bounding_poly = 5; -} - -// Set of features pertaining to the image, computed by computer vision -// methods over safe-search verticals (for example, adult, spoof, medical, -// violence). -message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. Adult content may - // contain elements such as nudity, pornographic images or cartoons, or - // sexual activities. - Likelihood adult = 1; - - // Spoof likelihood. The likelihood that an modification - // was made to the image's canonical version to make it appear - // funny or offensive. - Likelihood spoof = 2; - - // Likelihood that this is a medical image. - Likelihood medical = 3; - - // Likelihood that this image contains violent content. - Likelihood violence = 4; - - // Likelihood that the request image contains racy content. Racy content may - // include (but is not limited to) skimpy or sheer clothing, strategically - // covered nudity, lewd or provocative poses, or close-ups of sensitive - // body areas. - Likelihood racy = 9; - - // Confidence of adult_score. Range [0, 1]. 0 means not confident, 1 means - // very confident. - float adult_confidence = 16; - - // Confidence of spoof_score. Range [0, 1]. 0 means not confident, 1 means - // very confident. - float spoof_confidence = 18; - - // Confidence of medical_score. Range [0, 1]. 0 means not confident, 1 means - // very confident. - float medical_confidence = 20; - - // Confidence of violence_score. Range [0, 1]. 0 means not confident, 1 means - // very confident. - float violence_confidence = 22; - - // Confidence of racy_score. Range [0, 1]. 0 means not confident, 1 means very - // confident. - float racy_confidence = 24; - - // Confidence of nsfw_score. Range [0, 1]. 0 means not confident, 1 means very - // confident. - float nsfw_confidence = 26; -} - -// Rectangle determined by min and max `LatLng` pairs. -message LatLongRect { - // Min lat/long pair. - google.type.LatLng min_lat_lng = 1; - - // Max lat/long pair. - google.type.LatLng max_lat_lng = 2; -} - -// Color information consists of RGB channels, score, and the fraction of -// the image that the color occupies in the image. -message ColorInfo { - // RGB components of the color. - google.type.Color color = 1; - - // Image-specific score for this color. Value in range [0, 1]. - float score = 2; - - // The fraction of pixels the color occupies in the image. - // Value in range [0, 1]. - float pixel_fraction = 3; -} - -// Set of dominant colors and their corresponding scores. -message DominantColorsAnnotation { - // RGB color values with their score and pixel fraction. - repeated ColorInfo colors = 1; -} - -// Stores image properties, such as dominant colors. -message ImageProperties { - // If present, dominant colors completed successfully. - DominantColorsAnnotation dominant_colors = 1; -} - -// Single crop hint that is used to generate a new crop when serving an image. -message CropHint { - // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale. - BoundingPoly bounding_poly = 1; - - // Confidence of this being a salient region. Range [0, 1]. - float confidence = 2; - - // Fraction of importance of this salient region with respect to the original - // image. - float importance_fraction = 3; -} - -// Set of crop hints that are used to generate new crops when serving images. -message CropHintsAnnotation { - // Crop hint results. - repeated CropHint crop_hints = 1; -} - -// Parameters for crop hints annotation request. -message CropHintsParams { - // Aspect ratios in floats, representing the ratio of the width to the height - // of the image. For example, if the desired aspect ratio is 4/3, the - // corresponding float value should be 1.33333. If not specified, the - // best possible crop is returned. The number of provided aspect ratios is - // limited to a maximum of 16; any aspect ratios provided after the 16th are - // ignored. - repeated float aspect_ratios = 1; -} - -// Parameters for web detection request. -message WebDetectionParams { - // Whether to include results derived from the geo information in the image. - bool include_geo_results = 2; -} - -// Image context and/or feature-specific parameters. -message ImageContext { - // Not used. - LatLongRect lat_long_rect = 1; - - // List of languages to use for TEXT_DETECTION. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Text detection returns an - // error if one or more of the specified languages is not one of the - // [supported languages](/vision/docs/languages). - repeated string language_hints = 2; - - // Parameters for crop hints annotation request. - CropHintsParams crop_hints_params = 4; - - // Parameters for product search. - ProductSearchParams product_search_params = 5; - - // Parameters for web detection. - WebDetectionParams web_detection_params = 6; -} - -// Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features, and with context information. -message AnnotateImageRequest { - // The image to be processed. - Image image = 1; - - // Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image. - ImageContext image_context = 3; -} - -// If an image was produced from a file (e.g. a PDF), this message gives -// information about the source of that image. -message ImageAnnotationContext { - // The URI of the file used to produce the image. - string uri = 1; - - // If the file was a PDF or TIFF, this field gives the page number within - // the file used to produce the image. - int32 page_number = 2; -} - -// Response to an image annotation request. -message AnnotateImageResponse { - // If present, face detection has completed successfully. - repeated FaceAnnotation face_annotations = 1; - - // If present, landmark detection has completed successfully. - repeated EntityAnnotation landmark_annotations = 2; - - // If present, logo detection has completed successfully. - repeated EntityAnnotation logo_annotations = 3; - - // If present, label detection has completed successfully. - repeated EntityAnnotation label_annotations = 4; - - // If present, localized object detection has completed successfully. - // This will be sorted descending by confidence score. - repeated LocalizedObjectAnnotation localized_object_annotations = 22; - - // If present, text (OCR) detection has completed successfully. - repeated EntityAnnotation text_annotations = 5; - - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. - // This annotation provides the structural hierarchy for the OCR detected - // text. - TextAnnotation full_text_annotation = 12; - - // If present, safe-search annotation has completed successfully. - SafeSearchAnnotation safe_search_annotation = 6; - - // If present, image properties were extracted successfully. - ImageProperties image_properties_annotation = 8; - - // If present, crop hints have completed successfully. - CropHintsAnnotation crop_hints_annotation = 11; - - // If present, web detection has completed successfully. - WebDetection web_detection = 13; - - // If present, product search has completed successfully. - ProductSearchResults product_search_results = 14; - - // If set, represents the error message for the operation. - // Note that filled-in image annotations are guaranteed to be - // correct, even when `error` is set. - google.rpc.Status error = 9; - - // If present, contextual information is needed to understand where this image - // comes from. - ImageAnnotationContext context = 21; -} - -// Multiple image annotation requests are batched into a single service call. -message BatchAnnotateImagesRequest { - // Required. Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Target project and location to make a call. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // If no parent is specified, a region will be chosen automatically. - // - // Supported location-ids: - // `us`: USA country only, - // `asia`: East asia areas, like Japan, Taiwan, - // `eu`: The European Union. - // - // Example: `projects/project-A/locations/eu`. - string parent = 4; -} - -// Response to a batch image annotation request. -message BatchAnnotateImagesResponse { - // Individual responses to image annotation requests within the batch. - repeated AnnotateImageResponse responses = 1; -} - -// A request to annotate one single file, e.g. a PDF, TIFF or GIF file. -message AnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Pages of the file to perform image annotation. - // - // Pages starts from 1, we assume the first page of the file is page 1. - // At most 5 pages are supported per request. Pages can be negative. - // - // Page 1 means the first page. - // Page 2 means the second page. - // Page -1 means the last page. - // Page -2 means the second to the last page. - // - // If the file is GIF instead of PDF or TIFF, page refers to GIF frames. - // - // If this field is empty, by default the service performs image annotation - // for the first 5 pages of the file. - repeated int32 pages = 4; -} - -// Response to a single file annotation request. A file may contain one or more -// images, which individually have their own responses. -message AnnotateFileResponse { - // Information about the file for which this response is generated. - InputConfig input_config = 1; - - // Individual responses to images found within the file. This field will be - // empty if the `error` field is set. - repeated AnnotateImageResponse responses = 2; - - // This field gives the total number of pages in the file. - int32 total_pages = 3; - - // If set, represents the error message for the failed request. The - // `responses` field will not be set in this case. - google.rpc.Status error = 4; -} - -// A list of requests to annotate files using the BatchAnnotateFiles API. -message BatchAnnotateFilesRequest { - // Required. The list of file annotation requests. Right now we support only one - // AnnotateFileRequest in BatchAnnotateFilesRequest. - repeated AnnotateFileRequest requests = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Target project and location to make a call. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // If no parent is specified, a region will be chosen automatically. - // - // Supported location-ids: - // `us`: USA country only, - // `asia`: East asia areas, like Japan, Taiwan, - // `eu`: The European Union. - // - // Example: `projects/project-A/locations/eu`. - string parent = 3; -} - -// A list of file annotation responses. -message BatchAnnotateFilesResponse { - // The list of file annotation responses, each response corresponding to each - // AnnotateFileRequest in BatchAnnotateFilesRequest. - repeated AnnotateFileResponse responses = 1; -} - -// An offline file annotation request. -message AsyncAnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 4; -} - -// The response for a single offline file annotation request. -message AsyncAnnotateFileResponse { - // The output location and metadata from AsyncAnnotateFileRequest. - OutputConfig output_config = 1; -} - -// Request for async image annotation for a list of images. -message AsyncBatchAnnotateImagesRequest { - // Required. Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Target project and location to make a call. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // If no parent is specified, a region will be chosen automatically. - // - // Supported location-ids: - // `us`: USA country only, - // `asia`: East asia areas, like Japan, Taiwan, - // `eu`: The European Union. - // - // Example: `projects/project-A/locations/eu`. - string parent = 4; -} - -// Response to an async batch image annotation request. -message AsyncBatchAnnotateImagesResponse { - // The output location and metadata from AsyncBatchAnnotateImagesRequest. - OutputConfig output_config = 1; -} - -// Multiple async file annotation requests are batched into a single service -// call. -message AsyncBatchAnnotateFilesRequest { - // Required. Individual async file annotation requests for this batch. - repeated AsyncAnnotateFileRequest requests = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Target project and location to make a call. - // - // Format: `projects/{project-id}/locations/{location-id}`. - // - // If no parent is specified, a region will be chosen automatically. - // - // Supported location-ids: - // `us`: USA country only, - // `asia`: East asia areas, like Japan, Taiwan, - // `eu`: The European Union. - // - // Example: `projects/project-A/locations/eu`. - string parent = 4; -} - -// Response to an async batch file annotation request. -message AsyncBatchAnnotateFilesResponse { - // The list of file annotation responses, one for each request in - // AsyncBatchAnnotateFilesRequest. - repeated AsyncAnnotateFileResponse responses = 1; -} - -// The desired input location and metadata. -message InputConfig { - // The Google Cloud Storage location to read the input from. - GcsSource gcs_source = 1; - - // File content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - // - // Currently, this field only works for BatchAnnotateFiles requests. It does - // not work for AsyncBatchAnnotateFiles requests. - bytes content = 3; - - // The type of the file. Currently only "application/pdf", "image/tiff" and - // "image/gif" are supported. Wildcards are not supported. - string mime_type = 2; -} - -// The desired output location and metadata. -message OutputConfig { - // The Google Cloud Storage location to write the output(s) to. - GcsDestination gcs_destination = 1; - - // The max number of response protos to put into each output JSON file on - // Google Cloud Storage. - // The valid range is [1, 100]. If not specified, the default value is 20. - // - // For example, for one pdf file with 100 pages, 100 response protos will - // be generated. If `batch_size` = 20, then 5 json files each - // containing 20 response protos will be written under the prefix - // `gcs_destination`.`uri`. - // - // Currently, batch_size only applies to GcsDestination, with potential future - // support for other output configurations. - int32 batch_size = 2; -} - -// The Google Cloud Storage location where the input will be read from. -message GcsSource { - // Google Cloud Storage URI for the input file. This must only be a - // Google Cloud Storage object. Wildcards are not currently supported. - string uri = 1; -} - -// The Google Cloud Storage location where the output will be written to. -message GcsDestination { - // Google Cloud Storage URI prefix where the results will be stored. Results - // will be in JSON format and preceded by its corresponding input URI prefix. - // This field can either represent a gcs file prefix or gcs directory. In - // either case, the uri should be unique because in order to get all of the - // output files, you will need to do a wildcard gcs search on the uri prefix - // you provide. - // - // Examples: - // - // * File Prefix: gs://bucket-name/here/filenameprefix The output files - // will be created in gs://bucket-name/here/ and the names of the - // output files will begin with "filenameprefix". - // - // * Directory Prefix: gs://bucket-name/some/location/ The output files - // will be created in gs://bucket-name/some/location/ and the names of the - // output files could be anything because there was no filename prefix - // specified. - // - // If multiple outputs, each response is still AnnotateFileResponse, each of - // which contains some subset of the full list of AnnotateImageResponse. - // Multiple outputs can happen if, for example, the output JSON is too large - // and overflows into multiple sharded files. - string uri = 1; -} - -// Contains metadata for the BatchAnnotateImages operation. -message OperationMetadata { - // Batch operation states. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is received. - CREATED = 1; - - // Request is actively being processed. - RUNNING = 2; - - // The batch processing is done. - DONE = 3; - - // The batch processing was cancelled. - CANCELLED = 4; - } - - // Current state of the batch operation. - State state = 1; - - // The time when the batch request was received. - google.protobuf.Timestamp create_time = 5; - - // The time when the operation result was last updated. - google.protobuf.Timestamp update_time = 6; -} diff --git a/vision/google/cloud/vision_v1/proto/image_annotator_pb2.py b/vision/google/cloud/vision_v1/proto/image_annotator_pb2.py deleted file mode 100644 index 3e0f088f1aa5..000000000000 --- a/vision/google/cloud/vision_v1/proto/image_annotator_pb2.py +++ /dev/null @@ -1,4929 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1/proto/image_annotator.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.vision_v1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1.proto import ( - product_search_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__pb2, -) -from google.cloud.vision_v1.proto import ( - text_annotation_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_text__annotation__pb2, -) -from google.cloud.vision_v1.proto import ( - web_detection_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_web__detection__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1/proto/image_annotator.proto", - package="google.cloud.vision.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.vision.v1B\023ImageAnnotatorProtoP\001Z\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x42\n\tlandmarks\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12:\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12=\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12<\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x44\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12>\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12?\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x1a\xb9\x07\n\x08Landmark\x12\x42\n\x04type\x18\x03 \x01(\x0e\x32\x34.google.cloud.vision.v1.FaceAnnotation.Landmark.Type\x12\x32\n\x08position\x18\x04 \x01(\x0b\x32 .google.cloud.vision.v1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xab\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12;\n\rbounding_poly\x18\x07 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x37\n\tlocations\x18\x08 \x03(\x0b\x32$.google.cloud.vision.v1.LocationInfo\x12\x34\n\nproperties\x18\t \x03(\x0b\x32 .google.cloud.vision.v1.Property"\x99\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12;\n\rbounding_poly\x18\x05 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly"\xb8\x03\n\x14SafeSearchAnnotation\x12\x31\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x31\n\x05spoof\x18\x02 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x33\n\x07medical\x18\x03 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x34\n\x08violence\x18\x04 \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x30\n\x04racy\x18\t \x01(\x0e\x32".google.cloud.vision.v1.Likelihood\x12\x18\n\x10\x61\x64ult_confidence\x18\x10 \x01(\x02\x12\x18\n\x10spoof_confidence\x18\x12 \x01(\x02\x12\x1a\n\x12medical_confidence\x18\x14 \x01(\x02\x12\x1b\n\x13violence_confidence\x18\x16 \x01(\x02\x12\x17\n\x0fracy_confidence\x18\x18 \x01(\x02\x12\x17\n\x0fnsfw_confidence\x18\x1a \x01(\x02"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"M\n\x18\x44ominantColorsAnnotation\x12\x31\n\x06\x63olors\x18\x01 \x03(\x0b\x32!.google.cloud.vision.v1.ColorInfo"\\\n\x0fImageProperties\x12I\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x30.google.cloud.vision.v1.DominantColorsAnnotation"x\n\x08\x43ropHint\x12;\n\rbounding_poly\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"K\n\x13\x43ropHintsAnnotation\x12\x34\n\ncrop_hints\x18\x01 \x03(\x0b\x32 .google.cloud.vision.v1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\xbc\x02\n\x0cImageContext\x12:\n\rlat_long_rect\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12\x42\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1.CropHintsParams\x12J\n\x15product_search_params\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1.ProductSearchParams\x12H\n\x14web_detection_params\x18\x06 \x01(\x0b\x32*.google.cloud.vision.v1.WebDetectionParams"\xb4\x01\n\x14\x41nnotateImageRequest\x12,\n\x05image\x18\x01 \x01(\x0b\x32\x1d.google.cloud.vision.v1.Image\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\xe4\x07\n\x15\x41nnotateImageResponse\x12@\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1.FaceAnnotation\x12\x46\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x42\n\x10logo_annotations\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x43\n\x11label_annotations\x18\x04 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12W\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x31.google.cloud.vision.v1.LocalizedObjectAnnotation\x12\x42\n\x10text_annotations\x18\x05 \x03(\x0b\x32(.google.cloud.vision.v1.EntityAnnotation\x12\x44\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32&.google.cloud.vision.v1.TextAnnotation\x12L\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32,.google.cloud.vision.v1.SafeSearchAnnotation\x12L\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32\'.google.cloud.vision.v1.ImageProperties\x12J\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32+.google.cloud.vision.v1.CropHintsAnnotation\x12;\n\rweb_detection\x18\r \x01(\x0b\x32$.google.cloud.vision.v1.WebDetection\x12L\n\x16product_search_results\x18\x0e \x01(\x0b\x32,.google.cloud.vision.v1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12?\n\x07\x63ontext\x18\x15 \x01(\x0b\x32..google.cloud.vision.v1.ImageAnnotationContext"q\n\x1a\x42\x61tchAnnotateImagesRequest\x12\x43\n\x08requests\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateImageRequestB\x03\xe0\x41\x02\x12\x0e\n\x06parent\x18\x04 \x01(\t"_\n\x1b\x42\x61tchAnnotateImagesResponse\x12@\n\tresponses\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse"\xcf\x01\n\x13\x41nnotateFileRequest\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext\x12\r\n\x05pages\x18\x04 \x03(\x05"\xcb\x01\n\x14\x41nnotateFileResponse\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12@\n\tresponses\x18\x02 \x03(\x0b\x32-.google.cloud.vision.v1.AnnotateImageResponse\x12\x13\n\x0btotal_pages\x18\x03 \x01(\x05\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status"o\n\x19\x42\x61tchAnnotateFilesRequest\x12\x42\n\x08requests\x18\x01 \x03(\x0b\x32+.google.cloud.vision.v1.AnnotateFileRequestB\x03\xe0\x41\x02\x12\x0e\n\x06parent\x18\x03 \x01(\t"]\n\x1a\x42\x61tchAnnotateFilesResponse\x12?\n\tresponses\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateFileResponse"\x82\x02\n\x18\x41syncAnnotateFileRequest\x12\x39\n\x0cinput_config\x18\x01 \x01(\x0b\x32#.google.cloud.vision.v1.InputConfig\x12\x31\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32\x1f.google.cloud.vision.v1.Feature\x12;\n\rimage_context\x18\x03 \x01(\x0b\x32$.google.cloud.vision.v1.ImageContext\x12;\n\routput_config\x18\x04 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"X\n\x19\x41syncAnnotateFileResponse\x12;\n\routput_config\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"\xb8\x01\n\x1f\x41syncBatchAnnotateImagesRequest\x12\x43\n\x08requests\x18\x01 \x03(\x0b\x32,.google.cloud.vision.v1.AnnotateImageRequestB\x03\xe0\x41\x02\x12@\n\routput_config\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfigB\x03\xe0\x41\x02\x12\x0e\n\x06parent\x18\x04 \x01(\t"_\n AsyncBatchAnnotateImagesResponse\x12;\n\routput_config\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1.OutputConfig"y\n\x1e\x41syncBatchAnnotateFilesRequest\x12G\n\x08requests\x18\x01 \x03(\x0b\x32\x30.google.cloud.vision.v1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02\x12\x0e\n\x06parent\x18\x04 \x01(\t"g\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x44\n\tresponses\x18\x01 \x03(\x0b\x32\x31.google.cloud.vision.v1.AsyncAnnotateFileResponse"h\n\x0bInputConfig\x12\x35\n\ngcs_source\x18\x01 \x01(\x0b\x32!.google.cloud.vision.v1.GcsSource\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t"c\n\x0cOutputConfig\x12?\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x88\x02\n\x11OperationMetadata\x12>\n\x05state\x18\x01 \x01(\x0e\x32/.google.cloud.vision.v1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf5\n\n\x0eImageAnnotator\x12\x93\x02\n\x13\x42\x61tchAnnotateImages\x12\x32.google.cloud.vision.v1.BatchAnnotateImagesRequest\x1a\x33.google.cloud.vision.v1.BatchAnnotateImagesResponse"\x92\x01\x82\xd3\xe4\x93\x02\x80\x01"\x13/v1/images:annotate:\x01*Z8"3/v1/{parent=projects/*/locations/*}/images:annotate:\x01*Z,"\'/v1/{parent=projects/*}/images:annotate:\x01*\xda\x41\x08requests\x12\x8c\x02\n\x12\x42\x61tchAnnotateFiles\x12\x31.google.cloud.vision.v1.BatchAnnotateFilesRequest\x1a\x32.google.cloud.vision.v1.BatchAnnotateFilesResponse"\x8e\x01\x82\xd3\xe4\x93\x02}"\x12/v1/files:annotate:\x01*Z7"2/v1/{parent=projects/*/locations/*}/files:annotate:\x01*Z+"&/v1/{parent=projects/*}/files:annotate:\x01*\xda\x41\x08requests\x12\xeb\x02\n\x18\x41syncBatchAnnotateImages\x12\x37.google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest\x1a\x1d.google.longrunning.Operation"\xf6\x01\x82\xd3\xe4\x93\x02\x9e\x01"\x1d/v1/images:asyncBatchAnnotate:\x01*ZB"=/v1/{parent=projects/*/locations/*}/images:asyncBatchAnnotate:\x01*Z6"1/v1/{parent=projects/*}/images:asyncBatchAnnotate:\x01*\xda\x41\x16requests,output_config\xca\x41\x35\n AsyncBatchAnnotateImagesResponse\x12\x11OperationMetadata\x12\xd7\x02\n\x17\x41syncBatchAnnotateFiles\x12\x36.google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation"\xe4\x01\x82\xd3\xe4\x93\x02\x9b\x01"\x1c/v1/files:asyncBatchAnnotate:\x01*ZA"`__ - for more info. - image_uri: - The URI of the source image. Can be either: 1. A Google Cloud - Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ for - more info. 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS URLs, Google cannot - guarantee that the request will be completed. Your request - may fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for production - applications. When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImageSource) - ), -) -_sym_db.RegisterMessage(ImageSource) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Client image to perform Google Cloud Vision API tasks - over. - - - Attributes: - content: - Image content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - source: - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - Landmark=_reflection.GeneratedProtocolMessageType( - "Landmark", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION_LANDMARK, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A face-specific landmark (for example, a face feature). - - - Attributes: - type: - Face landmark type. - position: - Face landmark position. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.FaceAnnotation.Landmark) - ), - ), - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A face annotation object contains the results of face - detection. - - - Attributes: - bounding_poly: - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note that - one or more x and/or y coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face appears in the image to be annotated. - fd_bounding_poly: - The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on the - initial face detection, hence the fd (face detection) prefix. - landmarks: - Detected face landmarks. - roll_angle: - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation of the face relative to the image vertical - about the axis perpendicular to the face. Range [-180,180]. - pan_angle: - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. - tilt_angle: - Pitch angle, which indicates the upwards/downwards angle that - the face is pointing relative to the image's horizontal plane. - Range [-180,180]. - detection_confidence: - Detection confidence. Range [0, 1]. - landmarking_confidence: - Face landmarking confidence. Range [0, 1]. - joy_likelihood: - Joy likelihood. - sorrow_likelihood: - Sorrow likelihood. - anger_likelihood: - Anger likelihood. - surprise_likelihood: - Surprise likelihood. - under_exposed_likelihood: - Under-exposed likelihood. - blurred_likelihood: - Blurred likelihood. - headwear_likelihood: - Headwear likelihood. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) -_sym_db.RegisterMessage(FaceAnnotation.Landmark) - -LocationInfo = _reflection.GeneratedProtocolMessageType( - "LocationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONINFO, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Detected entity location information. - - - Attributes: - lat_lng: - lat/long location coordinates. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.LocationInfo) - ), -) -_sym_db.RegisterMessage(LocationInfo) - -Property = _reflection.GeneratedProtocolMessageType( - "Property", - (_message.Message,), - dict( - DESCRIPTOR=_PROPERTY, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A ``Property`` consists of a user-supplied name/value - pair. - - - Attributes: - name: - Name of the property. - value: - Value of the property. - uint64_value: - Value of numeric properties. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Property) - ), -) -_sym_db.RegisterMessage(Property) - -EntityAnnotation = _reflection.GeneratedProtocolMessageType( - "EntityAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Set of detected entity features. - - - Attributes: - mid: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - locale: - The language code for the locale in which the entity textual - ``description`` is expressed. - description: - Entity textual description, expressed in its ``locale`` - language. - score: - Overall score of the result. Range [0, 1]. - confidence: - \ **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. - topicality: - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" than - to an image containing a detected distant towering building, - even though the confidence that there is a tower in each image - may be the same. Range [0, 1]. - bounding_poly: - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. - locations: - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place where - the image was taken. Location information is usually present - for landmarks. - properties: - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies the - entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.EntityAnnotation) - ), -) -_sym_db.RegisterMessage(EntityAnnotation) - -LocalizedObjectAnnotation = _reflection.GeneratedProtocolMessageType( - "LocalizedObjectAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LOCALIZEDOBJECTANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Set of detected objects with bounding boxes. - - - Attributes: - mid: - Object ID that should align with EntityAnnotation mid. - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - name: - Object name, expressed in its ``language_code`` language. - score: - Score of the result. Range [0, 1]. - bounding_poly: - Image region to which this object belongs. This must be - populated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.LocalizedObjectAnnotation) - ), -) -_sym_db.RegisterMessage(LocalizedObjectAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType( - "SafeSearchAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_SAFESEARCHANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Set of features pertaining to the image, computed by - computer vision methods over safe-search verticals (for example, adult, - spoof, medical, violence). - - - Attributes: - adult: - Represents the adult content likelihood for the image. Adult - content may contain elements such as nudity, pornographic - images or cartoons, or sexual activities. - spoof: - Spoof likelihood. The likelihood that an modification was made - to the image's canonical version to make it appear funny or - offensive. - medical: - Likelihood that this is a medical image. - violence: - Likelihood that this image contains violent content. - racy: - Likelihood that the request image contains racy content. Racy - content may include (but is not limited to) skimpy or sheer - clothing, strategically covered nudity, lewd or provocative - poses, or close-ups of sensitive body areas. - adult_confidence: - Confidence of adult\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - spoof_confidence: - Confidence of spoof\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - medical_confidence: - Confidence of medical\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - violence_confidence: - Confidence of violence\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - racy_confidence: - Confidence of racy\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - nsfw_confidence: - Confidence of nsfw\_score. Range [0, 1]. 0 means not - confident, 1 means very confident. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.SafeSearchAnnotation) - ), -) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -LatLongRect = _reflection.GeneratedProtocolMessageType( - "LatLongRect", - (_message.Message,), - dict( - DESCRIPTOR=_LATLONGRECT, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Rectangle determined by min and max ``LatLng`` pairs. - - - Attributes: - min_lat_lng: - Min lat/long pair. - max_lat_lng: - Max lat/long pair. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.LatLongRect) - ), -) -_sym_db.RegisterMessage(LatLongRect) - -ColorInfo = _reflection.GeneratedProtocolMessageType( - "ColorInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COLORINFO, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Color information consists of RGB channels, score, and the - fraction of the image that the color occupies in the image. - - - Attributes: - color: - RGB components of the color. - score: - Image-specific score for this color. Value in range [0, 1]. - pixel_fraction: - The fraction of pixels the color occupies in the image. Value - in range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ColorInfo) - ), -) -_sym_db.RegisterMessage(ColorInfo) - -DominantColorsAnnotation = _reflection.GeneratedProtocolMessageType( - "DominantColorsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_DOMINANTCOLORSANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Set of dominant colors and their corresponding scores. - - - Attributes: - colors: - RGB color values with their score and pixel fraction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.DominantColorsAnnotation) - ), -) -_sym_db.RegisterMessage(DominantColorsAnnotation) - -ImageProperties = _reflection.GeneratedProtocolMessageType( - "ImageProperties", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPROPERTIES, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Stores image properties, such as dominant colors. - - - Attributes: - dominant_colors: - If present, dominant colors completed successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImageProperties) - ), -) -_sym_db.RegisterMessage(ImageProperties) - -CropHint = _reflection.GeneratedProtocolMessageType( - "CropHint", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINT, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Single crop hint that is used to generate a new crop when - serving an image. - - - Attributes: - bounding_poly: - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale. - confidence: - Confidence of this being a salient region. Range [0, 1]. - importance_fraction: - Fraction of importance of this salient region with respect to - the original image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CropHint) - ), -) -_sym_db.RegisterMessage(CropHint) - -CropHintsAnnotation = _reflection.GeneratedProtocolMessageType( - "CropHintsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSANNOTATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Set of crop hints that are used to generate new crops when - serving images. - - - Attributes: - crop_hints: - Crop hint results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CropHintsAnnotation) - ), -) -_sym_db.RegisterMessage(CropHintsAnnotation) - -CropHintsParams = _reflection.GeneratedProtocolMessageType( - "CropHintsParams", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSPARAMS, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Parameters for crop hints annotation request. - - - Attributes: - aspect_ratios: - Aspect ratios in floats, representing the ratio of the width - to the height of the image. For example, if the desired aspect - ratio is 4/3, the corresponding float value should be 1.33333. - If not specified, the best possible crop is returned. The - number of provided aspect ratios is limited to a maximum of - 16; any aspect ratios provided after the 16th are ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.CropHintsParams) - ), -) -_sym_db.RegisterMessage(CropHintsParams) - -WebDetectionParams = _reflection.GeneratedProtocolMessageType( - "WebDetectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTIONPARAMS, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Parameters for web detection request. - - - Attributes: - include_geo_results: - Whether to include results derived from the geo information in - the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.WebDetectionParams) - ), -) -_sym_db.RegisterMessage(WebDetectionParams) - -ImageContext = _reflection.GeneratedProtocolMessageType( - "ImageContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECONTEXT, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Image context and/or feature-specific parameters. - - - Attributes: - lat_long_rect: - Not used. - language_hints: - List of languages to use for TEXT\_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not needed. In rare - cases, when the language of the text in the image is known, - setting a hint will help get better results (although it will - be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. - crop_hints_params: - Parameters for crop hints annotation request. - product_search_params: - Parameters for product search. - web_detection_params: - Parameters for web detection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImageContext) - ), -) -_sym_db.RegisterMessage(ImageContext) - -AnnotateImageRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGEREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Request for performing Google Cloud Vision API tasks over - a user-provided image, with user-requested features, and with context - information. - - - Attributes: - image: - The image to be processed. - features: - Requested features. - image_context: - Additional context that may accompany the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AnnotateImageRequest) - ), -) -_sym_db.RegisterMessage(AnnotateImageRequest) - -ImageAnnotationContext = _reflection.GeneratedProtocolMessageType( - "ImageAnnotationContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEANNOTATIONCONTEXT, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""If an image was produced from a file (e.g. a PDF), this - message gives information about the source of that image. - - - Attributes: - uri: - The URI of the file used to produce the image. - page_number: - If the file was a PDF or TIFF, this field gives the page - number within the file used to produce the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.ImageAnnotationContext) - ), -) -_sym_db.RegisterMessage(ImageAnnotationContext) - -AnnotateImageResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateImageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGERESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Response to an image annotation request. - - - Attributes: - face_annotations: - If present, face detection has completed successfully. - landmark_annotations: - If present, landmark detection has completed successfully. - logo_annotations: - If present, logo detection has completed successfully. - label_annotations: - If present, label detection has completed successfully. - localized_object_annotations: - If present, localized object detection has completed - successfully. This will be sorted descending by confidence - score. - text_annotations: - If present, text (OCR) detection has completed successfully. - full_text_annotation: - If present, text (OCR) detection or document (OCR) text - detection has completed successfully. This annotation provides - the structural hierarchy for the OCR detected text. - safe_search_annotation: - If present, safe-search annotation has completed successfully. - image_properties_annotation: - If present, image properties were extracted successfully. - crop_hints_annotation: - If present, crop hints have completed successfully. - web_detection: - If present, web detection has completed successfully. - product_search_results: - If present, product search has completed successfully. - error: - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be correct, - even when ``error`` is set. - context: - If present, contextual information is needed to understand - where this image comes from. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AnnotateImageResponse) - ), -) -_sym_db.RegisterMessage(AnnotateImageResponse) - -BatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Multiple image annotation requests are batched into a - single service call. - - - Attributes: - requests: - Required. Individual image annotation requests for this batch. - parent: - Optional. Target project and location to make a call. Format: - ``projects/{project-id}/locations/{location-id}``. If no - parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. Example: ``projects/project-A/locations/eu``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.BatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesRequest) - -BatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Response to a batch image annotation request. - - - Attributes: - responses: - Individual responses to image annotation requests within the - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.BatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesResponse) - -AnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A request to annotate one single file, e.g. a PDF, TIFF or - GIF file. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - pages: - Pages of the file to perform image annotation. Pages starts - from 1, we assume the first page of the file is page 1. At - most 5 pages are supported per request. Pages can be negative. - Page 1 means the first page. Page 2 means the second page. - Page -1 means the last page. Page -2 means the second to the - last page. If the file is GIF instead of PDF or TIFF, page - refers to GIF frames. If this field is empty, by default the - service performs image annotation for the first 5 pages of the - file. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AnnotateFileRequest) - -AnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Response to a single file annotation request. A file may - contain one or more images, which individually have their own responses. - - - Attributes: - input_config: - Information about the file for which this response is - generated. - responses: - Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. - total_pages: - This field gives the total number of pages in the file. - error: - If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AnnotateFileResponse) - -BatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A list of requests to annotate files using the - BatchAnnotateFiles API. - - - Attributes: - requests: - Required. The list of file annotation requests. Right now we - support only one AnnotateFileRequest in - BatchAnnotateFilesRequest. - parent: - Optional. Target project and location to make a call. Format: - ``projects/{project-id}/locations/{location-id}``. If no - parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. Example: ``projects/project-A/locations/eu``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.BatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateFilesRequest) - -BatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""A list of file annotation responses. - - - Attributes: - responses: - The list of file annotation responses, each response - corresponding to each AnnotateFileRequest in - BatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.BatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateFilesResponse) - -AsyncAnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""An offline file annotation request. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - output_config: - Required. The desired output location and metadata (e.g. - format). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncAnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileRequest) - -AsyncAnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""The response for a single offline file annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncAnnotateFileRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncAnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileResponse) - -AsyncBatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Request for async image annotation for a list of images. - - - Attributes: - requests: - Required. Individual image annotation requests for this batch. - output_config: - Required. The desired output location and metadata (e.g. - format). - parent: - Optional. Target project and location to make a call. Format: - ``projects/{project-id}/locations/{location-id}``. If no - parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. Example: ``projects/project-A/locations/eu``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncBatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateImagesRequest) - -AsyncBatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Response to an async batch image annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncBatchAnnotateImagesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncBatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateImagesResponse) - -AsyncBatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Multiple async file annotation requests are batched into a - single service call. - - - Attributes: - requests: - Required. Individual async file annotation requests for this - batch. - parent: - Optional. Target project and location to make a call. Format: - ``projects/{project-id}/locations/{location-id}``. If no - parent is specified, a region will be chosen automatically. - Supported location-ids: ``us``: USA country only, ``asia``: - East asia areas, like Japan, Taiwan, ``eu``: The European - Union. Example: ``projects/project-A/locations/eu``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncBatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesRequest) - -AsyncBatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Response to an async batch file annotation request. - - - Attributes: - responses: - The list of file annotation responses, one for each request in - AsyncBatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.AsyncBatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesResponse) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""The desired input location and metadata. - - - Attributes: - gcs_source: - The Google Cloud Storage location to read the input from. - content: - File content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. - mime_type: - The type of the file. Currently only "application/pdf", - "image/tiff" and "image/gif" are supported. Wildcards are not - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""The desired output location and metadata. - - - Attributes: - gcs_destination: - The Google Cloud Storage location to write the output(s) to. - batch_size: - The max number of response protos to put into each output JSON - file on Google Cloud Storage. The valid range is [1, 100]. If - not specified, the default value is 20. For example, for one - pdf file with 100 pages, 100 response protos will be - generated. If ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written under the prefix - ``gcs_destination``.\ ``uri``. Currently, batch\_size only - applies to GcsDestination, with potential future support for - other output configurations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the input will be - read from. - - - Attributes: - uri: - Google Cloud Storage URI for the input file. This must only be - a Google Cloud Storage object. Wildcards are not currently - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the output will be - written to. - - - Attributes: - uri: - Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either case, - the uri should be unique because in order to get all of the - output files, you will need to do a wildcard gcs search on the - uri prefix you provide. Examples: - File Prefix: - gs://bucket-name/here/filenameprefix The output files will - be created in gs://bucket-name/here/ and the names of the - output files will begin with "filenameprefix". - - Directory Prefix: gs://bucket-name/some/location/ The output - files will be created in gs://bucket-name/some/location/ - and the names of the output files could be anything because - there was no filename prefix specified. If multiple - outputs, each response is still AnnotateFileResponse, each of - which contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.vision_v1.proto.image_annotator_pb2", - __doc__="""Contains metadata for the BatchAnnotateImages operation. - - - Attributes: - state: - Current state of the batch operation. - create_time: - The time when the batch request was received. - update_time: - The time when the operation result was last updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - - -DESCRIPTOR._options = None -_ENTITYANNOTATION.fields_by_name["confidence"]._options = None -_BATCHANNOTATEIMAGESREQUEST.fields_by_name["requests"]._options = None -_BATCHANNOTATEFILESREQUEST.fields_by_name["requests"]._options = None -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name["requests"]._options = None -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name["output_config"]._options = None -_ASYNCBATCHANNOTATEFILESREQUEST.fields_by_name["requests"]._options = None - -_IMAGEANNOTATOR = _descriptor.ServiceDescriptor( - name="ImageAnnotator", - full_name="google.cloud.vision.v1.ImageAnnotator", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025vision.googleapis.com\322A[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-vision" - ), - serialized_start=8376, - serialized_end=9773, - methods=[ - _descriptor.MethodDescriptor( - name="BatchAnnotateImages", - full_name="google.cloud.vision.v1.ImageAnnotator.BatchAnnotateImages", - index=0, - containing_service=None, - input_type=_BATCHANNOTATEIMAGESREQUEST, - output_type=_BATCHANNOTATEIMAGESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\200\001"\023/v1/images:annotate:\001*Z8"3/v1/{parent=projects/*/locations/*}/images:annotate:\001*Z,"\'/v1/{parent=projects/*}/images:annotate:\001*\332A\010requests' - ), - ), - _descriptor.MethodDescriptor( - name="BatchAnnotateFiles", - full_name="google.cloud.vision.v1.ImageAnnotator.BatchAnnotateFiles", - index=1, - containing_service=None, - input_type=_BATCHANNOTATEFILESREQUEST, - output_type=_BATCHANNOTATEFILESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002}"\022/v1/files:annotate:\001*Z7"2/v1/{parent=projects/*/locations/*}/files:annotate:\001*Z+"&/v1/{parent=projects/*}/files:annotate:\001*\332A\010requests' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateImages", - full_name="google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateImages", - index=2, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEIMAGESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\236\001"\035/v1/images:asyncBatchAnnotate:\001*ZB"=/v1/{parent=projects/*/locations/*}/images:asyncBatchAnnotate:\001*Z6"1/v1/{parent=projects/*}/images:asyncBatchAnnotate:\001*\332A\026requests,output_config\312A5\n AsyncBatchAnnotateImagesResponse\022\021OperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateFiles", - full_name="google.cloud.vision.v1.ImageAnnotator.AsyncBatchAnnotateFiles", - index=3, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEFILESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002\233\001"\034/v1/files:asyncBatchAnnotate:\001*ZA""//v1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\xda\x41!parent,product_set,product_set_id\x12\xb4\x01\n\x0fListProductSets\x12..google.cloud.vision.v1.ListProductSetsRequest\x1a/.google.cloud.vision.v1.ListProductSetsResponse"@\x82\xd3\xe4\x93\x02\x31\x12//v1/{parent=projects/*/locations/*}/productSets\xda\x41\x06parent\x12\xa1\x01\n\rGetProductSet\x12,.google.cloud.vision.v1.GetProductSetRequest\x1a".google.cloud.vision.v1.ProductSet">\x82\xd3\xe4\x93\x02\x31\x12//v1/{name=projects/*/locations/*/productSets/*}\xda\x41\x04name\x12\xd3\x01\n\x10UpdateProductSet\x12/.google.cloud.vision.v1.UpdateProductSetRequest\x1a".google.cloud.vision.v1.ProductSet"j\x82\xd3\xe4\x93\x02J2;/v1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\xda\x41\x17product_set,update_mask\x12\x9b\x01\n\x10\x44\x65leteProductSet\x12/.google.cloud.vision.v1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty">\x82\xd3\xe4\x93\x02\x31*//v1/{name=projects/*/locations/*/productSets/*}\xda\x41\x04name\x12\xb9\x01\n\rCreateProduct\x12,.google.cloud.vision.v1.CreateProductRequest\x1a\x1f.google.cloud.vision.v1.Product"Y\x82\xd3\xe4\x93\x02\x37",/v1/{parent=projects/*/locations/*}/products:\x07product\xda\x41\x19parent,product,product_id\x12\xa8\x01\n\x0cListProducts\x12+.google.cloud.vision.v1.ListProductsRequest\x1a,.google.cloud.vision.v1.ListProductsResponse"=\x82\xd3\xe4\x93\x02.\x12,/v1/{parent=projects/*/locations/*}/products\xda\x41\x06parent\x12\x95\x01\n\nGetProduct\x12).google.cloud.vision.v1.GetProductRequest\x1a\x1f.google.cloud.vision.v1.Product";\x82\xd3\xe4\x93\x02.\x12,/v1/{name=projects/*/locations/*/products/*}\xda\x41\x04name\x12\xbb\x01\n\rUpdateProduct\x12,.google.cloud.vision.v1.UpdateProductRequest\x1a\x1f.google.cloud.vision.v1.Product"[\x82\xd3\xe4\x93\x02?24/v1/{product.name=projects/*/locations/*/products/*}:\x07product\xda\x41\x13product,update_mask\x12\x92\x01\n\rDeleteProduct\x12,.google.cloud.vision.v1.DeleteProductRequest\x1a\x16.google.protobuf.Empty";\x82\xd3\xe4\x93\x02.*,/v1/{name=projects/*/locations/*/products/*}\xda\x41\x04name\x12\xf9\x01\n\x14\x43reateReferenceImage\x12\x33.google.cloud.vision.v1.CreateReferenceImageRequest\x1a&.google.cloud.vision.v1.ReferenceImage"\x83\x01\x82\xd3\xe4\x93\x02Q">/v1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\xda\x41)parent,reference_image,reference_image_id\x12\xb2\x01\n\x14\x44\x65leteReferenceImage\x12\x33.google.cloud.vision.v1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02@*>/v1/{name=projects/*/locations/*/products/*/referenceImages/*}\xda\x41\x04name\x12\xcf\x01\n\x13ListReferenceImages\x12\x32.google.cloud.vision.v1.ListReferenceImagesRequest\x1a\x33.google.cloud.vision.v1.ListReferenceImagesResponse"O\x82\xd3\xe4\x93\x02@\x12>/v1/{parent=projects/*/locations/*/products/*}/referenceImages\xda\x41\x06parent\x12\xbc\x01\n\x11GetReferenceImage\x12\x30.google.cloud.vision.v1.GetReferenceImageRequest\x1a&.google.cloud.vision.v1.ReferenceImage"M\x82\xd3\xe4\x93\x02@\x12>/v1/{name=projects/*/locations/*/products/*/referenceImages/*}\xda\x41\x04name\x12\xbd\x01\n\x16\x41\x64\x64ProductToProductSet\x12\x35.google.cloud.vision.v1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty"T\x82\xd3\xe4\x93\x02?":/v1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\xda\x41\x0cname,product\x12\xca\x01\n\x1bRemoveProductFromProductSet\x12:.google.cloud.vision.v1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty"W\x82\xd3\xe4\x93\x02\x42"=/v1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\xda\x41\x0cname,product\x12\xd6\x01\n\x18ListProductsInProductSet\x12\x37.google.cloud.vision.v1.ListProductsInProductSetRequest\x1a\x38.google.cloud.vision.v1.ListProductsInProductSetResponse"G\x82\xd3\xe4\x93\x02:\x12\x38/v1/{name=projects/*/locations/*/productSets/*}/products\xda\x41\x04name\x12\xf4\x01\n\x11ImportProductSets\x12\x30.google.cloud.vision.v1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation"\x8d\x01\x82\xd3\xe4\x93\x02;"6/v1/{parent=projects/*/locations/*}/productSets:import:\x01*\xda\x41\x13parent,input_config\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\x12\xd6\x01\n\rPurgeProducts\x12,.google.cloud.vision.v1.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation"x\x82\xd3\xe4\x93\x02\x37"2/v1/{parent=projects/*/locations/*}/products:purge:\x01*\xda\x41\x06parent\xca\x41/\n\x15google.protobuf.Empty\x12\x16\x42\x61tchOperationMetadata\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x81\x01\n\x1a\x63om.google.cloud.vision.v1B\x19ProductSearchServiceProtoP\x01Z"//v1/{parent=projects/*/locations/*}/productSets:\013product_set\332A!parent,product_set,product_set_id' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductSets", - full_name="google.cloud.vision.v1.ProductSearch.ListProductSets", - index=1, - containing_service=None, - input_type=_LISTPRODUCTSETSREQUEST, - output_type=_LISTPRODUCTSETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0021\022//v1/{parent=projects/*/locations/*}/productSets\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetProductSet", - full_name="google.cloud.vision.v1.ProductSearch.GetProductSet", - index=2, - containing_service=None, - input_type=_GETPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\0021\022//v1/{name=projects/*/locations/*/productSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProductSet", - full_name="google.cloud.vision.v1.ProductSearch.UpdateProductSet", - index=3, - containing_service=None, - input_type=_UPDATEPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\002J2;/v1/{product_set.name=projects/*/locations/*/productSets/*}:\013product_set\332A\027product_set,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProductSet", - full_name="google.cloud.vision.v1.ProductSearch.DeleteProductSet", - index=4, - containing_service=None, - input_type=_DELETEPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0021*//v1/{name=projects/*/locations/*/productSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateProduct", - full_name="google.cloud.vision.v1.ProductSearch.CreateProduct", - index=5, - containing_service=None, - input_type=_CREATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - '\202\323\344\223\0027",/v1/{parent=projects/*/locations/*}/products:\007product\332A\031parent,product,product_id' - ), - ), - _descriptor.MethodDescriptor( - name="ListProducts", - full_name="google.cloud.vision.v1.ProductSearch.ListProducts", - index=6, - containing_service=None, - input_type=_LISTPRODUCTSREQUEST, - output_type=_LISTPRODUCTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002.\022,/v1/{parent=projects/*/locations/*}/products\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetProduct", - full_name="google.cloud.vision.v1.ProductSearch.GetProduct", - index=7, - containing_service=None, - input_type=_GETPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\002.\022,/v1/{name=projects/*/locations/*/products/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProduct", - full_name="google.cloud.vision.v1.ProductSearch.UpdateProduct", - index=8, - containing_service=None, - input_type=_UPDATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\002?24/v1/{product.name=projects/*/locations/*/products/*}:\007product\332A\023product,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProduct", - full_name="google.cloud.vision.v1.ProductSearch.DeleteProduct", - index=9, - containing_service=None, - input_type=_DELETEPRODUCTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002.*,/v1/{name=projects/*/locations/*/products/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateReferenceImage", - full_name="google.cloud.vision.v1.ProductSearch.CreateReferenceImage", - index=10, - containing_service=None, - input_type=_CREATEREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - '\202\323\344\223\002Q">/v1/{parent=projects/*/locations/*/products/*}/referenceImages:\017reference_image\332A)parent,reference_image,reference_image_id' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteReferenceImage", - full_name="google.cloud.vision.v1.ProductSearch.DeleteReferenceImage", - index=11, - containing_service=None, - input_type=_DELETEREFERENCEIMAGEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002@*>/v1/{name=projects/*/locations/*/products/*/referenceImages/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListReferenceImages", - full_name="google.cloud.vision.v1.ProductSearch.ListReferenceImages", - index=12, - containing_service=None, - input_type=_LISTREFERENCEIMAGESREQUEST, - output_type=_LISTREFERENCEIMAGESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1/{parent=projects/*/locations/*/products/*}/referenceImages\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetReferenceImage", - full_name="google.cloud.vision.v1.ProductSearch.GetReferenceImage", - index=13, - containing_service=None, - input_type=_GETREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - "\202\323\344\223\002@\022>/v1/{name=projects/*/locations/*/products/*/referenceImages/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="AddProductToProductSet", - full_name="google.cloud.vision.v1.ProductSearch.AddProductToProductSet", - index=14, - containing_service=None, - input_type=_ADDPRODUCTTOPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002?":/v1/{name=projects/*/locations/*/productSets/*}:addProduct:\001*\332A\014name,product' - ), - ), - _descriptor.MethodDescriptor( - name="RemoveProductFromProductSet", - full_name="google.cloud.vision.v1.ProductSearch.RemoveProductFromProductSet", - index=15, - containing_service=None, - input_type=_REMOVEPRODUCTFROMPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002B"=/v1/{name=projects/*/locations/*/productSets/*}:removeProduct:\001*\332A\014name,product' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductsInProductSet", - full_name="google.cloud.vision.v1.ProductSearch.ListProductsInProductSet", - index=16, - containing_service=None, - input_type=_LISTPRODUCTSINPRODUCTSETREQUEST, - output_type=_LISTPRODUCTSINPRODUCTSETRESPONSE, - serialized_options=_b( - "\202\323\344\223\002:\0228/v1/{name=projects/*/locations/*/productSets/*}/products\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ImportProductSets", - full_name="google.cloud.vision.v1.ProductSearch.ImportProductSets", - index=17, - containing_service=None, - input_type=_IMPORTPRODUCTSETSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002;"6/v1/{parent=projects/*/locations/*}/productSets:import:\001*\332A\023parent,input_config\312A3\n\031ImportProductSetsResponse\022\026BatchOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="PurgeProducts", - full_name="google.cloud.vision.v1.ProductSearch.PurgeProducts", - index=18, - containing_service=None, - input_type=_PURGEPRODUCTSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\0027"2/v1/{parent=projects/*/locations/*}/products:purge:\001*\332A\006parent\312A/\n\025google.protobuf.Empty\022\026BatchOperationMetadata' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_PRODUCTSEARCH) - -DESCRIPTOR.services_by_name["ProductSearch"] = _PRODUCTSEARCH - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py b/vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py deleted file mode 100644 index d40d1a112f42..000000000000 --- a/vision/google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py +++ /dev/null @@ -1,522 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1.proto import ( - product_search_service_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ProductSearchStub(object): - """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/*` - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/CreateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.ListProductSets = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/ListProductSets", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.FromString, - ) - self.GetProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/GetProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.UpdateProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/UpdateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.DeleteProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/DeleteProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateProduct = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/CreateProduct", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.ListProducts = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/ListProducts", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.FromString, - ) - self.GetProduct = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/GetProduct", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.UpdateProduct = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/UpdateProduct", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.DeleteProduct = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/DeleteProduct", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/CreateReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.DeleteReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/DeleteReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListReferenceImages = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/ListReferenceImages", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.FromString, - ) - self.GetReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/GetReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.AddProductToProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/AddProductToProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.RemoveProductFromProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/RemoveProductFromProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListProductsInProductSet = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/ListProductsInProductSet", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.FromString, - ) - self.ImportProductSets = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/ImportProductSets", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.PurgeProducts = channel.unary_unary( - "/google.cloud.vision.v1.ProductSearch/PurgeProducts", - request_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.PurgeProductsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ProductSearchServicer(object): - """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/*` - """ - - def CreateProductSet(self, request, context): - """Creates and returns a new ProductSet resource. - - Possible errors: - - * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - 4096 characters. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductSets(self, request, context): - """Lists ProductSets in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProductSet(self, request, context): - """Gets information associated with a ProductSet. - - Possible errors: - - * Returns NOT_FOUND if the ProductSet does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProductSet(self, request, context): - """Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProducts(self, request, context): - """Lists products in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProduct(self, request, context): - """Gets information associated with a Product. - - Possible errors: - - * Returns NOT_FOUND if the Product does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateReferenceImage(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteReferenceImage(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListReferenceImages(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetReferenceImage(self, request, context): - """Gets information associated with a ReferenceImage. - - Possible errors: - - * Returns NOT_FOUND if the specified image does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AddProductToProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RemoveProductFromProductSet(self, request, context): - """Removes a Product from the specified ProductSet. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductsInProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportProductSets(self, request, context): - """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]. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def PurgeProducts(self, request, context): - """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) - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ProductSearchServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.CreateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "ListProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ListProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.SerializeToString, - ), - "GetProductSet": grpc.unary_unary_rpc_method_handler( - servicer.GetProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "UpdateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "DeleteProductSet": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateProduct": grpc.unary_unary_rpc_method_handler( - servicer.CreateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "ListProducts": grpc.unary_unary_rpc_method_handler( - servicer.ListProducts, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.SerializeToString, - ), - "GetProduct": grpc.unary_unary_rpc_method_handler( - servicer.GetProduct, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "UpdateProduct": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "DeleteProduct": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProduct, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.CreateReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "DeleteReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.DeleteReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListReferenceImages": grpc.unary_unary_rpc_method_handler( - servicer.ListReferenceImages, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.SerializeToString, - ), - "GetReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.GetReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "AddProductToProductSet": grpc.unary_unary_rpc_method_handler( - servicer.AddProductToProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "RemoveProductFromProductSet": grpc.unary_unary_rpc_method_handler( - servicer.RemoveProductFromProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListProductsInProductSet": grpc.unary_unary_rpc_method_handler( - servicer.ListProductsInProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.SerializeToString, - ), - "ImportProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ImportProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "PurgeProducts": grpc.unary_unary_rpc_method_handler( - servicer.PurgeProducts, - request_deserializer=google_dot_cloud_dot_vision__v1_dot_proto_dot_product__search__service__pb2.PurgeProductsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1.ProductSearch", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1/proto/text_annotation.proto b/vision/google/cloud/vision_v1/proto/text_annotation.proto deleted file mode 100644 index 97f9c8fa9c2e..000000000000 --- a/vision/google/cloud/vision_v1/proto/text_annotation.proto +++ /dev/null @@ -1,260 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1; - -import "google/cloud/vision/v1/geometry.proto"; -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision"; -option java_multiple_files = true; -option java_outer_classname = "TextAnnotationProto"; -option java_package = "com.google.cloud.vision.v1"; -option objc_class_prefix = "GCVN"; - -// TextAnnotation contains a structured representation of OCR extracted text. -// The hierarchy of an OCR extracted text structure is like this: -// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol -// Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please refer -// to the [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] message definition below for more -// detail. -message TextAnnotation { - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // Detected start or end of a structural component. - message DetectedBreak { - // Enum to denote the type of break found. New line, space etc. - enum BreakType { - // Unknown break label type. - UNKNOWN = 0; - - // Regular space. - SPACE = 1; - - // Sure space (very wide). - SURE_SPACE = 2; - - // Line-wrapping break. - EOL_SURE_SPACE = 3; - - // End-line hyphen that is not present in text; does not co-occur with - // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4; - - // Line break that ends a paragraph. - LINE_BREAK = 5; - } - - // Detected break type. - BreakType type = 1; - - // True if break prepends the element. - bool is_prefix = 2; - } - - // Additional information detected on the structural component. - message TextProperty { - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 1; - - // Detected start or end of a text segment. - DetectedBreak detected_break = 2; - } - - // List of pages detected by OCR. - repeated Page pages = 1; - - // UTF-8 text detected on the pages. - string text = 2; -} - -// Detected page from OCR. -message Page { - // Additional information detected on the page. - TextAnnotation.TextProperty property = 1; - - // Page width. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 width = 2; - - // Page height. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 height = 3; - - // List of blocks of text, images etc on this page. - repeated Block blocks = 4; - - // Confidence of the OCR results on the page. Range [0, 1]. - float confidence = 5; -} - -// Logical element on the page. -message Block { - // Type of a block (text, image etc) as identified by OCR. - enum BlockType { - // Unknown block type. - UNKNOWN = 0; - - // Regular text block. - TEXT = 1; - - // Table block. - TABLE = 2; - - // Image block. - PICTURE = 3; - - // Horizontal/vertical line box. - RULER = 4; - - // Barcode block. - BARCODE = 5; - } - - // Additional information detected for the block. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the block. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // - // * when the text is horizontal it might look like: - // - // 0----1 - // | | - // 3----2 - // - // * when it's rotated 180 degrees around the top-left corner it becomes: - // - // 2----3 - // | | - // 1----0 - // - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of paragraphs in this block (if this blocks is of type text). - repeated Paragraph paragraphs = 3; - - // Detected block type (text, image etc) for this block. - BlockType block_type = 4; - - // Confidence of the OCR results on the block. Range [0, 1]. - float confidence = 5; -} - -// Structural unit of text representing a number of words in certain order. -message Paragraph { - // Additional information detected for the paragraph. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the paragraph. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of all words in this paragraph. - repeated Word words = 3; - - // Confidence of the OCR results for the paragraph. Range [0, 1]. - float confidence = 4; -} - -// A word representation. -message Word { - // Additional information detected for the word. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the word. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of symbols in the word. - // The order of the symbols follows the natural reading order. - repeated Symbol symbols = 3; - - // Confidence of the OCR results for the word. Range [0, 1]. - float confidence = 4; -} - -// A single symbol representation. -message Symbol { - // Additional information detected for the symbol. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the symbol. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // The actual UTF-8 representation of the symbol. - string text = 3; - - // Confidence of the OCR results for the symbol. Range [0, 1]. - float confidence = 4; -} diff --git a/vision/google/cloud/vision_v1/proto/text_annotation_pb2.py b/vision/google/cloud/vision_v1/proto/text_annotation_pb2.py deleted file mode 100644 index 1b42d963bb2c..000000000000 --- a/vision/google/cloud/vision_v1/proto/text_annotation_pb2.py +++ /dev/null @@ -1,1139 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1/proto/text_annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.cloud.vision_v1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1_dot_proto_dot_geometry__pb2, -) -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1/proto/text_annotation.proto", - package="google.cloud.vision.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.vision.v1B\023TextAnnotationProtoP\001Z.google.cloud.vision.v1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xb1\x01\n\x0cTextProperty\x12S\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1.TextAnnotation.DetectedLanguage\x12L\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32\x34.google.cloud.vision.v1.TextAnnotation.DetectedBreak"\xaf\x01\n\x04Page\x12\x45\n\x08property\x18\x01 \x01(\x0b\x32\x33.google.cloud.vision.v1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12-\n\x06\x62locks\x18\x04 \x03(\x0b\x32\x1d.google.cloud.vision.v1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02"\xe6\x02\n\x05\x42lock\x12\x45\n\x08property\x18\x01 \x01(\x0b\x32\x33.google.cloud.vision.v1.TextAnnotation.TextProperty\x12:\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x35\n\nparagraphs\x18\x03 \x03(\x0b\x32!.google.cloud.vision.v1.Paragraph\x12;\n\nblock_type\x18\x04 \x01(\x0e\x32\'.google.cloud.vision.v1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05"\xcf\x01\n\tParagraph\x12\x45\n\x08property\x18\x01 \x01(\x0b\x32\x33.google.cloud.vision.v1.TextAnnotation.TextProperty\x12:\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12+\n\x05words\x18\x03 \x03(\x0b\x32\x1c.google.cloud.vision.v1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xce\x01\n\x04Word\x12\x45\n\x08property\x18\x01 \x01(\x0b\x32\x33.google.cloud.vision.v1.TextAnnotation.TextProperty\x12:\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12/\n\x07symbols\x18\x03 \x03(\x0b\x32\x1e.google.cloud.vision.v1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xad\x01\n\x06Symbol\x12\x45\n\x08property\x18\x01 \x01(\x0b\x32\x33.google.cloud.vision.v1.TextAnnotation.TextProperty\x12:\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32$.google.cloud.vision.v1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42{\n\x1a\x63om.google.cloud.vision.v1B\x13TextAnnotationProtoP\x01Z Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have their - own properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1.TextAnnotation.TextProperty] - message definition below for more detail. - - - Attributes: - pages: - List of pages detected by OCR. - text: - UTF-8 text detected on the pages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) -_sym_db.RegisterMessage(TextAnnotation.DetectedLanguage) -_sym_db.RegisterMessage(TextAnnotation.DetectedBreak) -_sym_db.RegisterMessage(TextAnnotation.TextProperty) - -Page = _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - DESCRIPTOR=_PAGE, - __module__="google.cloud.vision_v1.proto.text_annotation_pb2", - __doc__="""Detected page from OCR. - - - Attributes: - property: - Additional information detected on the page. - width: - Page width. For PDFs the unit is points. For images (including - TIFFs) the unit is pixels. - height: - Page height. For PDFs the unit is points. For images - (including TIFFs) the unit is pixels. - blocks: - List of blocks of text, images etc on this page. - confidence: - Confidence of the OCR results on the page. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Page) - ), -) -_sym_db.RegisterMessage(Page) - -Block = _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_BLOCK, - __module__="google.cloud.vision_v1.proto.text_annotation_pb2", - __doc__="""Logical element on the page. - - - Attributes: - property: - Additional information detected for the block. - bounding_box: - The bounding box for the block. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: :: - 0----1 | | 3----2 - when it's rotated 180 - degrees around the top-left corner it becomes: :: - 2----3 | | 1----0 and the vertex order will - still be (0, 1, 2, 3). - paragraphs: - List of paragraphs in this block (if this blocks is of type - text). - block_type: - Detected block type (text, image etc) for this block. - confidence: - Confidence of the OCR results on the block. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Block) - ), -) -_sym_db.RegisterMessage(Block) - -Paragraph = _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_PARAGRAPH, - __module__="google.cloud.vision_v1.proto.text_annotation_pb2", - __doc__="""Structural unit of text representing a number of words in - certain order. - - - Attributes: - property: - Additional information detected for the paragraph. - bounding_box: - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. When - a rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - words: - List of all words in this paragraph. - confidence: - Confidence of the OCR results for the paragraph. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Paragraph) - ), -) -_sym_db.RegisterMessage(Paragraph) - -Word = _reflection.GeneratedProtocolMessageType( - "Word", - (_message.Message,), - dict( - DESCRIPTOR=_WORD, - __module__="google.cloud.vision_v1.proto.text_annotation_pb2", - __doc__="""A word representation. - - - Attributes: - property: - Additional information detected for the word. - bounding_box: - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - symbols: - List of symbols in the word. The order of the symbols follows - the natural reading order. - confidence: - Confidence of the OCR results for the word. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Word) - ), -) -_sym_db.RegisterMessage(Word) - -Symbol = _reflection.GeneratedProtocolMessageType( - "Symbol", - (_message.Message,), - dict( - DESCRIPTOR=_SYMBOL, - __module__="google.cloud.vision_v1.proto.text_annotation_pb2", - __doc__="""A single symbol representation. - - - Attributes: - property: - Additional information detected for the symbol. - bounding_box: - The bounding box for the symbol. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - text: - The actual UTF-8 representation of the symbol. - confidence: - Confidence of the OCR results for the symbol. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1.Symbol) - ), -) -_sym_db.RegisterMessage(Symbol) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py b/vision/google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1/proto/web_detection.proto b/vision/google/cloud/vision_v1/proto/web_detection.proto deleted file mode 100644 index 5ba8640382f1..000000000000 --- a/vision/google/cloud/vision_v1/proto/web_detection.proto +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1;vision"; -option java_multiple_files = true; -option java_outer_classname = "WebDetectionProto"; -option java_package = "com.google.cloud.vision.v1"; -option objc_class_prefix = "GCVN"; - -// Relevant information for the image from the Internet. -message WebDetection { - // Entity deduced from similar images on the Internet. - message WebEntity { - // Opaque entity ID. - string entity_id = 1; - - // Overall relevancy score for the entity. - // Not normalized and not comparable across different image queries. - float score = 2; - - // Canonical description of the entity, in English. - string description = 3; - } - - // Metadata for online images. - message WebImage { - // The result image URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the image. - float score = 2; - } - - // Metadata for web pages. - message WebPage { - // The result web page URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the web page. - float score = 2; - - // Title for the web page, may contain HTML markups. - string page_title = 3; - - // Fully matching images on the page. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 4; - - // Partial matching images on the page. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its - // crops. - repeated WebImage partial_matching_images = 5; - } - - // Label to provide extra metadata for the web detection. - message WebLabel { - // Label for extra metadata. - string label = 1; - - // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - // For more information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - } - - // Deduced entities from similar images on the Internet. - repeated WebEntity web_entities = 1; - - // Fully matching images from the Internet. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 2; - - // Partial matching images from the Internet. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its crops. - repeated WebImage partial_matching_images = 3; - - // Web pages containing the matching images from the Internet. - repeated WebPage pages_with_matching_images = 4; - - // The visually similar image results. - repeated WebImage visually_similar_images = 6; - - // The service's best guess as to the topic of the request image. - // Inferred from similar images on the open web. - repeated WebLabel best_guess_labels = 8; -} diff --git a/vision/google/cloud/vision_v1/proto/web_detection_pb2.py b/vision/google/cloud/vision_v1/proto/web_detection_pb2.py deleted file mode 100644 index f1f80fd34eed..000000000000 --- a/vision/google/cloud/vision_v1/proto/web_detection_pb2.py +++ /dev/null @@ -1,617 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1/proto/web_detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1/proto/web_detection.proto", - package="google.cloud.vision.v1", - syntax="proto3", - serialized_options=_b( - "\n\032com.google.cloud.vision.v1B\021WebDetectionProtoP\001Z>> from google.cloud import vision_v1p1beta1 - >>> - >>> client = vision_v1p1beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_images(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p1beta1.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_v1p1beta1.types.AnnotateImageRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p1beta1.types.BatchAnnotateImagesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_images, - default_retry=self._method_configs["BatchAnnotateImages"].retry, - default_timeout=self._method_configs["BatchAnnotateImages"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateImagesRequest(requests=requests) - return self._inner_api_calls["batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/vision/google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py b/vision/google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py deleted file mode 100644 index 956b15714108..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py +++ /dev/null @@ -1,28 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p1beta1.ImageAnnotator": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - } - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p1beta1/gapic/transports/__init__.py b/vision/google/cloud/vision_v1p1beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py b/vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py deleted file mode 100644 index 54c9b4f482fe..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py +++ /dev/null @@ -1,124 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers - -from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2_grpc - - -class ImageAnnotatorGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p1beta1 ImageAnnotator API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "image_annotator_stub": image_annotator_pb2_grpc.ImageAnnotatorStub(channel) - } - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`. - - Run image detection and annotation for a batch of images. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateImages diff --git a/vision/google/cloud/vision_v1p1beta1/proto/__init__.py b/vision/google/cloud/vision_v1p1beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p1beta1/proto/geometry.proto b/vision/google/cloud/vision_v1p1beta1/proto/geometry.proto deleted file mode 100644 index 6d46d9c342ec..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/geometry.proto +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p1beta1; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.vision.v1p1beta1"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; -} - -// A 3D position in the image, used primarily for Face detection landmarks. -// A valid Position must have both x and y coordinates. -// The position coordinates are in the same scale as the original image. -message Position { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; - - // Z coordinate (or depth). - float z = 3; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2.py b/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2.py deleted file mode 100644 index 5ddad26ccdb0..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,270 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p1beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p1beta1/proto/geometry.proto", - package="google.cloud.vision.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p1beta1B\rGeometryProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n2google/cloud/vision_v1p1beta1/proto/geometry.proto\x12\x1dgoogle.cloud.vision.v1p1beta1"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"G\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p1beta1.Vertex"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42|\n!com.google.cloud.vision.v1p1beta1B\rGeometryProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\xf8\x01\x01\x62\x06proto3' - ), -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.vision.v1p1beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p1beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p1beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=85, - serialized_end=115, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.vision.v1p1beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.vision.v1p1beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=117, - serialized_end=188, -) - - -_POSITION = _descriptor.Descriptor( - name="Position", - full_name="google.cloud.vision.v1p1beta1.Position", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p1beta1.Position.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p1beta1.Position.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="z", - full_name="google.cloud.vision.v1p1beta1.Position.z", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=190, - serialized_end=233, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -DESCRIPTOR.message_types_by_name["Position"] = _POSITION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.vision_v1p1beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.vision_v1p1beta1.proto.geometry_pb2", - __doc__="""A bounding polygon for the detected image annotation. - - - Attributes: - vertices: - The bounding polygon vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - -Position = _reflection.GeneratedProtocolMessageType( - "Position", - (_message.Message,), - dict( - DESCRIPTOR=_POSITION, - __module__="google.cloud.vision_v1p1beta1.proto.geometry_pb2", - __doc__="""A 3D position in the image, used primarily for Face - detection landmarks. A valid Position must have both x and y - coordinates. The position coordinates are in the same scale as the - original image. - - - Attributes: - x: - X coordinate. - y: - Y coordinate. - z: - Z coordinate (or depth). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Position) - ), -) -_sym_db.RegisterMessage(Position) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py b/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator.proto b/vision/google/cloud/vision_v1p1beta1/proto/image_annotator.proto deleted file mode 100644 index 4869a3311730..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator.proto +++ /dev/null @@ -1,592 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p1beta1/geometry.proto"; -import "google/cloud/vision/v1p1beta1/text_annotation.proto"; -import "google/cloud/vision/v1p1beta1/web_detection.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; -import "google/type/latlng.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ImageAnnotatorProto"; -option java_package = "com.google.cloud.vision.v1p1beta1"; - -// 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. -service ImageAnnotator { - // Run image detection and annotation for a batch of images. - rpc BatchAnnotateImages(BatchAnnotateImagesRequest) - returns (BatchAnnotateImagesResponse) { - option (google.api.http) = { - post: "/v1p1beta1/images:annotate" - body: "*" - }; - } -} - -// Users describe the type of Google Cloud Vision API tasks to perform over -// images by using *Feature*s. Each Feature indicates a type of image -// detection task to perform. Features encode the Cloud Vision API -// vertical to operate on and the number of top-scoring results to return. -message Feature { - // Type of image feature. - enum Type { - // Unspecified feature type. - TYPE_UNSPECIFIED = 0; - - // Run face detection. - FACE_DETECTION = 1; - - // Run landmark detection. - LANDMARK_DETECTION = 2; - - // Run logo detection. - LOGO_DETECTION = 3; - - // Run label detection. - LABEL_DETECTION = 4; - - // Run OCR. - TEXT_DETECTION = 5; - - // Run dense text document OCR. Takes precedence when both - // DOCUMENT_TEXT_DETECTION and TEXT_DETECTION are present. - DOCUMENT_TEXT_DETECTION = 11; - - // Run computer vision models to compute image safe-search properties. - SAFE_SEARCH_DETECTION = 6; - - // Compute a set of image properties, such as the image's dominant colors. - IMAGE_PROPERTIES = 7; - - // Run crop hints. - CROP_HINTS = 9; - - // Run web detection. - WEB_DETECTION = 10; - } - - // The feature type. - Type type = 1; - - // Maximum number of results of this type. - int32 max_results = 2; - - // Model to use for the feature. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// External image source (Google Cloud Storage image location). -message ImageSource { - // NOTE: For new code `image_uri` below is preferred. - // Google Cloud Storage image URI, which must be in the following form: - // `gs://bucket_name/object_name` (for details, see - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris)). - // NOTE: Cloud Storage object versioning is not supported. - string gcs_image_uri = 1; - - // Image URI which supports: - // 1) Google Cloud Storage image URI, which must be in the following form: - // `gs://bucket_name/object_name` (for details, see - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris)). - // NOTE: Cloud Storage object versioning is not supported. - // 2) Publicly accessible image HTTP/HTTPS URL. - // This is preferred over the legacy `gcs_image_uri` above. When both - // `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - // precedence. - string image_uri = 2; -} - -// Client image to perform Google Cloud Vision API tasks over. -message Image { - // Image content, represented as a stream of bytes. - // Note: as with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 1; - - // Google Cloud Storage image location. If both `content` and `source` - // are provided for an image, `content` takes precedence and is - // used to perform the image annotation request. - ImageSource source = 2; -} - -// A face annotation object contains the results of face detection. -message FaceAnnotation { - // A face-specific landmark (for example, a face feature). - message Landmark { - // 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. - enum Type { - // Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0; - - // Left eye. - LEFT_EYE = 1; - - // Right eye. - RIGHT_EYE = 2; - - // Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3; - - // Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4; - - // Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5; - - // Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6; - - // Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7; - - // Nose tip. - NOSE_TIP = 8; - - // Upper lip. - UPPER_LIP = 9; - - // Lower lip. - LOWER_LIP = 10; - - // Mouth left. - MOUTH_LEFT = 11; - - // Mouth right. - MOUTH_RIGHT = 12; - - // Mouth center. - MOUTH_CENTER = 13; - - // Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14; - - // Nose, bottom left. - NOSE_BOTTOM_LEFT = 15; - - // Nose, bottom center. - NOSE_BOTTOM_CENTER = 16; - - // Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17; - - // Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18; - - // Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19; - - // Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20; - - // Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21; - - // Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22; - - // Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23; - - // Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24; - - // Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25; - - // Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26; - - // Left ear tragion. - LEFT_EAR_TRAGION = 27; - - // Right ear tragion. - RIGHT_EAR_TRAGION = 28; - - // Left eye pupil. - LEFT_EYE_PUPIL = 29; - - // Right eye pupil. - RIGHT_EYE_PUPIL = 30; - - // Forehead glabella. - FOREHEAD_GLABELLA = 31; - - // Chin gnathion. - CHIN_GNATHION = 32; - - // Chin left gonion. - CHIN_LEFT_GONION = 33; - - // Chin right gonion. - CHIN_RIGHT_GONION = 34; - } - - // Face landmark type. - Type type = 3; - - // Face landmark position. - Position position = 4; - } - - // The bounding polygon around the face. The coordinates of the bounding box - // are in the original image's scale, as returned in `ImageParams`. - // The bounding box is computed to "frame" the face in accordance with human - // expectations. It is based on the landmarker results. - // Note that one or more x and/or y coordinates may not be generated in the - // `BoundingPoly` (the polygon will be unbounded) if only a partial face - // appears in the image to be annotated. - BoundingPoly bounding_poly = 1; - - // The `fd_bounding_poly` bounding polygon is tighter than the - // `boundingPoly`, and encloses only the skin part of the face. Typically, it - // is used to eliminate the face from any image analysis that detects the - // "amount of skin" visible in an image. It is not based on the - // landmarker results, only on the initial face detection, hence - // the fd (face detection) prefix. - BoundingPoly fd_bounding_poly = 2; - - // Detected face landmarks. - repeated Landmark landmarks = 3; - - // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - // of the face relative to the image vertical about the axis perpendicular to - // the face. Range [-180,180]. - float roll_angle = 4; - - // Yaw angle, which indicates the leftward/rightward angle that the face is - // pointing relative to the vertical plane perpendicular to the image. Range - // [-180,180]. - float pan_angle = 5; - - // Pitch angle, which indicates the upwards/downwards angle that the face is - // pointing relative to the image's horizontal plane. Range [-180,180]. - float tilt_angle = 6; - - // Detection confidence. Range [0, 1]. - float detection_confidence = 7; - - // Face landmarking confidence. Range [0, 1]. - float landmarking_confidence = 8; - - // Joy likelihood. - Likelihood joy_likelihood = 9; - - // Sorrow likelihood. - Likelihood sorrow_likelihood = 10; - - // Anger likelihood. - Likelihood anger_likelihood = 11; - - // Surprise likelihood. - Likelihood surprise_likelihood = 12; - - // Under-exposed likelihood. - Likelihood under_exposed_likelihood = 13; - - // Blurred likelihood. - Likelihood blurred_likelihood = 14; - - // Headwear likelihood. - Likelihood headwear_likelihood = 15; -} - -// Detected entity location information. -message LocationInfo { - // lat/long location coordinates. - google.type.LatLng lat_lng = 1; -} - -// A `Property` consists of a user-supplied name/value pair. -message Property { - // Name of the property. - string name = 1; - - // Value of the property. - string value = 2; - - // Value of numeric properties. - uint64 uint64_value = 3; -} - -// Set of detected entity features. -message EntityAnnotation { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string mid = 1; - - // The language code for the locale in which the entity textual - // `description` is expressed. - string locale = 2; - - // Entity textual description, expressed in its `locale` language. - string description = 3; - - // Overall score of the result. Range [0, 1]. - float score = 4; - - // The accuracy of the entity detection in an image. - // For example, for an image in which the "Eiffel Tower" entity is detected, - // this field represents the confidence that there is a tower in the query - // image. Range [0, 1]. - float confidence = 5; - - // The relevancy of the ICA (Image Content Annotation) label to the - // image. For example, the relevancy of "tower" is likely higher to an image - // containing the detected "Eiffel Tower" than to an image containing a - // detected distant towering building, even though the confidence that - // there is a tower in each image may be the same. Range [0, 1]. - float topicality = 6; - - // Image region to which this entity belongs. Not produced - // for `LABEL_DETECTION` features. - BoundingPoly bounding_poly = 7; - - // The location information for the detected entity. Multiple - // `LocationInfo` elements can be present because one location may - // indicate the location of the scene in the image, and another location - // may indicate the location of the place where the image was taken. - // Location information is usually present for landmarks. - repeated LocationInfo locations = 8; - - // Some entities may have optional user-supplied `Property` (name/value) - // fields, such a score or string that qualifies the entity. - repeated Property properties = 9; -} - -// Set of features pertaining to the image, computed by computer vision -// methods over safe-search verticals (for example, adult, spoof, medical, -// violence). -message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. Adult content may - // contain elements such as nudity, pornographic images or cartoons, or - // sexual activities. - Likelihood adult = 1; - - // Spoof likelihood. The likelihood that an modification - // was made to the image's canonical version to make it appear - // funny or offensive. - Likelihood spoof = 2; - - // Likelihood that this is a medical image. - Likelihood medical = 3; - - // Likelihood that this image contains violent content. - Likelihood violence = 4; - - // Likelihood that the request image contains racy content. Racy content may - // include (but is not limited to) skimpy or sheer clothing, strategically - // covered nudity, lewd or provocative poses, or close-ups of sensitive - // body areas. - Likelihood racy = 9; -} - -// Rectangle determined by min and max `LatLng` pairs. -message LatLongRect { - // Min lat/long pair. - google.type.LatLng min_lat_lng = 1; - - // Max lat/long pair. - google.type.LatLng max_lat_lng = 2; -} - -// Color information consists of RGB channels, score, and the fraction of -// the image that the color occupies in the image. -message ColorInfo { - // RGB components of the color. - google.type.Color color = 1; - - // Image-specific score for this color. Value in range [0, 1]. - float score = 2; - - // The fraction of pixels the color occupies in the image. - // Value in range [0, 1]. - float pixel_fraction = 3; -} - -// Set of dominant colors and their corresponding scores. -message DominantColorsAnnotation { - // RGB color values with their score and pixel fraction. - repeated ColorInfo colors = 1; -} - -// Stores image properties, such as dominant colors. -message ImageProperties { - // If present, dominant colors completed successfully. - DominantColorsAnnotation dominant_colors = 1; -} - -// Single crop hint that is used to generate a new crop when serving an image. -message CropHint { - // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale, as returned in `ImageParams`. - BoundingPoly bounding_poly = 1; - - // Confidence of this being a salient region. Range [0, 1]. - float confidence = 2; - - // Fraction of importance of this salient region with respect to the original - // image. - float importance_fraction = 3; -} - -// Set of crop hints that are used to generate new crops when serving images. -message CropHintsAnnotation { - // Crop hint results. - repeated CropHint crop_hints = 1; -} - -// Parameters for crop hints annotation request. -message CropHintsParams { - // Aspect ratios in floats, representing the ratio of the width to the height - // of the image. For example, if the desired aspect ratio is 4/3, the - // corresponding float value should be 1.33333. If not specified, the - // best possible crop is returned. The number of provided aspect ratios is - // limited to a maximum of 16; any aspect ratios provided after the 16th are - // ignored. - repeated float aspect_ratios = 1; -} - -// Parameters for web detection request. -message WebDetectionParams { - // Whether to include results derived from the geo information in the image. - bool include_geo_results = 2; -} - -// Image context and/or feature-specific parameters. -message ImageContext { - // lat/long rectangle that specifies the location of the image. - LatLongRect lat_long_rect = 1; - - // List of languages to use for TEXT_DETECTION. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Text detection returns an - // error if one or more of the specified languages is not one of the - // [supported languages](/vision/docs/languages). - repeated string language_hints = 2; - - // Parameters for crop hints annotation request. - CropHintsParams crop_hints_params = 4; - - // Parameters for web detection. - WebDetectionParams web_detection_params = 6; -} - -// Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features. -message AnnotateImageRequest { - // The image to be processed. - Image image = 1; - - // Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image. - ImageContext image_context = 3; -} - -// Response to an image annotation request. -message AnnotateImageResponse { - // If present, face detection has completed successfully. - repeated FaceAnnotation face_annotations = 1; - - // If present, landmark detection has completed successfully. - repeated EntityAnnotation landmark_annotations = 2; - - // If present, logo detection has completed successfully. - repeated EntityAnnotation logo_annotations = 3; - - // If present, label detection has completed successfully. - repeated EntityAnnotation label_annotations = 4; - - // If present, text (OCR) detection has completed successfully. - repeated EntityAnnotation text_annotations = 5; - - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. - // This annotation provides the structural hierarchy for the OCR detected - // text. - TextAnnotation full_text_annotation = 12; - - // If present, safe-search annotation has completed successfully. - SafeSearchAnnotation safe_search_annotation = 6; - - // If present, image properties were extracted successfully. - ImageProperties image_properties_annotation = 8; - - // If present, crop hints have completed successfully. - CropHintsAnnotation crop_hints_annotation = 11; - - // If present, web detection has completed successfully. - WebDetection web_detection = 13; - - // If set, represents the error message for the operation. - // Note that filled-in image annotations are guaranteed to be - // correct, even when `error` is set. - google.rpc.Status error = 9; -} - -// Multiple image annotation requests are batched into a single service call. -message BatchAnnotateImagesRequest { - // Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1; -} - -// Response to a batch image annotation request. -message BatchAnnotateImagesResponse { - // Individual responses to image annotation requests within the batch. - repeated AnnotateImageResponse responses = 1; -} - -// A bucketized representation of likelihood, which is intended to give clients -// highly stable results across model upgrades. -enum Likelihood { - // Unknown likelihood. - UNKNOWN = 0; - - // It is very unlikely that the image belongs to the specified vertical. - VERY_UNLIKELY = 1; - - // It is unlikely that the image belongs to the specified vertical. - UNLIKELY = 2; - - // It is possible that the image belongs to the specified vertical. - POSSIBLE = 3; - - // It is likely that the image belongs to the specified vertical. - LIKELY = 4; - - // It is very likely that the image belongs to the specified vertical. - VERY_LIKELY = 5; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py b/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py deleted file mode 100644 index 4b6d496fd3eb..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py +++ /dev/null @@ -1,2981 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p1beta1/proto/image_annotator.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p1beta1.proto import ( - text_annotation_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_text__annotation__pb2, -) -from google.cloud.vision_v1p1beta1.proto import ( - web_detection_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_web__detection__pb2, -) -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p1beta1/proto/image_annotator.proto", - package="google.cloud.vision.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p1beta1B\023ImageAnnotatorProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p1beta1/proto/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p1beta1/proto/geometry.proto\x1a\x39google/cloud/vision_v1p1beta1/proto/text_annotation.proto\x1a\x37google/cloud/vision_v1p1beta1/proto/web_detection.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto"\xe1\x02\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p1beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t"\xf6\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p1beta1.ImageSource"\x9b\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p1beta1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xbc\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p1beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p1beta1.Property"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p1beta1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p1beta1.ColorInfo"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p1beta1.DominantColorsAnnotation"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p1beta1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\x85\x02\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p1beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p1beta1.CropHintsParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p1beta1.WebDetectionParams"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p1beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p1beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.ImageContext"\xc2\x06\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p1beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p1beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p1beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p1beta1.EntityAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p1beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p1beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p1beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p1beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p1beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.WebDetection\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status"c\n\x1a\x42\x61tchAnnotateImagesRequest\x12\x45\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p1beta1.AnnotateImageRequest"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.AnnotateImageResponse*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xc6\x01\n\x0eImageAnnotator\x12\xb3\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse"%\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p1beta1/images:annotate:\x01*B\x82\x01\n!com.google.cloud.vision.v1p1beta1B\x13ImageAnnotatorProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_text__annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_web__detection__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - ], -) - -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.vision.v1p1beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=5631, - serialized_end=5732, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -UNKNOWN = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_FEATURE_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p1beta1.Feature.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LANDMARK_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOGO_DETECTION", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DOCUMENT_TEXT_DETECTION", - index=6, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SAFE_SEARCH_DETECTION", - index=7, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_PROPERTIES", - index=8, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CROP_HINTS", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WEB_DETECTION", - index=10, - number=10, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=474, - serialized_end=720, -) -_sym_db.RegisterEnumDescriptor(_FEATURE_TYPE) - -_FACEANNOTATION_LANDMARK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_LANDMARK", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_LEFT_EYEBROW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_LEFT_EYEBROW", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_RIGHT_EYEBROW", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_RIGHT_EYEBROW", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MIDPOINT_BETWEEN_EYES", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_TIP", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPPER_LIP", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOWER_LIP", index=10, number=10, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_LEFT", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_RIGHT", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_CENTER", index=13, number=13, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_RIGHT", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_LEFT", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_CENTER", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_TOP_BOUNDARY", - index=17, - number=17, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_RIGHT_CORNER", - index=18, - number=18, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_BOTTOM_BOUNDARY", - index=19, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_LEFT_CORNER", - index=20, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_TOP_BOUNDARY", - index=21, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_RIGHT_CORNER", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_BOTTOM_BOUNDARY", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_LEFT_CORNER", - index=24, - number=24, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYEBROW_UPPER_MIDPOINT", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYEBROW_UPPER_MIDPOINT", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EAR_TRAGION", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EAR_TRAGION", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_PUPIL", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_PUPIL", - index=30, - number=30, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FOREHEAD_GLABELLA", - index=31, - number=31, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_GNATHION", - index=32, - number=32, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_LEFT_GONION", - index=33, - number=33, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_RIGHT_GONION", - index=34, - number=34, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1865, - serialized_end=2685, -) -_sym_db.RegisterEnumDescriptor(_FACEANNOTATION_LANDMARK_TYPE) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="google.cloud.vision.v1p1beta1.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p1beta1.Feature.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_results", - full_name="google.cloud.vision.v1p1beta1.Feature.max_results", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.vision.v1p1beta1.Feature.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FEATURE_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=367, - serialized_end=720, -) - - -_IMAGESOURCE = _descriptor.Descriptor( - name="ImageSource", - full_name="google.cloud.vision.v1p1beta1.ImageSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_image_uri", - full_name="google.cloud.vision.v1p1beta1.ImageSource.gcs_image_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.vision.v1p1beta1.ImageSource.image_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=722, - serialized_end=777, -) - - -_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.vision.v1p1beta1.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.vision.v1p1beta1.Image.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.cloud.vision.v1p1beta1.Image.source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=779, - serialized_end=863, -) - - -_FACEANNOTATION_LANDMARK = _descriptor.Descriptor( - name="Landmark", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.type", - index=0, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="position", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark.position", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FACEANNOTATION_LANDMARK_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1718, - serialized_end=2685, -) - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fd_bounding_poly", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.fd_bounding_poly", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarks", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.landmarks", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="roll_angle", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.roll_angle", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pan_angle", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.pan_angle", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tilt_angle", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.tilt_angle", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detection_confidence", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.detection_confidence", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarking_confidence", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.landmarking_confidence", - index=7, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="joy_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.joy_likelihood", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sorrow_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.sorrow_likelihood", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="anger_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.anger_likelihood", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="surprise_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.surprise_likelihood", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="under_exposed_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.under_exposed_likelihood", - index=12, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blurred_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.blurred_likelihood", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="headwear_likelihood", - full_name="google.cloud.vision.v1p1beta1.FaceAnnotation.headwear_likelihood", - index=14, - number=15, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FACEANNOTATION_LANDMARK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=866, - serialized_end=2685, -) - - -_LOCATIONINFO = _descriptor.Descriptor( - name="LocationInfo", - full_name="google.cloud.vision.v1p1beta1.LocationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.vision.v1p1beta1.LocationInfo.lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2687, - serialized_end=2739, -) - - -_PROPERTY = _descriptor.Descriptor( - name="Property", - full_name="google.cloud.vision.v1p1beta1.Property", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p1beta1.Property.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p1beta1.Property.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uint64_value", - full_name="google.cloud.vision.v1p1beta1.Property.uint64_value", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2741, - serialized_end=2802, -) - - -_ENTITYANNOTATION = _descriptor.Descriptor( - name="EntityAnnotation", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locale", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.locale", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topicality", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.topicality", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.bounding_poly", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.locations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="properties", - full_name="google.cloud.vision.v1p1beta1.EntityAnnotation.properties", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2805, - serialized_end=3121, -) - - -_SAFESEARCHANNOTATION = _descriptor.Descriptor( - name="SafeSearchAnnotation", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="adult", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation.adult", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spoof", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation.spoof", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="medical", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation.medical", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violence", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation.violence", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="racy", - full_name="google.cloud.vision.v1p1beta1.SafeSearchAnnotation.racy", - index=4, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3124, - serialized_end=3440, -) - - -_LATLONGRECT = _descriptor.Descriptor( - name="LatLongRect", - full_name="google.cloud.vision.v1p1beta1.LatLongRect", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min_lat_lng", - full_name="google.cloud.vision.v1p1beta1.LatLongRect.min_lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_lat_lng", - full_name="google.cloud.vision.v1p1beta1.LatLongRect.max_lat_lng", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3442, - serialized_end=3539, -) - - -_COLORINFO = _descriptor.Descriptor( - name="ColorInfo", - full_name="google.cloud.vision.v1p1beta1.ColorInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.vision.v1p1beta1.ColorInfo.color", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p1beta1.ColorInfo.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pixel_fraction", - full_name="google.cloud.vision.v1p1beta1.ColorInfo.pixel_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3541, - serialized_end=3626, -) - - -_DOMINANTCOLORSANNOTATION = _descriptor.Descriptor( - name="DominantColorsAnnotation", - full_name="google.cloud.vision.v1p1beta1.DominantColorsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="colors", - full_name="google.cloud.vision.v1p1beta1.DominantColorsAnnotation.colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3628, - serialized_end=3712, -) - - -_IMAGEPROPERTIES = _descriptor.Descriptor( - name="ImageProperties", - full_name="google.cloud.vision.v1p1beta1.ImageProperties", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dominant_colors", - full_name="google.cloud.vision.v1p1beta1.ImageProperties.dominant_colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3714, - serialized_end=3813, -) - - -_CROPHINT = _descriptor.Descriptor( - name="CropHint", - full_name="google.cloud.vision.v1p1beta1.CropHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p1beta1.CropHint.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.CropHint.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="importance_fraction", - full_name="google.cloud.vision.v1p1beta1.CropHint.importance_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3815, - serialized_end=3942, -) - - -_CROPHINTSANNOTATION = _descriptor.Descriptor( - name="CropHintsAnnotation", - full_name="google.cloud.vision.v1p1beta1.CropHintsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crop_hints", - full_name="google.cloud.vision.v1p1beta1.CropHintsAnnotation.crop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3944, - serialized_end=4026, -) - - -_CROPHINTSPARAMS = _descriptor.Descriptor( - name="CropHintsParams", - full_name="google.cloud.vision.v1p1beta1.CropHintsParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="aspect_ratios", - full_name="google.cloud.vision.v1p1beta1.CropHintsParams.aspect_ratios", - index=0, - number=1, - type=2, - cpp_type=6, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4028, - serialized_end=4068, -) - - -_WEBDETECTIONPARAMS = _descriptor.Descriptor( - name="WebDetectionParams", - full_name="google.cloud.vision.v1p1beta1.WebDetectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="include_geo_results", - full_name="google.cloud.vision.v1p1beta1.WebDetectionParams.include_geo_results", - index=0, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4070, - serialized_end=4119, -) - - -_IMAGECONTEXT = _descriptor.Descriptor( - name="ImageContext", - full_name="google.cloud.vision.v1p1beta1.ImageContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_long_rect", - full_name="google.cloud.vision.v1p1beta1.ImageContext.lat_long_rect", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.vision.v1p1beta1.ImageContext.language_hints", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_params", - full_name="google.cloud.vision.v1p1beta1.ImageContext.crop_hints_params", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection_params", - full_name="google.cloud.vision.v1p1beta1.ImageContext.web_detection_params", - index=3, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4122, - serialized_end=4383, -) - - -_ANNOTATEIMAGEREQUEST = _descriptor.Descriptor( - name="AnnotateImageRequest", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageRequest.image", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4386, - serialized_end=4587, -) - - -_ANNOTATEIMAGERESPONSE = _descriptor.Descriptor( - name="AnnotateImageResponse", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.face_annotations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmark_annotations", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.landmark_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logo_annotations", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.logo_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_annotations", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.text_annotations", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_text_annotation", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.full_text_annotation", - index=5, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="safe_search_annotation", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.safe_search_annotation", - index=6, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_properties_annotation", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.image_properties_annotation", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_annotation", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.crop_hints_annotation", - index=8, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.web_detection", - index=9, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.vision.v1p1beta1.AnnotateImageResponse.error", - index=10, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4590, - serialized_end=5424, -) - - -_BATCHANNOTATEIMAGESREQUEST = _descriptor.Descriptor( - name="BatchAnnotateImagesRequest", - full_name="google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5426, - serialized_end=5525, -) - - -_BATCHANNOTATEIMAGESRESPONSE = _descriptor.Descriptor( - name="BatchAnnotateImagesResponse", - full_name="google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5527, - serialized_end=5629, -) - -_FEATURE.fields_by_name["type"].enum_type = _FEATURE_TYPE -_FEATURE_TYPE.containing_type = _FEATURE -_IMAGE.fields_by_name["source"].message_type = _IMAGESOURCE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "type" -].enum_type = _FACEANNOTATION_LANDMARK_TYPE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "position" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._POSITION -) -_FACEANNOTATION_LANDMARK.containing_type = _FACEANNOTATION -_FACEANNOTATION_LANDMARK_TYPE.containing_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name[ - "fd_bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name["landmarks"].message_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name["joy_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["sorrow_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["anger_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["surprise_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["under_exposed_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["blurred_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["headwear_likelihood"].enum_type = _LIKELIHOOD -_LOCATIONINFO.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_ENTITYANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_ENTITYANNOTATION.fields_by_name["locations"].message_type = _LOCATIONINFO -_ENTITYANNOTATION.fields_by_name["properties"].message_type = _PROPERTY -_SAFESEARCHANNOTATION.fields_by_name["adult"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["spoof"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["medical"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["violence"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["racy"].enum_type = _LIKELIHOOD -_LATLONGRECT.fields_by_name[ - "min_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LATLONGRECT.fields_by_name[ - "max_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_COLORINFO.fields_by_name["color"].message_type = google_dot_type_dot_color__pb2._COLOR -_DOMINANTCOLORSANNOTATION.fields_by_name["colors"].message_type = _COLORINFO -_IMAGEPROPERTIES.fields_by_name[ - "dominant_colors" -].message_type = _DOMINANTCOLORSANNOTATION -_CROPHINT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CROPHINTSANNOTATION.fields_by_name["crop_hints"].message_type = _CROPHINT -_IMAGECONTEXT.fields_by_name["lat_long_rect"].message_type = _LATLONGRECT -_IMAGECONTEXT.fields_by_name["crop_hints_params"].message_type = _CROPHINTSPARAMS -_IMAGECONTEXT.fields_by_name["web_detection_params"].message_type = _WEBDETECTIONPARAMS -_ANNOTATEIMAGEREQUEST.fields_by_name["image"].message_type = _IMAGE -_ANNOTATEIMAGEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ANNOTATEIMAGEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ANNOTATEIMAGERESPONSE.fields_by_name["face_annotations"].message_type = _FACEANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "landmark_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "logo_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "label_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "text_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "full_text_annotation" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_text__annotation__pb2._TEXTANNOTATION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "safe_search_annotation" -].message_type = _SAFESEARCHANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "image_properties_annotation" -].message_type = _IMAGEPROPERTIES -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "crop_hints_annotation" -].message_type = _CROPHINTSANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "web_detection" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_web__detection__pb2._WEBDETECTION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_BATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEIMAGEREQUEST -_BATCHANNOTATEIMAGESRESPONSE.fields_by_name[ - "responses" -].message_type = _ANNOTATEIMAGERESPONSE -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["ImageSource"] = _IMAGESOURCE -DESCRIPTOR.message_types_by_name["Image"] = _IMAGE -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["LocationInfo"] = _LOCATIONINFO -DESCRIPTOR.message_types_by_name["Property"] = _PROPERTY -DESCRIPTOR.message_types_by_name["EntityAnnotation"] = _ENTITYANNOTATION -DESCRIPTOR.message_types_by_name["SafeSearchAnnotation"] = _SAFESEARCHANNOTATION -DESCRIPTOR.message_types_by_name["LatLongRect"] = _LATLONGRECT -DESCRIPTOR.message_types_by_name["ColorInfo"] = _COLORINFO -DESCRIPTOR.message_types_by_name["DominantColorsAnnotation"] = _DOMINANTCOLORSANNOTATION -DESCRIPTOR.message_types_by_name["ImageProperties"] = _IMAGEPROPERTIES -DESCRIPTOR.message_types_by_name["CropHint"] = _CROPHINT -DESCRIPTOR.message_types_by_name["CropHintsAnnotation"] = _CROPHINTSANNOTATION -DESCRIPTOR.message_types_by_name["CropHintsParams"] = _CROPHINTSPARAMS -DESCRIPTOR.message_types_by_name["WebDetectionParams"] = _WEBDETECTIONPARAMS -DESCRIPTOR.message_types_by_name["ImageContext"] = _IMAGECONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageRequest"] = _ANNOTATEIMAGEREQUEST -DESCRIPTOR.message_types_by_name["AnnotateImageResponse"] = _ANNOTATEIMAGERESPONSE -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesRequest" -] = _BATCHANNOTATEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesResponse" -] = _BATCHANNOTATEIMAGESRESPONSE -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Feature = _reflection.GeneratedProtocolMessageType( - "Feature", - (_message.Message,), - dict( - DESCRIPTOR=_FEATURE, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Users describe the type of Google Cloud Vision API tasks - to perform over images by using *Feature*\ s. Each Feature indicates a - type of image detection task to perform. Features encode the Cloud - Vision API vertical to operate on and the number of top-scoring results - to return. - - - Attributes: - type: - The feature type. - max_results: - Maximum number of results of this type. - model: - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Feature) - ), -) -_sym_db.RegisterMessage(Feature) - -ImageSource = _reflection.GeneratedProtocolMessageType( - "ImageSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGESOURCE, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""External image source (Google Cloud Storage image - location). - - - Attributes: - gcs_image_uri: - NOTE: For new code ``image_uri`` below is preferred. Google - Cloud Storage image URI, which must be in the following form: - ``gs://bucket_name/object_name`` (for details, see `Google - Cloud Storage Request URIs - `__). - NOTE: Cloud Storage object versioning is not supported. - image_uri: - Image URI which supports: 1) Google Cloud Storage image URI, - which must be in the following form: - ``gs://bucket_name/object_name`` (for details, see `Google - Cloud Storage Request URIs - `__). - NOTE: Cloud Storage object versioning is not supported. 2) - Publicly accessible image HTTP/HTTPS URL. This is preferred - over the legacy ``gcs_image_uri`` above. When both - ``gcs_image_uri`` and ``image_uri`` are specified, - ``image_uri`` takes precedence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.ImageSource) - ), -) -_sym_db.RegisterMessage(ImageSource) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Client image to perform Google Cloud Vision API tasks - over. - - - Attributes: - content: - Image content, represented as a stream of bytes. Note: as with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - source: - Google Cloud Storage image location. If both ``content`` and - ``source`` are provided for an image, ``content`` takes - precedence and is used to perform the image annotation - request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - Landmark=_reflection.GeneratedProtocolMessageType( - "Landmark", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION_LANDMARK, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""A face-specific landmark (for example, a face feature). - - - Attributes: - type: - Face landmark type. - position: - Face landmark position. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.FaceAnnotation.Landmark) - ), - ), - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""A face annotation object contains the results of face - detection. - - - Attributes: - bounding_poly: - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned in - ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on the - landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. - fd_bounding_poly: - The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on the - initial face detection, hence the fd (face detection) prefix. - landmarks: - Detected face landmarks. - roll_angle: - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation of the face relative to the image vertical - about the axis perpendicular to the face. Range [-180,180]. - pan_angle: - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. - tilt_angle: - Pitch angle, which indicates the upwards/downwards angle that - the face is pointing relative to the image's horizontal plane. - Range [-180,180]. - detection_confidence: - Detection confidence. Range [0, 1]. - landmarking_confidence: - Face landmarking confidence. Range [0, 1]. - joy_likelihood: - Joy likelihood. - sorrow_likelihood: - Sorrow likelihood. - anger_likelihood: - Anger likelihood. - surprise_likelihood: - Surprise likelihood. - under_exposed_likelihood: - Under-exposed likelihood. - blurred_likelihood: - Blurred likelihood. - headwear_likelihood: - Headwear likelihood. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) -_sym_db.RegisterMessage(FaceAnnotation.Landmark) - -LocationInfo = _reflection.GeneratedProtocolMessageType( - "LocationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONINFO, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Detected entity location information. - - - Attributes: - lat_lng: - lat/long location coordinates. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.LocationInfo) - ), -) -_sym_db.RegisterMessage(LocationInfo) - -Property = _reflection.GeneratedProtocolMessageType( - "Property", - (_message.Message,), - dict( - DESCRIPTOR=_PROPERTY, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""A ``Property`` consists of a user-supplied name/value - pair. - - - Attributes: - name: - Name of the property. - value: - Value of the property. - uint64_value: - Value of numeric properties. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Property) - ), -) -_sym_db.RegisterMessage(Property) - -EntityAnnotation = _reflection.GeneratedProtocolMessageType( - "EntityAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Set of detected entity features. - - - Attributes: - mid: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - locale: - The language code for the locale in which the entity textual - ``description`` is expressed. - description: - Entity textual description, expressed in its ``locale`` - language. - score: - Overall score of the result. Range [0, 1]. - confidence: - The accuracy of the entity detection in an image. For example, - for an image in which the "Eiffel Tower" entity is detected, - this field represents the confidence that there is a tower in - the query image. Range [0, 1]. - topicality: - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" than - to an image containing a detected distant towering building, - even though the confidence that there is a tower in each image - may be the same. Range [0, 1]. - bounding_poly: - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. - locations: - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place where - the image was taken. Location information is usually present - for landmarks. - properties: - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies the - entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.EntityAnnotation) - ), -) -_sym_db.RegisterMessage(EntityAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType( - "SafeSearchAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_SAFESEARCHANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Set of features pertaining to the image, computed by - computer vision methods over safe-search verticals (for example, adult, - spoof, medical, violence). - - - Attributes: - adult: - Represents the adult content likelihood for the image. Adult - content may contain elements such as nudity, pornographic - images or cartoons, or sexual activities. - spoof: - Spoof likelihood. The likelihood that an modification was made - to the image's canonical version to make it appear funny or - offensive. - medical: - Likelihood that this is a medical image. - violence: - Likelihood that this image contains violent content. - racy: - Likelihood that the request image contains racy content. Racy - content may include (but is not limited to) skimpy or sheer - clothing, strategically covered nudity, lewd or provocative - poses, or close-ups of sensitive body areas. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.SafeSearchAnnotation) - ), -) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -LatLongRect = _reflection.GeneratedProtocolMessageType( - "LatLongRect", - (_message.Message,), - dict( - DESCRIPTOR=_LATLONGRECT, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Rectangle determined by min and max ``LatLng`` pairs. - - - Attributes: - min_lat_lng: - Min lat/long pair. - max_lat_lng: - Max lat/long pair. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.LatLongRect) - ), -) -_sym_db.RegisterMessage(LatLongRect) - -ColorInfo = _reflection.GeneratedProtocolMessageType( - "ColorInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COLORINFO, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Color information consists of RGB channels, score, and the - fraction of the image that the color occupies in the image. - - - Attributes: - color: - RGB components of the color. - score: - Image-specific score for this color. Value in range [0, 1]. - pixel_fraction: - The fraction of pixels the color occupies in the image. Value - in range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.ColorInfo) - ), -) -_sym_db.RegisterMessage(ColorInfo) - -DominantColorsAnnotation = _reflection.GeneratedProtocolMessageType( - "DominantColorsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_DOMINANTCOLORSANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Set of dominant colors and their corresponding scores. - - - Attributes: - colors: - RGB color values with their score and pixel fraction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.DominantColorsAnnotation) - ), -) -_sym_db.RegisterMessage(DominantColorsAnnotation) - -ImageProperties = _reflection.GeneratedProtocolMessageType( - "ImageProperties", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPROPERTIES, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Stores image properties, such as dominant colors. - - - Attributes: - dominant_colors: - If present, dominant colors completed successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.ImageProperties) - ), -) -_sym_db.RegisterMessage(ImageProperties) - -CropHint = _reflection.GeneratedProtocolMessageType( - "CropHint", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINT, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Single crop hint that is used to generate a new crop when - serving an image. - - - Attributes: - bounding_poly: - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. - confidence: - Confidence of this being a salient region. Range [0, 1]. - importance_fraction: - Fraction of importance of this salient region with respect to - the original image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.CropHint) - ), -) -_sym_db.RegisterMessage(CropHint) - -CropHintsAnnotation = _reflection.GeneratedProtocolMessageType( - "CropHintsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Set of crop hints that are used to generate new crops when - serving images. - - - Attributes: - crop_hints: - Crop hint results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.CropHintsAnnotation) - ), -) -_sym_db.RegisterMessage(CropHintsAnnotation) - -CropHintsParams = _reflection.GeneratedProtocolMessageType( - "CropHintsParams", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSPARAMS, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Parameters for crop hints annotation request. - - - Attributes: - aspect_ratios: - Aspect ratios in floats, representing the ratio of the width - to the height of the image. For example, if the desired aspect - ratio is 4/3, the corresponding float value should be 1.33333. - If not specified, the best possible crop is returned. The - number of provided aspect ratios is limited to a maximum of - 16; any aspect ratios provided after the 16th are ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.CropHintsParams) - ), -) -_sym_db.RegisterMessage(CropHintsParams) - -WebDetectionParams = _reflection.GeneratedProtocolMessageType( - "WebDetectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTIONPARAMS, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Parameters for web detection request. - - - Attributes: - include_geo_results: - Whether to include results derived from the geo information in - the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetectionParams) - ), -) -_sym_db.RegisterMessage(WebDetectionParams) - -ImageContext = _reflection.GeneratedProtocolMessageType( - "ImageContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECONTEXT, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Image context and/or feature-specific parameters. - - - Attributes: - lat_long_rect: - lat/long rectangle that specifies the location of the image. - language_hints: - List of languages to use for TEXT\_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not needed. In rare - cases, when the language of the text in the image is known, - setting a hint will help get better results (although it will - be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. - crop_hints_params: - Parameters for crop hints annotation request. - web_detection_params: - Parameters for web detection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.ImageContext) - ), -) -_sym_db.RegisterMessage(ImageContext) - -AnnotateImageRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGEREQUEST, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Request for performing Google Cloud Vision API tasks over - a user-provided image, with user-requested features. - - - Attributes: - image: - The image to be processed. - features: - Requested features. - image_context: - Additional context that may accompany the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.AnnotateImageRequest) - ), -) -_sym_db.RegisterMessage(AnnotateImageRequest) - -AnnotateImageResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateImageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGERESPONSE, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Response to an image annotation request. - - - Attributes: - face_annotations: - If present, face detection has completed successfully. - landmark_annotations: - If present, landmark detection has completed successfully. - logo_annotations: - If present, logo detection has completed successfully. - label_annotations: - If present, label detection has completed successfully. - text_annotations: - If present, text (OCR) detection has completed successfully. - full_text_annotation: - If present, text (OCR) detection or document (OCR) text - detection has completed successfully. This annotation provides - the structural hierarchy for the OCR detected text. - safe_search_annotation: - If present, safe-search annotation has completed successfully. - image_properties_annotation: - If present, image properties were extracted successfully. - crop_hints_annotation: - If present, crop hints have completed successfully. - web_detection: - If present, web detection has completed successfully. - error: - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be correct, - even when ``error`` is set. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.AnnotateImageResponse) - ), -) -_sym_db.RegisterMessage(AnnotateImageResponse) - -BatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Multiple image annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual image annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.BatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesRequest) - -BatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p1beta1.proto.image_annotator_pb2", - __doc__="""Response to a batch image annotation request. - - - Attributes: - responses: - Individual responses to image annotation requests within the - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.BatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesResponse) - - -DESCRIPTOR._options = None - -_IMAGEANNOTATOR = _descriptor.ServiceDescriptor( - name="ImageAnnotator", - full_name="google.cloud.vision.v1p1beta1.ImageAnnotator", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=5735, - serialized_end=5933, - methods=[ - _descriptor.MethodDescriptor( - name="BatchAnnotateImages", - full_name="google.cloud.vision.v1p1beta1.ImageAnnotator.BatchAnnotateImages", - index=0, - containing_service=None, - input_type=_BATCHANNOTATEIMAGESREQUEST, - output_type=_BATCHANNOTATEIMAGESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p1beta1/images:annotate:\001*' - ), - ) - ], -) -_sym_db.RegisterServiceDescriptor(_IMAGEANNOTATOR) - -DESCRIPTOR.services_by_name["ImageAnnotator"] = _IMAGEANNOTATOR - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py b/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py deleted file mode 100644 index f945f4db9c14..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py +++ /dev/null @@ -1,53 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p1beta1.proto import ( - image_annotator_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2, -) - - -class ImageAnnotatorStub(object): - """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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchAnnotateImages = channel.unary_unary( - "/google.cloud.vision.v1p1beta1.ImageAnnotator/BatchAnnotateImages", - request_serializer=google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.FromString, - ) - - -class ImageAnnotatorServicer(object): - """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. - """ - - def BatchAnnotateImages(self, request, context): - """Run image detection and annotation for a batch of images. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ImageAnnotatorServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchAnnotateImages": grpc.unary_unary_rpc_method_handler( - servicer.BatchAnnotateImages, - request_deserializer=google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.SerializeToString, - ) - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p1beta1.ImageAnnotator", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p1beta1/proto/product_search.proto b/vision/google/cloud/vision_v1p1beta1/proto/product_search.proto deleted file mode 100644 index 85e4e0784e1c..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/product_search.proto +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/cloud/vision/v1p3beta1/product_search_service.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - - -// Parameters for a product search request. -message ProductSearchParams { - // The resource name of the catalog to search. - // - // Format is: `productSearch/catalogs/CATALOG_NAME`. - string catalog_name = 1; - - // The category to search in. - // Optional. It is inferred by the system if it is not specified. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 2; - - // The product category to search in. - // Optional. It is inferred by the system if it is not specified. - // Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`, - // `skirt`, `top`, `shorts`, and `pants`. - string product_category = 5; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - // [Deprecated] Use `bounding_poly`. - NormalizedBoundingPoly normalized_bounding_poly = 3; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - BoundingPoly bounding_poly = 9; - - // Specifies the verbosity of the product search results. - // Optional. Defaults to `BASIC`. - ProductSearchResultsView view = 4; - - // The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - string product_set = 6; - - // The list of product categories to search in. Currently, we only consider - // the first category, and either "homegoods" or "apparel" should be - // specified. - repeated string product_categories = 7; - - // The filtering expression. This can be used to restrict search results based - // on Product labels. We currently support an AND of OR of key-value - // expressions, where each expression within an OR must have the same key. - // - // For example, "(color = red OR color = blue) AND brand = Google" is - // acceptable, but not "(color = red OR brand = Google)" or "color: red". - string filter = 8; -} - -// Results for a product search request. -message ProductSearchResults { - // Information about a product. - message ProductInfo { - // Product ID. - string product_id = 1; - - // The URI of the image which matched the query image. - // - // This field is returned only if `view` is set to `FULL` in - // the request. - string image_uri = 2; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 3; - } - - // Information about a product. - message Result { - // The Product. - Product product = 1; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 2; - - // The resource name of the image from the product that is the closest match - // to the query. - string image = 3; - } - - // Product category. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 1; - - // Product category. - // Supported values are `bag` and `shoe`. - // [Deprecated] `product_category` is provided in each Product. - string product_category = 4; - - // Timestamp of the index which provided these results. Changes made after - // this time are not reflected in the current results. - google.protobuf.Timestamp index_time = 2; - - // List of detected products. - repeated ProductInfo products = 3; - - // List of results, one for each product match. - repeated Result results = 5; -} - -// Supported product search categories. -enum ProductSearchCategory { - // Default value used when a category is not specified. - PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; - - // Shoes category. - SHOES = 1; - - // Bags category. - BAGS = 2; -} - -// Specifies the fields to include in product search results. -enum ProductSearchResultsView { - // Product search results contain only `product_category` and `product_id`. - // Default value. - BASIC = 0; - - // Product search results contain `product_category`, `product_id`, - // `image_uri`, and `score`. - FULL = 1; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/product_search_service.proto b/vision/google/cloud/vision_v1p1beta1/proto/product_search_service.proto deleted file mode 100644 index 90388e36e228..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/product_search_service.proto +++ /dev/null @@ -1,825 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchServiceProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - - -// 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.v1p3beta1.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.v1p3beta1.Product] resources, named -// `projects/*/locations/*/products/*` -// -// - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named -// `projects/*/locations/*/products/*/referenceImages/*` -service ProductSearch { - // Creates and returns a new ProductSet resource. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - // 4096 characters. - rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - body: "product_set" - }; - } - - // Lists ProductSets in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - // than 1. - rpc ListProductSets(ListProductSetsRequest) returns (ListProductSetsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - }; - } - - // Gets information associated with a ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc GetProductSet(GetProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - patch: "/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}" - body: "product_set" - }; - } - - // Permanently deletes a ProductSet. All Products and ReferenceImages in the - // ProductSet will be deleted. - // - // The actual image files are not deleted from Google Cloud Storage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc DeleteProductSet(DeleteProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc CreateProduct(CreateProductRequest) returns (Product) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/products" - body: "product" - }; - } - - // Lists products in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/products" - }; - } - - // Gets information associated with a Product. - // - // Possible errors: - // - // * Returns NOT_FOUND if the Product does not exist. - rpc GetProduct(GetProductRequest) returns (Product) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // Makes changes to a Product resource. - // Only display_name, description and labels 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. - rpc UpdateProduct(UpdateProductRequest) returns (Product) { - option (google.api.http) = { - patch: "/v1p3beta1/{product.name=projects/*/locations/*/products/*}" - body: "product" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the product does not exist. - rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // 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. - rpc CreateReferenceImage(CreateReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - body: "reference_image" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the reference image does not exist. - rpc DeleteReferenceImage(DeleteReferenceImageRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc ListReferenceImages(ListReferenceImagesRequest) returns (ListReferenceImagesResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - }; - } - - // Gets information associated with a ReferenceImage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the specified image does not exist. - rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc AddProductToProductSet(AddProductToProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct" - body: "*" - }; - } - - // Removes a Product from the specified ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND If the Product is not found under the ProductSet. - rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct" - body: "*" - }; - } - - // 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. - rpc ListProductsInProductSet(ListProductsInProductSetRequest) returns (ListProductsInProductSetResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" - }; - } - - // 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.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc ImportProductSets(ImportProductSetsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets:import" - body: "*" - }; - } -} - -// A Product contains ReferenceImages. -message Product { - // A product label represented as a key-value pair. - message KeyValue { - // The key of the label attached to the product. Cannot be empty and cannot - // exceed 128 bytes. - string key = 1; - - // The value of the label attached to the product. Cannot be empty and - // cannot exceed 128 bytes. - string value = 2; - } - - // The resource name of the product. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - // - // This field is ignored when creating a product. - string name = 1; - - // The user-provided name for this Product. Must not be empty. Must be at most - // 4096 characters long. - string display_name = 2; - - // User-provided metadata to be stored with this product. Must be at most 4096 - // characters long. - string description = 3; - - // The category for the product identified by the reference image. This should - // be either "homegoods" or "apparel". - // - // This field is immutable. - string product_category = 4; - - // Key-value pairs that can be attached to a product. At query time, - // constraints can be specified based on the product_labels. - // - // Note that integer values can be provided as strings, e.g. "1199". Only - // strings with integer values can match a range-based restriction which is - // to be supported soon. - // - // Multiple values can be assigned to the same key. One product may have up to - // 100 product_labels. - repeated KeyValue product_labels = 5; -} - -// A ProductSet contains Products. A ProductSet can contain a maximum of 1 -// million reference images. If the limit is exceeded, periodic indexing will -// fail. -message ProductSet { - // The resource name of the ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - // - // This field is ignored when creating a ProductSet. - string name = 1; - - // The user-provided name for this ProductSet. Must not be empty. Must be at - // most 4096 characters long. - string display_name = 2; - - // Output only. The time at which this ProductSet was last indexed. Query - // results will reflect all updates before this time. If this ProductSet has - // never been indexed, this field is 0. - // - // This field is ignored when creating a ProductSet. - google.protobuf.Timestamp index_time = 3; - - // Output only. If there was an error with indexing the product set, the field - // is populated. - // - // This field is ignored when creating a ProductSet. - google.rpc.Status index_error = 4; -} - -// A `ReferenceImage` represents a product image and its associated metadata, -// such as bounding boxes. -message ReferenceImage { - // The resource name of the reference image. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - // - // This field is ignored when creating a reference image. - string name = 1; - - // The Google Cloud Storage URI of the reference image. - // - // The URI must start with `gs://`. - // - // Required. - string uri = 2; - - // Bounding polygons around the areas of interest in the reference image. - // Optional. If this field is empty, the system will try to detect regions of - // interest. At most 10 bounding polygons will be used. - // - // The provided shape is converted into a non-rotated rectangle. Once - // converted, the small edge of the rectangle must be greater than or equal - // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - // is not). - repeated BoundingPoly bounding_polys = 3; -} - -// Request message for the `CreateProduct` method. -message CreateProductRequest { - // The project in which the Product should be created. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The product to create. - Product product = 2; - - // A user-supplied resource id for this Product. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_id = 3; -} - -// Request message for the `ListProducts` method. -message ListProductsRequest { - // The project OR ProductSet from which Products should be listed. - // - // Format: - // `projects/PROJECT_ID/locations/LOC_ID` - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProducts` method. -message ListProductsResponse { - // List of products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProduct` method. -message GetProductRequest { - // Resource name of the Product to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `UpdateProduct` method. -message UpdateProductRequest { - // The Product resource which replaces the one on the server. - // product.name is immutable. - Product product = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields - // to update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask paths include `product_labels`, `display_name` and - // `description`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProduct` method. -message DeleteProductRequest { - // Resource name of product to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `CreateProductSet` method. -message CreateProductSetRequest { - // The project in which the ProductSet should be created. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The ProductSet to create. - ProductSet product_set = 2; - - // A user-supplied resource id for this ProductSet. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_set_id = 3; -} - -// Request message for the `ListProductSets` method. -message ListProductSetsRequest { - // The project from which ProductSets should be listed. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductSets` method. -message ListProductSetsResponse { - // List of ProductSets. - repeated ProductSet product_sets = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProductSet` method. -message GetProductSetRequest { - // Resource name of the ProductSet to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `UpdateProductSet` method. -message UpdateProductSetRequest { - // The ProductSet resource which replaces the one on the server. - ProductSet product_set = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to - // update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask path is `display_name`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProductSet` method. -message DeleteProductSetRequest { - // Resource name of the ProductSet to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `CreateReferenceImage` method. -message CreateReferenceImageRequest { - // Resource name of the product in which to create the reference image. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The reference image to create. - // If an image ID is specified, it is ignored. - ReferenceImage reference_image = 2; - - // A user-supplied resource id for the ReferenceImage to be added. If set, - // the server will attempt to use this value as the resource id. If it is - // already in use, an error is returned with code ALREADY_EXISTS. Must be at - // most 128 characters long. It cannot contain the character `/`. - string reference_image_id = 3; -} - -// Request message for the `ListReferenceImages` method. -message ListReferenceImagesRequest { - // Resource name of the product containing the reference images. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // A token identifying a page of results to be returned. This is the value - // of `nextPageToken` returned in a previous reference image list request. - // - // Defaults to the first page if not specified. - string page_token = 3; -} - -// Response message for the `ListReferenceImages` method. -message ListReferenceImagesResponse { - // The list of reference images. - repeated ReferenceImage reference_images = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string next_page_token = 3; -} - -// Request message for the `GetReferenceImage` method. -message GetReferenceImageRequest { - // The resource name of the ReferenceImage to get. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - string name = 1; -} - -// Request message for the `DeleteReferenceImage` method. -message DeleteReferenceImageRequest { - // The resource name of the reference image to delete. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - string name = 1; -} - -// Request message for the `AddProductToProductSet` method. -message AddProductToProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be added to this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `RemoveProductFromProductSet` method. -message RemoveProductFromProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be removed from this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `ListProductsInProductSet` method. -message ListProductsInProductSetRequest { - // The ProductSet resource for which to retrieve Products. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductsInProductSet` method. -message ListProductsInProductSetResponse { - // The list of Products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// The Google Cloud Storage location for a csv file which preserves a list of -// ImportProductSetRequests in each line. -message ImportProductSetsGcsSource { - // The Google Cloud Storage URI of the input csv file. - // - // The URI must start with gs:// - // - // The format of the input csv file should be one image per line. - // In each line, there are 6 columns. - // 1. image_uri - // 2, image_id - // 3. product_set_id - // 4. product_id - // 5, product_category - // 6, product_display_name - // 7, labels - // 8. bounding_poly - // - // Columns 1, 3, 4, and 5 are required, other columns are optional. A new - // ProductSet/Product with the same id will be created on the fly - // if the ProductSet/Product specified by product_set_id/product_id does not - // exist. - // - // The image_id field is optional but has to be unique if provided. If it is - // empty, we will automatically assign an unique id to the image. - // - // The product_display_name field is optional. If it is empty, a space (" ") - // is used as the place holder for the product display_name, which can - // be updated later through the realtime API. - // - // If the Product with product_id already exists, the fields - // product_display_name, product_category and labels are ignored. - // - // If a Product doesn't exist and needs to be created on the fly, the - // product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the - // product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the - // labels field refers to [Product.labels][]. - // - // Labels (optional) should be a line containing a list of comma-separated - // key-value pairs, with the format - // "key_1=value_1,key_2=value_2,...,key_n=value_n". - // - // The bounding_poly (optional) field is used to identify one region of - // interest from the image in the same manner as CreateReferenceImage. If no - // bounding_poly is specified, the system will try to detect regions of - // interest automatically. - // - // Note that the pipeline will resize the image if the image resolution is too - // large to process (above 20MP). - // - // Also note that at most one bounding_poly is allowed per line. If the image - // contains multiple regions of interest, the csv should contain one line per - // region of interest. - // - // The bounding_poly column should contain an even number of comma-separated - // numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative - // integers should be used for absolute bounding polygons, and float values - // in [0, 1] should be used for normalized bounding polygons. - string csv_file_uri = 1; -} - -// The input content for the `ImportProductSets` method. -message ImportProductSetsInputConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for a csv file which preserves a list - // of ImportProductSetRequests in each line. - ImportProductSetsGcsSource gcs_source = 1; - } -} - -// Request message for the `ImportProductSets` method. -message ImportProductSetsRequest { - // The project in which the ProductSets should be imported. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The input content for the list of requests. - ImportProductSetsInputConfig input_config = 2; -} - -// Response message for the `ImportProductSets` method. -// -// This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. -message ImportProductSetsResponse { - // The list of reference_images that are imported successfully. - repeated ReferenceImage reference_images = 1; - - // The rpc status for each ImportProductSet request, including both successes - // and errors. - // - // The number of statuses here matches the number of lines in the csv file, - // and statuses[i] stores the success or failure status of processing the i-th - // line of the csv, starting from line 0. - repeated google.rpc.Status statuses = 2; -} - -// Metadata for the batch operations such as the current state. -// -// This is included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message BatchOperationMetadata { - // Enumerates the possible states that the batch request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is actively being processed. - PROCESSING = 1; - - // The request is done and at least one item has been successfully - // processed. - SUCCESSFUL = 2; - - // The request is done and no item has been successfully processed. - FAILED = 3; - - // The request is done after the longrunning.Operations.CancelOperation has - // been called by the user. Any records that were processed before the - // cancel command are output as specified in the request. - CANCELLED = 4; - } - - // The current state of the batch operation. - State state = 1; - - // The time when the batch request was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the batch request is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. - google.protobuf.Timestamp end_time = 3; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation.proto b/vision/google/cloud/vision_v1p1beta1/proto/text_annotation.proto deleted file mode 100644 index 928e6e88bb07..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation.proto +++ /dev/null @@ -1,252 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p1beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p1beta1/geometry.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "TextAnnotationProto"; -option java_package = "com.google.cloud.vision.v1p1beta1"; - -// TextAnnotation contains a structured representation of OCR extracted text. -// The hierarchy of an OCR extracted text structure is like this: -// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol -// Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please refer -// to the -// [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] -// message definition below for more detail. -message TextAnnotation { - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // Detected start or end of a structural component. - message DetectedBreak { - // Enum to denote the type of break found. New line, space etc. - enum BreakType { - // Unknown break label type. - UNKNOWN = 0; - - // Regular space. - SPACE = 1; - - // Sure space (very wide). - SURE_SPACE = 2; - - // Line-wrapping break. - EOL_SURE_SPACE = 3; - - // End-line hyphen that is not present in text; does not co-occur with - // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4; - - // Line break that ends a paragraph. - LINE_BREAK = 5; - } - - // Detected break type. - BreakType type = 1; - - // True if break prepends the element. - bool is_prefix = 2; - } - - // Additional information detected on the structural component. - message TextProperty { - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 1; - - // Detected start or end of a text segment. - DetectedBreak detected_break = 2; - } - - // List of pages detected by OCR. - repeated Page pages = 1; - - // UTF-8 text detected on the pages. - string text = 2; -} - -// Detected page from OCR. -message Page { - // Additional information detected on the page. - TextAnnotation.TextProperty property = 1; - - // Page width in pixels. - int32 width = 2; - - // Page height in pixels. - int32 height = 3; - - // List of blocks of text, images etc on this page. - repeated Block blocks = 4; - - // Confidence of the OCR results on the page. Range [0, 1]. - float confidence = 5; -} - -// Logical element on the page. -message Block { - // Type of a block (text, image etc) as identified by OCR. - enum BlockType { - // Unknown block type. - UNKNOWN = 0; - - // Regular text block. - TEXT = 1; - - // Table block. - TABLE = 2; - - // Image block. - PICTURE = 3; - - // Horizontal/vertical line box. - RULER = 4; - - // Barcode block. - BARCODE = 5; - } - - // Additional information detected for the block. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the block. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of paragraphs in this block (if this blocks is of type text). - repeated Paragraph paragraphs = 3; - - // Detected block type (text, image etc) for this block. - BlockType block_type = 4; - - // Confidence of the OCR results on the block. Range [0, 1]. - float confidence = 5; -} - -// Structural unit of text representing a number of words in certain order. -message Paragraph { - // Additional information detected for the paragraph. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the paragraph. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of words in this paragraph. - repeated Word words = 3; - - // Confidence of the OCR results for the paragraph. Range [0, 1]. - float confidence = 4; -} - -// A word representation. -message Word { - // Additional information detected for the word. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the word. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of symbols in the word. - // The order of the symbols follows the natural reading order. - repeated Symbol symbols = 3; - - // Confidence of the OCR results for the word. Range [0, 1]. - float confidence = 4; -} - -// A single symbol representation. -message Symbol { - // Additional information detected for the symbol. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the symbol. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // The actual UTF-8 representation of the symbol. - string text = 3; - - // Confidence of the OCR results for the symbol. Range [0, 1]. - float confidence = 4; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py b/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py deleted file mode 100644 index edae840e1565..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py +++ /dev/null @@ -1,1135 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p1beta1/proto/text_annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p1beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p1beta1/proto/text_annotation.proto", - package="google.cloud.vision.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p1beta1B\023TextAnnotationProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p1beta1/proto/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p1beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p1beta1/proto/geometry.proto"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p1beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p1beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p1beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p1beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p1beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p1beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p1beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x82\x01\n!com.google.cloud.vision.v1p1beta1B\x13TextAnnotationProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - ], -) - - -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE = _descriptor.EnumDescriptor( - name="BreakType", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.BreakType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPACE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SURE_SPACE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EOL_SURE_SPACE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LINE_BREAK", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=444, - serialized_end=543, -) -_sym_db.RegisterEnumDescriptor(_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE) - -_BLOCK_BLOCKTYPE = _descriptor.EnumDescriptor( - name="BlockType", - full_name="google.cloud.vision.v1p1beta1.Block.BlockType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PICTURE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RULER", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BARCODE", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1236, - serialized_end=1318, -) -_sym_db.RegisterEnumDescriptor(_BLOCK_BLOCKTYPE) - - -_TEXTANNOTATION_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=259, - serialized_end=320, -) - -_TEXTANNOTATION_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_prefix", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak.is_prefix", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=323, - serialized_end=543, -) - -_TEXTANNOTATION_TEXTPROPERTY = _descriptor.Descriptor( - name="TextProperty", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.detected_languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=546, - serialized_end=737, -) - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.pages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p1beta1.TextAnnotation.text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _TEXTANNOTATION_DETECTEDLANGUAGE, - _TEXTANNOTATION_DETECTEDBREAK, - _TEXTANNOTATION_TEXTPROPERTY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=175, - serialized_end=737, -) - - -_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.vision.v1p1beta1.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p1beta1.Page.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.vision.v1p1beta1.Page.width", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.vision.v1p1beta1.Page.height", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.vision.v1p1beta1.Page.blocks", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.Page.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=740, - serialized_end=929, -) - - -_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.vision.v1p1beta1.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p1beta1.Block.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p1beta1.Block.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.vision.v1p1beta1.Block.paragraphs", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="block_type", - full_name="google.cloud.vision.v1p1beta1.Block.block_type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.Block.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BLOCK_BLOCKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=932, - serialized_end=1318, -) - - -_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.vision.v1p1beta1.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p1beta1.Paragraph.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p1beta1.Paragraph.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.vision.v1p1beta1.Paragraph.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.Paragraph.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1321, - serialized_end=1549, -) - - -_WORD = _descriptor.Descriptor( - name="Word", - full_name="google.cloud.vision.v1p1beta1.Word", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p1beta1.Word.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p1beta1.Word.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="symbols", - full_name="google.cloud.vision.v1p1beta1.Word.symbols", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.Word.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1552, - serialized_end=1779, -) - - -_SYMBOL = _descriptor.Descriptor( - name="Symbol", - full_name="google.cloud.vision.v1p1beta1.Symbol", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p1beta1.Symbol.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p1beta1.Symbol.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p1beta1.Symbol.text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p1beta1.Symbol.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1782, - serialized_end=1969, -) - -_TEXTANNOTATION_DETECTEDLANGUAGE.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE -_TEXTANNOTATION_DETECTEDBREAK.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE.containing_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_languages" -].message_type = _TEXTANNOTATION_DETECTEDLANGUAGE -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_break" -].message_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.containing_type = _TEXTANNOTATION -_TEXTANNOTATION.fields_by_name["pages"].message_type = _PAGE -_PAGE.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PAGE.fields_by_name["blocks"].message_type = _BLOCK -_BLOCK.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_BLOCK.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_BLOCK.fields_by_name["paragraphs"].message_type = _PARAGRAPH -_BLOCK.fields_by_name["block_type"].enum_type = _BLOCK_BLOCKTYPE -_BLOCK_BLOCKTYPE.containing_type = _BLOCK -_PARAGRAPH.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PARAGRAPH.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PARAGRAPH.fields_by_name["words"].message_type = _WORD -_WORD.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_WORD.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_WORD.fields_by_name["symbols"].message_type = _SYMBOL -_SYMBOL.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_SYMBOL.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p1beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["Page"] = _PAGE -DESCRIPTOR.message_types_by_name["Block"] = _BLOCK -DESCRIPTOR.message_types_by_name["Paragraph"] = _PARAGRAPH -DESCRIPTOR.message_types_by_name["Word"] = _WORD -DESCRIPTOR.message_types_by_name["Symbol"] = _SYMBOL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DetectedLanguage=_reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDLANGUAGE, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Detected language for a structural component. - - - Attributes: - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedLanguage) - ), - ), - DetectedBreak=_reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDBREAK, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Detected start or end of a structural component. - - - Attributes: - type: - Detected break type. - is_prefix: - True if break prepends the element. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.DetectedBreak) - ), - ), - TextProperty=_reflection.GeneratedProtocolMessageType( - "TextProperty", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_TEXTPROPERTY, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Additional information detected on the structural component. - - - Attributes: - detected_languages: - A list of detected languages together with confidence. - detected_break: - Detected start or end of a text segment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty) - ), - ), - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have their - own properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p1beta1.TextAnnotation.TextProperty] - message definition below for more detail. - - - Attributes: - pages: - List of pages detected by OCR. - text: - UTF-8 text detected on the pages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) -_sym_db.RegisterMessage(TextAnnotation.DetectedLanguage) -_sym_db.RegisterMessage(TextAnnotation.DetectedBreak) -_sym_db.RegisterMessage(TextAnnotation.TextProperty) - -Page = _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - DESCRIPTOR=_PAGE, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Detected page from OCR. - - - Attributes: - property: - Additional information detected on the page. - width: - Page width in pixels. - height: - Page height in pixels. - blocks: - List of blocks of text, images etc on this page. - confidence: - Confidence of the OCR results on the page. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Page) - ), -) -_sym_db.RegisterMessage(Page) - -Block = _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_BLOCK, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Logical element on the page. - - - Attributes: - property: - Additional information detected for the block. - bounding_box: - The bounding box for the block. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - paragraphs: - List of paragraphs in this block (if this blocks is of type - text). - block_type: - Detected block type (text, image etc) for this block. - confidence: - Confidence of the OCR results on the block. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Block) - ), -) -_sym_db.RegisterMessage(Block) - -Paragraph = _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_PARAGRAPH, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""Structural unit of text representing a number of words in - certain order. - - - Attributes: - property: - Additional information detected for the paragraph. - bounding_box: - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. When - a rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - words: - List of words in this paragraph. - confidence: - Confidence of the OCR results for the paragraph. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Paragraph) - ), -) -_sym_db.RegisterMessage(Paragraph) - -Word = _reflection.GeneratedProtocolMessageType( - "Word", - (_message.Message,), - dict( - DESCRIPTOR=_WORD, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""A word representation. - - - Attributes: - property: - Additional information detected for the word. - bounding_box: - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - symbols: - List of symbols in the word. The order of the symbols follows - the natural reading order. - confidence: - Confidence of the OCR results for the word. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Word) - ), -) -_sym_db.RegisterMessage(Word) - -Symbol = _reflection.GeneratedProtocolMessageType( - "Symbol", - (_message.Message,), - dict( - DESCRIPTOR=_SYMBOL, - __module__="google.cloud.vision_v1p1beta1.proto.text_annotation_pb2", - __doc__="""A single symbol representation. - - - Attributes: - property: - Additional information detected for the symbol. - bounding_box: - The bounding box for the symbol. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - text: - The actual UTF-8 representation of the symbol. - confidence: - Confidence of the OCR results for the symbol. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.Symbol) - ), -) -_sym_db.RegisterMessage(Symbol) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py b/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p1beta1/proto/web_detection.proto b/vision/google/cloud/vision_v1p1beta1/proto/web_detection.proto deleted file mode 100644 index 28249cbdec22..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/web_detection.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2017 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p1beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "WebDetectionProto"; -option java_package = "com.google.cloud.vision.v1p1beta1"; - -// Relevant information for the image from the Internet. -message WebDetection { - // Entity deduced from similar images on the Internet. - message WebEntity { - // Opaque entity ID. - string entity_id = 1; - - // Overall relevancy score for the entity. - // Not normalized and not comparable across different image queries. - float score = 2; - - // Canonical description of the entity, in English. - string description = 3; - } - - // Metadata for online images. - message WebImage { - // The result image URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the image. - float score = 2; - } - - // Metadata for web pages. - message WebPage { - // The result web page URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the web page. - float score = 2; - - // Title for the web page, may contain HTML markups. - string page_title = 3; - - // Fully matching images on the page. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 4; - - // Partial matching images on the page. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its - // crops. - repeated WebImage partial_matching_images = 5; - } - - // Label to provide extra metadata for the web detection. - message WebLabel { - // Label for extra metadata. - string label = 1; - - // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - // For more information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - } - - // Deduced entities from similar images on the Internet. - repeated WebEntity web_entities = 1; - - // Fully matching images from the Internet. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 2; - - // Partial matching images from the Internet. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its crops. - repeated WebImage partial_matching_images = 3; - - // Web pages containing the matching images from the Internet. - repeated WebPage pages_with_matching_images = 4; - - // The visually similar image results. - repeated WebImage visually_similar_images = 6; - - // Best guess text labels for the request image. - repeated WebLabel best_guess_labels = 8; -} diff --git a/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py b/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py deleted file mode 100644 index 8a0c17869494..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py +++ /dev/null @@ -1,616 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p1beta1/proto/web_detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p1beta1/proto/web_detection.proto", - package="google.cloud.vision.v1p1beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p1beta1B\021WebDetectionProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n7google/cloud/vision_v1p1beta1/proto/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p1beta1\x1a\x1cgoogle/api/annotations.proto"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p1beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p1beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p1beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB\x80\x01\n!com.google.cloud.vision.v1p1beta1B\x11WebDetectionProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p1beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_WEBDETECTION_WEBENTITY = _descriptor.Descriptor( - name="WebEntity", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebEntity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebEntity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebEntity.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebEntity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=642, - serialized_end=708, -) - -_WEBDETECTION_WEBIMAGE = _descriptor.Descriptor( - name="WebImage", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebImage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebImage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=710, - serialized_end=748, -) - -_WEBDETECTION_WEBPAGE = _descriptor.Descriptor( - name="WebPage", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_title", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage.page_title", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage.full_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebPage.partial_matching_images", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=751, - serialized_end=979, -) - -_WEBDETECTION_WEBLABEL = _descriptor.Descriptor( - name="WebLabel", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebLabel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebLabel.label", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p1beta1.WebDetection.WebLabel.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1029, -) - -_WEBDETECTION = _descriptor.Descriptor( - name="WebDetection", - full_name="google.cloud.vision.v1p1beta1.WebDetection", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="web_entities", - full_name="google.cloud.vision.v1p1beta1.WebDetection.web_entities", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.full_matching_images", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.partial_matching_images", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages_with_matching_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.pages_with_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visually_similar_images", - full_name="google.cloud.vision.v1p1beta1.WebDetection.visually_similar_images", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="best_guess_labels", - full_name="google.cloud.vision.v1p1beta1.WebDetection.best_guess_labels", - index=5, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _WEBDETECTION_WEBENTITY, - _WEBDETECTION_WEBIMAGE, - _WEBDETECTION_WEBPAGE, - _WEBDETECTION_WEBLABEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=121, - serialized_end=1029, -) - -_WEBDETECTION_WEBENTITY.containing_type = _WEBDETECTION -_WEBDETECTION_WEBIMAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBPAGE.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBLABEL.containing_type = _WEBDETECTION -_WEBDETECTION.fields_by_name["web_entities"].message_type = _WEBDETECTION_WEBENTITY -_WEBDETECTION.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "pages_with_matching_images" -].message_type = _WEBDETECTION_WEBPAGE -_WEBDETECTION.fields_by_name[ - "visually_similar_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name["best_guess_labels"].message_type = _WEBDETECTION_WEBLABEL -DESCRIPTOR.message_types_by_name["WebDetection"] = _WEBDETECTION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -WebDetection = _reflection.GeneratedProtocolMessageType( - "WebDetection", - (_message.Message,), - dict( - WebEntity=_reflection.GeneratedProtocolMessageType( - "WebEntity", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBENTITY, - __module__="google.cloud.vision_v1p1beta1.proto.web_detection_pb2", - __doc__="""Entity deduced from similar images on the Internet. - - - Attributes: - entity_id: - Opaque entity ID. - score: - Overall relevancy score for the entity. Not normalized and not - comparable across different image queries. - description: - Canonical description of the entity, in English. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetection.WebEntity) - ), - ), - WebImage=_reflection.GeneratedProtocolMessageType( - "WebImage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBIMAGE, - __module__="google.cloud.vision_v1p1beta1.proto.web_detection_pb2", - __doc__="""Metadata for online images. - - - Attributes: - url: - The result image URL. - score: - (Deprecated) Overall relevancy score for the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetection.WebImage) - ), - ), - WebPage=_reflection.GeneratedProtocolMessageType( - "WebPage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBPAGE, - __module__="google.cloud.vision_v1p1beta1.proto.web_detection_pb2", - __doc__="""Metadata for web pages. - - - Attributes: - url: - The result web page URL. - score: - (Deprecated) Overall relevancy score for the web page. - page_title: - Title for the web page, may contain HTML markups. - full_matching_images: - Fully matching images on the page. Can include resized copies - of the query image. - partial_matching_images: - Partial matching images on the page. Those images are similar - enough to share some key-point features. For example an - original image will likely have partial matching for its - crops. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetection.WebPage) - ), - ), - WebLabel=_reflection.GeneratedProtocolMessageType( - "WebLabel", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBLABEL, - __module__="google.cloud.vision_v1p1beta1.proto.web_detection_pb2", - __doc__="""Label to provide extra metadata for the web detection. - - - Attributes: - label: - Label for extra metadata. - language_code: - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see http://www.unicode.org/re - ports/tr35/#Unicode\_locale\_identifier. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetection.WebLabel) - ), - ), - DESCRIPTOR=_WEBDETECTION, - __module__="google.cloud.vision_v1p1beta1.proto.web_detection_pb2", - __doc__="""Relevant information for the image from the Internet. - - - Attributes: - web_entities: - Deduced entities from similar images on the Internet. - full_matching_images: - Fully matching images from the Internet. Can include resized - copies of the query image. - partial_matching_images: - Partial matching images from the Internet. Those images are - similar enough to share some key-point features. For example - an original image will likely have partial matching for its - crops. - pages_with_matching_images: - Web pages containing the matching images from the Internet. - visually_similar_images: - The visually similar image results. - best_guess_labels: - Best guess text labels for the request image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p1beta1.WebDetection) - ), -) -_sym_db.RegisterMessage(WebDetection) -_sym_db.RegisterMessage(WebDetection.WebEntity) -_sym_db.RegisterMessage(WebDetection.WebImage) -_sym_db.RegisterMessage(WebDetection.WebPage) -_sym_db.RegisterMessage(WebDetection.WebLabel) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py b/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p1beta1/types.py b/vision/google/cloud/vision_v1p1beta1/types.py deleted file mode 100644 index 08c79370fa02..000000000000 --- a/vision/google/cloud/vision_v1p1beta1/types.py +++ /dev/null @@ -1,56 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.vision_v1p1beta1.proto import geometry_pb2 -from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p1beta1.proto import text_annotation_pb2 -from google.cloud.vision_v1p1beta1.proto import web_detection_pb2 -from google.protobuf import any_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 -from google.type import latlng_pb2 - - -_shared_modules = [any_pb2, wrappers_pb2, status_pb2, color_pb2, latlng_pb2] - -_local_modules = [ - geometry_pb2, - image_annotator_pb2, - text_annotation_pb2, - web_detection_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.vision_v1p1beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/vision/google/cloud/vision_v1p2beta1/__init__.py b/vision/google/cloud/vision_v1p2beta1/__init__.py deleted file mode 100644 index 19f8c4e526fe..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/__init__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.vision_helpers.decorators import add_single_feature_methods -from google.cloud.vision_helpers import VisionHelpers -import sys -import warnings - -from google.cloud.vision_v1p2beta1 import types -from google.cloud.vision_v1p2beta1.gapic import enums -from google.cloud.vision_v1p2beta1.gapic import image_annotator_client as iac - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient): - __doc__ = iac.ImageAnnotatorClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "ImageAnnotatorClient") diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/__init__.py b/vision/google/cloud/vision_v1p2beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/enums.py b/vision/google/cloud/vision_v1p2beta1/gapic/enums.py deleted file mode 100644 index cda4f64c6ff7..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/gapic/enums.py +++ /dev/null @@ -1,228 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Likelihood(enum.IntEnum): - """ - A bucketized representation of likelihood, which is intended to give clients - highly stable results across model upgrades. - - Attributes: - UNKNOWN (int): Unknown likelihood. - VERY_UNLIKELY (int): It is very unlikely that the image belongs to the specified vertical. - UNLIKELY (int): It is unlikely that the image belongs to the specified vertical. - POSSIBLE (int): It is possible that the image belongs to the specified vertical. - LIKELY (int): It is likely that the image belongs to the specified vertical. - VERY_LIKELY (int): It is very likely that the image belongs to the specified vertical. - """ - - UNKNOWN = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class Block(object): - class BlockType(enum.IntEnum): - """ - Type of a block (text, image etc) as identified by OCR. - - Attributes: - UNKNOWN (int): Unknown block type. - TEXT (int): Regular text block. - TABLE (int): Table block. - PICTURE (int): Image block. - RULER (int): Horizontal/vertical line box. - BARCODE (int): Barcode block. - """ - - UNKNOWN = 0 - TEXT = 1 - TABLE = 2 - PICTURE = 3 - RULER = 4 - BARCODE = 5 - - -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. - - Attributes: - UNKNOWN_LANDMARK (int): Unknown face landmark detected. Should not be filled. - LEFT_EYE (int): Left eye. - RIGHT_EYE (int): Right eye. - LEFT_OF_LEFT_EYEBROW (int): Left of left eyebrow. - RIGHT_OF_LEFT_EYEBROW (int): Right of left eyebrow. - LEFT_OF_RIGHT_EYEBROW (int): Left of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW (int): Right of right eyebrow. - MIDPOINT_BETWEEN_EYES (int): Midpoint between eyes. - NOSE_TIP (int): Nose tip. - UPPER_LIP (int): Upper lip. - LOWER_LIP (int): Lower lip. - MOUTH_LEFT (int): Mouth left. - MOUTH_RIGHT (int): Mouth right. - MOUTH_CENTER (int): Mouth center. - NOSE_BOTTOM_RIGHT (int): Nose, bottom right. - NOSE_BOTTOM_LEFT (int): Nose, bottom left. - NOSE_BOTTOM_CENTER (int): Nose, bottom center. - LEFT_EYE_TOP_BOUNDARY (int): Left eye, top boundary. - LEFT_EYE_RIGHT_CORNER (int): Left eye, right corner. - LEFT_EYE_BOTTOM_BOUNDARY (int): Left eye, bottom boundary. - LEFT_EYE_LEFT_CORNER (int): Left eye, left corner. - RIGHT_EYE_TOP_BOUNDARY (int): Right eye, top boundary. - RIGHT_EYE_RIGHT_CORNER (int): Right eye, right corner. - RIGHT_EYE_BOTTOM_BOUNDARY (int): Right eye, bottom boundary. - RIGHT_EYE_LEFT_CORNER (int): Right eye, left corner. - LEFT_EYEBROW_UPPER_MIDPOINT (int): Left eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT (int): Right eyebrow, upper midpoint. - LEFT_EAR_TRAGION (int): Left ear tragion. - RIGHT_EAR_TRAGION (int): Right ear tragion. - LEFT_EYE_PUPIL (int): Left eye pupil. - RIGHT_EYE_PUPIL (int): Right eye pupil. - FOREHEAD_GLABELLA (int): Forehead glabella. - CHIN_GNATHION (int): Chin gnathion. - CHIN_LEFT_GONION (int): Chin left gonion. - CHIN_RIGHT_GONION (int): Chin right gonion. - """ - - UNKNOWN_LANDMARK = 0 - LEFT_EYE = 1 - RIGHT_EYE = 2 - LEFT_OF_LEFT_EYEBROW = 3 - RIGHT_OF_LEFT_EYEBROW = 4 - LEFT_OF_RIGHT_EYEBROW = 5 - RIGHT_OF_RIGHT_EYEBROW = 6 - MIDPOINT_BETWEEN_EYES = 7 - NOSE_TIP = 8 - UPPER_LIP = 9 - LOWER_LIP = 10 - MOUTH_LEFT = 11 - MOUTH_RIGHT = 12 - MOUTH_CENTER = 13 - NOSE_BOTTOM_RIGHT = 14 - NOSE_BOTTOM_LEFT = 15 - NOSE_BOTTOM_CENTER = 16 - LEFT_EYE_TOP_BOUNDARY = 17 - LEFT_EYE_RIGHT_CORNER = 18 - LEFT_EYE_BOTTOM_BOUNDARY = 19 - LEFT_EYE_LEFT_CORNER = 20 - RIGHT_EYE_TOP_BOUNDARY = 21 - RIGHT_EYE_RIGHT_CORNER = 22 - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - RIGHT_EYE_LEFT_CORNER = 24 - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - LEFT_EAR_TRAGION = 27 - RIGHT_EAR_TRAGION = 28 - LEFT_EYE_PUPIL = 29 - RIGHT_EYE_PUPIL = 30 - FOREHEAD_GLABELLA = 31 - CHIN_GNATHION = 32 - CHIN_LEFT_GONION = 33 - 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. - """ - - 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 - - -class OperationMetadata(object): - class State(enum.IntEnum): - """ - Batch operation states. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - CREATED (int): Request is received. - RUNNING (int): Request is actively being processed. - DONE (int): The batch processing is done. - CANCELLED (int): The batch processing was cancelled. - """ - - STATE_UNSPECIFIED = 0 - CREATED = 1 - 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 diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py b/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py deleted file mode 100644 index 9ed5c3866c43..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py +++ /dev/null @@ -1,330 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1p2beta1 ImageAnnotator API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import grpc - -from google.cloud.vision_v1p2beta1.gapic import enums -from google.cloud.vision_v1p2beta1.gapic import image_annotator_client_config -from google.cloud.vision_v1p2beta1.gapic.transports import ( - image_annotator_grpc_transport, -) -from google.cloud.vision_v1p2beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p2beta1.proto import image_annotator_pb2_grpc -from google.longrunning import operations_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ImageAnnotatorClient(object): - """ - 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. - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1p2beta1.ImageAnnotator" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ImageAnnotatorClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ImageAnnotatorGrpcTransport, - Callable[[~.Credentials, type], ~.ImageAnnotatorGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = image_annotator_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=image_annotator_grpc_transport.ImageAnnotatorGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = image_annotator_grpc_transport.ImageAnnotatorGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_annotate_images( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Run image detection and annotation for a batch of images. - - Example: - >>> from google.cloud import vision_v1p2beta1 - >>> - >>> client = vision_v1p2beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_images(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p2beta1.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_v1p2beta1.types.AnnotateImageRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p2beta1.types.BatchAnnotateImagesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_images, - default_retry=self._method_configs["BatchAnnotateImages"].retry, - default_timeout=self._method_configs["BatchAnnotateImages"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateImagesRequest(requests=requests) - return self._inner_api_calls["batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def async_batch_annotate_files( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Run async image detection and annotation for a list of generic files - (e.g. PDF) 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). - - Example: - >>> from google.cloud import vision_v1p2beta1 - >>> - >>> client = vision_v1p2beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.async_batch_annotate_files(requests) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p2beta1.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_v1p2beta1.types.AsyncAnnotateFileRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p2beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_files, - default_retry=self._method_configs["AsyncBatchAnnotateFiles"].retry, - default_timeout=self._method_configs["AsyncBatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest(requests=requests) - operation = self._inner_api_calls["async_batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateFilesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py b/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py deleted file mode 100644 index 9ed71995d165..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p2beta1.ImageAnnotator": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/transports/__init__.py b/vision/google/cloud/vision_v1p2beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py b/vision/google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py deleted file mode 100644 index 40345e17f1f9..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1p2beta1.proto import image_annotator_pb2_grpc - - -class ImageAnnotatorGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p2beta1 ImageAnnotator API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "image_annotator_stub": image_annotator_pb2_grpc.ImageAnnotatorStub(channel) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`. - - Run image detection and annotation for a batch of images. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateImages - - @property - def async_batch_annotate_files(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.async_batch_annotate_files`. - - Run async image detection and annotation for a list of generic files - (e.g. PDF) 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). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateFiles diff --git a/vision/google/cloud/vision_v1p2beta1/proto/__init__.py b/vision/google/cloud/vision_v1p2beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p2beta1/proto/geometry.proto b/vision/google/cloud/vision_v1p2beta1/proto/geometry.proto deleted file mode 100644 index e9fec20bda76..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/geometry.proto +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p2beta1; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.vision.v1p2beta1"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} - -// A 3D position in the image, used primarily for Face detection landmarks. -// A valid Position must have both x and y coordinates. -// The position coordinates are in the same scale as the original image. -message Position { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; - - // Z coordinate (or depth). - float z = 3; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2.py b/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2.py deleted file mode 100644 index 2089062f0c23..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,367 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p2beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p2beta1/proto/geometry.proto", - package="google.cloud.vision.v1p2beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p2beta1B\rGeometryProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n2google/cloud/vision_v1p2beta1/proto/geometry.proto\x12\x1dgoogle.cloud.vision.v1p2beta1"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p2beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p2beta1.NormalizedVertex"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42|\n!com.google.cloud.vision.v1p2beta1B\rGeometryProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\xf8\x01\x01\x62\x06proto3' - ), -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.vision.v1p2beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p2beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p2beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=85, - serialized_end=115, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.vision.v1p2beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p2beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p2beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=117, - serialized_end=157, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.vision.v1p2beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.vision.v1p2beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.vision.v1p2beta1.BoundingPoly.normalized_vertices", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=160, - serialized_end=309, -) - - -_POSITION = _descriptor.Descriptor( - name="Position", - full_name="google.cloud.vision.v1p2beta1.Position", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p2beta1.Position.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p2beta1.Position.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="z", - full_name="google.cloud.vision.v1p2beta1.Position.z", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=311, - serialized_end=354, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -DESCRIPTOR.message_types_by_name["Position"] = _POSITION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.vision_v1p2beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.vision_v1p2beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.vision_v1p2beta1.proto.geometry_pb2", - __doc__="""A bounding polygon for the detected image annotation. - - - Attributes: - vertices: - The bounding polygon vertices. - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - -Position = _reflection.GeneratedProtocolMessageType( - "Position", - (_message.Message,), - dict( - DESCRIPTOR=_POSITION, - __module__="google.cloud.vision_v1p2beta1.proto.geometry_pb2", - __doc__="""A 3D position in the image, used primarily for Face - detection landmarks. A valid Position must have both x and y - coordinates. The position coordinates are in the same scale as the - original image. - - - Attributes: - x: - X coordinate. - y: - Y coordinate. - z: - Z coordinate (or depth). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Position) - ), -) -_sym_db.RegisterMessage(Position) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py b/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator.proto b/vision/google/cloud/vision_v1p2beta1/proto/image_annotator.proto deleted file mode 100644 index c5fce50f9baa..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator.proto +++ /dev/null @@ -1,765 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p2beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p2beta1/geometry.proto"; -import "google/cloud/vision/v1p2beta1/text_annotation.proto"; -import "google/cloud/vision/v1p2beta1/web_detection.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; -import "google/type/latlng.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ImageAnnotatorProto"; -option java_package = "com.google.cloud.vision.v1p2beta1"; - -// 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. -service ImageAnnotator { - // Run image detection and annotation for a batch of images. - rpc BatchAnnotateImages(BatchAnnotateImagesRequest) - returns (BatchAnnotateImagesResponse) { - option (google.api.http) = { - post: "/v1p2beta1/images:annotate" - body: "*" - }; - } - - // Run async image detection and annotation for a list of generic files (e.g. - // PDF) 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). - rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p2beta1/files:asyncBatchAnnotate" - body: "*" - }; - } -} - -// The type of Google Cloud Vision API detection to perform, and the maximum -// number of results to return for that type. Multiple `Feature` objects can -// be specified in the `features` list. -message Feature { - // Type of Google Cloud Vision API feature to be extracted. - enum Type { - // Unspecified feature type. - TYPE_UNSPECIFIED = 0; - - // Run face detection. - FACE_DETECTION = 1; - - // Run landmark detection. - LANDMARK_DETECTION = 2; - - // Run logo detection. - LOGO_DETECTION = 3; - - // Run label detection. - LABEL_DETECTION = 4; - - // 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. - TEXT_DETECTION = 5; - - // Run dense text document OCR. Takes precedence when both - // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. - DOCUMENT_TEXT_DETECTION = 11; - - // Run Safe Search to detect potentially unsafe - // or undesirable content. - SAFE_SEARCH_DETECTION = 6; - - // Compute a set of image properties, such as the - // image's dominant colors. - IMAGE_PROPERTIES = 7; - - // Run crop hints. - CROP_HINTS = 9; - - // Run web detection. - WEB_DETECTION = 10; - } - - // The feature type. - Type type = 1; - - // Maximum number of results of this type. Does not apply to - // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - int32 max_results = 2; - - // Model to use for the feature. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// External image source (Google Cloud Storage or web URL image location). -message ImageSource { - // **Use `image_uri` instead.** - // - // The Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - string gcs_image_uri = 1; - - // The URI of the source image. Can be either: - // - // 1. A Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. - // - // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - // HTTP/HTTPS URLs, Google cannot guarantee that the request will be - // completed. Your request may fail if the specified host denies the - // request (e.g. due to request throttling or DOS prevention), or if Google - // throttles requests to the site for abuse prevention. You should not - // depend on externally-hosted images for production applications. - // - // When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - // precedence. - string image_uri = 2; -} - -// Client image to perform Google Cloud Vision API tasks over. -message Image { - // Image content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 1; - - // Google Cloud Storage image location, or publicly-accessible image - // URL. If both `content` and `source` are provided for an image, `content` - // takes precedence and is used to perform the image annotation request. - ImageSource source = 2; -} - -// A face annotation object contains the results of face detection. -message FaceAnnotation { - // A face-specific landmark (for example, a face feature). - message Landmark { - // 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. - enum Type { - // Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0; - - // Left eye. - LEFT_EYE = 1; - - // Right eye. - RIGHT_EYE = 2; - - // Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3; - - // Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4; - - // Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5; - - // Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6; - - // Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7; - - // Nose tip. - NOSE_TIP = 8; - - // Upper lip. - UPPER_LIP = 9; - - // Lower lip. - LOWER_LIP = 10; - - // Mouth left. - MOUTH_LEFT = 11; - - // Mouth right. - MOUTH_RIGHT = 12; - - // Mouth center. - MOUTH_CENTER = 13; - - // Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14; - - // Nose, bottom left. - NOSE_BOTTOM_LEFT = 15; - - // Nose, bottom center. - NOSE_BOTTOM_CENTER = 16; - - // Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17; - - // Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18; - - // Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19; - - // Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20; - - // Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21; - - // Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22; - - // Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23; - - // Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24; - - // Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25; - - // Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26; - - // Left ear tragion. - LEFT_EAR_TRAGION = 27; - - // Right ear tragion. - RIGHT_EAR_TRAGION = 28; - - // Left eye pupil. - LEFT_EYE_PUPIL = 29; - - // Right eye pupil. - RIGHT_EYE_PUPIL = 30; - - // Forehead glabella. - FOREHEAD_GLABELLA = 31; - - // Chin gnathion. - CHIN_GNATHION = 32; - - // Chin left gonion. - CHIN_LEFT_GONION = 33; - - // Chin right gonion. - CHIN_RIGHT_GONION = 34; - } - - // Face landmark type. - Type type = 3; - - // Face landmark position. - Position position = 4; - } - - // The bounding polygon around the face. The coordinates of the bounding box - // are in the original image's scale, as returned in `ImageParams`. - // The bounding box is computed to "frame" the face in accordance with human - // expectations. It is based on the landmarker results. - // Note that one or more x and/or y coordinates may not be generated in the - // `BoundingPoly` (the polygon will be unbounded) if only a partial face - // appears in the image to be annotated. - BoundingPoly bounding_poly = 1; - - // The `fd_bounding_poly` bounding polygon is tighter than the - // `boundingPoly`, and encloses only the skin part of the face. Typically, it - // is used to eliminate the face from any image analysis that detects the - // "amount of skin" visible in an image. It is not based on the - // landmarker results, only on the initial face detection, hence - // the fd (face detection) prefix. - BoundingPoly fd_bounding_poly = 2; - - // Detected face landmarks. - repeated Landmark landmarks = 3; - - // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - // of the face relative to the image vertical about the axis perpendicular to - // the face. Range [-180,180]. - float roll_angle = 4; - - // Yaw angle, which indicates the leftward/rightward angle that the face is - // pointing relative to the vertical plane perpendicular to the image. Range - // [-180,180]. - float pan_angle = 5; - - // Pitch angle, which indicates the upwards/downwards angle that the face is - // pointing relative to the image's horizontal plane. Range [-180,180]. - float tilt_angle = 6; - - // Detection confidence. Range [0, 1]. - float detection_confidence = 7; - - // Face landmarking confidence. Range [0, 1]. - float landmarking_confidence = 8; - - // Joy likelihood. - Likelihood joy_likelihood = 9; - - // Sorrow likelihood. - Likelihood sorrow_likelihood = 10; - - // Anger likelihood. - Likelihood anger_likelihood = 11; - - // Surprise likelihood. - Likelihood surprise_likelihood = 12; - - // Under-exposed likelihood. - Likelihood under_exposed_likelihood = 13; - - // Blurred likelihood. - Likelihood blurred_likelihood = 14; - - // Headwear likelihood. - Likelihood headwear_likelihood = 15; -} - -// Detected entity location information. -message LocationInfo { - // lat/long location coordinates. - google.type.LatLng lat_lng = 1; -} - -// A `Property` consists of a user-supplied name/value pair. -message Property { - // Name of the property. - string name = 1; - - // Value of the property. - string value = 2; - - // Value of numeric properties. - uint64 uint64_value = 3; -} - -// Set of detected entity features. -message EntityAnnotation { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string mid = 1; - - // The language code for the locale in which the entity textual - // `description` is expressed. - string locale = 2; - - // Entity textual description, expressed in its `locale` language. - string description = 3; - - // Overall score of the result. Range [0, 1]. - float score = 4; - - // **Deprecated. Use `score` instead.** - // The accuracy of the entity detection in an image. - // For example, for an image in which the "Eiffel Tower" entity is detected, - // this field represents the confidence that there is a tower in the query - // image. Range [0, 1]. - float confidence = 5; - - // The relevancy of the ICA (Image Content Annotation) label to the - // image. For example, the relevancy of "tower" is likely higher to an image - // containing the detected "Eiffel Tower" than to an image containing a - // detected distant towering building, even though the confidence that - // there is a tower in each image may be the same. Range [0, 1]. - float topicality = 6; - - // Image region to which this entity belongs. Not produced - // for `LABEL_DETECTION` features. - BoundingPoly bounding_poly = 7; - - // The location information for the detected entity. Multiple - // `LocationInfo` elements can be present because one location may - // indicate the location of the scene in the image, and another location - // may indicate the location of the place where the image was taken. - // Location information is usually present for landmarks. - repeated LocationInfo locations = 8; - - // Some entities may have optional user-supplied `Property` (name/value) - // fields, such a score or string that qualifies the entity. - repeated Property properties = 9; -} - -// Set of features pertaining to the image, computed by computer vision -// methods over safe-search verticals (for example, adult, spoof, medical, -// violence). -message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. Adult content may - // contain elements such as nudity, pornographic images or cartoons, or - // sexual activities. - Likelihood adult = 1; - - // Spoof likelihood. The likelihood that an modification - // was made to the image's canonical version to make it appear - // funny or offensive. - Likelihood spoof = 2; - - // Likelihood that this is a medical image. - Likelihood medical = 3; - - // Likelihood that this image contains violent content. - Likelihood violence = 4; - - // Likelihood that the request image contains racy content. Racy content may - // include (but is not limited to) skimpy or sheer clothing, strategically - // covered nudity, lewd or provocative poses, or close-ups of sensitive - // body areas. - Likelihood racy = 9; -} - -// Rectangle determined by min and max `LatLng` pairs. -message LatLongRect { - // Min lat/long pair. - google.type.LatLng min_lat_lng = 1; - - // Max lat/long pair. - google.type.LatLng max_lat_lng = 2; -} - -// Color information consists of RGB channels, score, and the fraction of -// the image that the color occupies in the image. -message ColorInfo { - // RGB components of the color. - google.type.Color color = 1; - - // Image-specific score for this color. Value in range [0, 1]. - float score = 2; - - // The fraction of pixels the color occupies in the image. - // Value in range [0, 1]. - float pixel_fraction = 3; -} - -// Set of dominant colors and their corresponding scores. -message DominantColorsAnnotation { - // RGB color values with their score and pixel fraction. - repeated ColorInfo colors = 1; -} - -// Stores image properties, such as dominant colors. -message ImageProperties { - // If present, dominant colors completed successfully. - DominantColorsAnnotation dominant_colors = 1; -} - -// Single crop hint that is used to generate a new crop when serving an image. -message CropHint { - // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale, as returned in `ImageParams`. - BoundingPoly bounding_poly = 1; - - // Confidence of this being a salient region. Range [0, 1]. - float confidence = 2; - - // Fraction of importance of this salient region with respect to the original - // image. - float importance_fraction = 3; -} - -// Set of crop hints that are used to generate new crops when serving images. -message CropHintsAnnotation { - // Crop hint results. - repeated CropHint crop_hints = 1; -} - -// Parameters for crop hints annotation request. -message CropHintsParams { - // Aspect ratios in floats, representing the ratio of the width to the height - // of the image. For example, if the desired aspect ratio is 4/3, the - // corresponding float value should be 1.33333. If not specified, the - // best possible crop is returned. The number of provided aspect ratios is - // limited to a maximum of 16; any aspect ratios provided after the 16th are - // ignored. - repeated float aspect_ratios = 1; -} - -// Parameters for web detection request. -message WebDetectionParams { - // Whether to include results derived from the geo information in the image. - bool include_geo_results = 2; -} - -// Image context and/or feature-specific parameters. -message ImageContext { - // Not used. - LatLongRect lat_long_rect = 1; - - // List of languages to use for TEXT_DETECTION. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Text detection returns an - // error if one or more of the specified languages is not one of the - // [supported languages](/vision/docs/languages). - repeated string language_hints = 2; - - // Parameters for crop hints annotation request. - CropHintsParams crop_hints_params = 4; - - // Parameters for web detection. - WebDetectionParams web_detection_params = 6; -} - -// Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features. -message AnnotateImageRequest { - // The image to be processed. - Image image = 1; - - // Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image. - ImageContext image_context = 3; -} - -// If an image was produced from a file (e.g. a PDF), this message gives -// information about the source of that image. -message ImageAnnotationContext { - // The URI of the file used to produce the image. - string uri = 1; - - // If the file was a PDF or TIFF, this field gives the page number within - // the file used to produce the image. - int32 page_number = 2; -} - -// Response to an image annotation request. -message AnnotateImageResponse { - // If present, face detection has completed successfully. - repeated FaceAnnotation face_annotations = 1; - - // If present, landmark detection has completed successfully. - repeated EntityAnnotation landmark_annotations = 2; - - // If present, logo detection has completed successfully. - repeated EntityAnnotation logo_annotations = 3; - - // If present, label detection has completed successfully. - repeated EntityAnnotation label_annotations = 4; - - // If present, text (OCR) detection has completed successfully. - repeated EntityAnnotation text_annotations = 5; - - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. - // This annotation provides the structural hierarchy for the OCR detected - // text. - TextAnnotation full_text_annotation = 12; - - // If present, safe-search annotation has completed successfully. - SafeSearchAnnotation safe_search_annotation = 6; - - // If present, image properties were extracted successfully. - ImageProperties image_properties_annotation = 8; - - // If present, crop hints have completed successfully. - CropHintsAnnotation crop_hints_annotation = 11; - - // If present, web detection has completed successfully. - WebDetection web_detection = 13; - - // If set, represents the error message for the operation. - // Note that filled-in image annotations are guaranteed to be - // correct, even when `error` is set. - google.rpc.Status error = 9; - - // If present, contextual information is needed to understand where this image - // comes from. - ImageAnnotationContext context = 21; -} - -// Response to a single file annotation request. A file may contain one or more -// images, which individually have their own responses. -message AnnotateFileResponse { - // Information about the file for which this response is generated. - InputConfig input_config = 1; - - // Individual responses to images found within the file. - repeated AnnotateImageResponse responses = 2; -} - -// Multiple image annotation requests are batched into a single service call. -message BatchAnnotateImagesRequest { - // Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1; -} - -// Response to a batch image annotation request. -message BatchAnnotateImagesResponse { - // Individual responses to image annotation requests within the batch. - repeated AnnotateImageResponse responses = 1; -} - -// An offline file annotation request. -message AsyncAnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 4; -} - -// The response for a single offline file annotation request. -message AsyncAnnotateFileResponse { - // The output location and metadata from AsyncAnnotateFileRequest. - OutputConfig output_config = 1; -} - -// Multiple async file annotation requests are batched into a single service -// call. -message AsyncBatchAnnotateFilesRequest { - // Individual async file annotation requests for this batch. - repeated AsyncAnnotateFileRequest requests = 1; -} - -// Response to an async batch file annotation request. -message AsyncBatchAnnotateFilesResponse { - // The list of file annotation responses, one for each request in - // AsyncBatchAnnotateFilesRequest. - repeated AsyncAnnotateFileResponse responses = 1; -} - -// The desired input location and metadata. -message InputConfig { - // The Google Cloud Storage location to read the input from. - GcsSource gcs_source = 1; - - // The type of the file. Currently only "application/pdf" and "image/tiff" - // are supported. Wildcards are not supported. - string mime_type = 2; -} - -// The desired output location and metadata. -message OutputConfig { - // The Google Cloud Storage location to write the output(s) to. - GcsDestination gcs_destination = 1; - - // The max number of response protos to put into each output JSON file on GCS. - // The valid range is [1, 100]. If not specified, the default value is 20. - // - // For example, for one pdf file with 100 pages, 100 response protos will - // be generated. If `batch_size` = 20, then 5 json files each - // containing 20 response protos will be written under the prefix - // `gcs_destination`.`uri`. - // - // Currently, batch_size only applies to GcsDestination, with potential future - // support for other output configurations. - int32 batch_size = 2; -} - -// The Google Cloud Storage location where the input will be read from. -message GcsSource { - // Google Cloud Storage URI for the input file. This must only be a GCS - // object. Wildcards are not currently supported. - string uri = 1; -} - -// The Google Cloud Storage location where the output will be written to. -message GcsDestination { - // Google Cloud Storage URI where the results will be stored. Results will - // be in JSON format and preceded by its corresponding input URI. This field - // can either represent a single file, or a prefix for multiple outputs. - // Prefixes must end in a `/`. - // - // Examples: - // - // * File: gs://bucket-name/filename.json - // * Prefix: gs://bucket-name/prefix/here/ - // * File: gs://bucket-name/prefix/here - // - // If multiple outputs, each response is still AnnotateFileResponse, each of - // which contains some subset of the full list of AnnotateImageResponse. - // Multiple outputs can happen if, for example, the output JSON is too large - // and overflows into multiple sharded files. - string uri = 1; -} - -// Contains metadata for the BatchAnnotateImages operation. -message OperationMetadata { - // Batch operation states. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is received. - CREATED = 1; - - // Request is actively being processed. - RUNNING = 2; - - // The batch processing is done. - DONE = 3; - - // The batch processing was cancelled. - CANCELLED = 4; - } - - // Current state of the batch operation. - State state = 1; - - // The time when the batch request was received. - google.protobuf.Timestamp create_time = 5; - - // The time when the operation result was last updated. - google.protobuf.Timestamp update_time = 6; -} - -// A bucketized representation of likelihood, which is intended to give clients -// highly stable results across model upgrades. -enum Likelihood { - // Unknown likelihood. - UNKNOWN = 0; - - // It is very unlikely that the image belongs to the specified vertical. - VERY_UNLIKELY = 1; - - // It is unlikely that the image belongs to the specified vertical. - UNLIKELY = 2; - - // It is possible that the image belongs to the specified vertical. - POSSIBLE = 3; - - // It is likely that the image belongs to the specified vertical. - LIKELY = 4; - - // It is very likely that the image belongs to the specified vertical. - VERY_LIKELY = 5; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py b/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py deleted file mode 100644 index 50a553c3bb36..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py +++ /dev/null @@ -1,3935 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p2beta1/proto/image_annotator.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p2beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p2beta1.proto import ( - text_annotation_pb2 as google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_text__annotation__pb2, -) -from google.cloud.vision_v1p2beta1.proto import ( - web_detection_pb2 as google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_web__detection__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p2beta1/proto/image_annotator.proto", - package="google.cloud.vision.v1p2beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p2beta1B\023ImageAnnotatorProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p2beta1/proto/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p2beta1/proto/geometry.proto\x1a\x39google/cloud/vision_v1p2beta1/proto/text_annotation.proto\x1a\x37google/cloud/vision_v1p2beta1/proto/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto"\xe1\x02\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p2beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t"\xf6\x01\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p2beta1.ImageSource"\x9b\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p2beta1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xbc\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p2beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p2beta1.Property"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p2beta1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p2beta1.ColorInfo"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p2beta1.DominantColorsAnnotation"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p2beta1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\x85\x02\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p2beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p2beta1.CropHintsParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p2beta1.WebDetectionParams"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p2beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p2beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\x8a\x07\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p2beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p2beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p2beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p2beta1.EntityAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p2beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p2beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p2beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p2beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p2beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.WebDetection\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p2beta1.ImageAnnotationContext"\xa1\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p2beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.AnnotateImageResponse"c\n\x1a\x42\x61tchAnnotateImagesRequest\x12\x45\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p2beta1.AnnotateImageRequest"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.AnnotateImageResponse"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p2beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p2beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.OutputConfig"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.OutputConfig"k\n\x1e\x41syncBatchAnnotateFilesRequest\x12I\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse"^\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p2beta1.GcsSource\x12\x11\n\tmime_type\x18\x02 \x01(\t"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p2beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p2beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf0\x02\n\x0eImageAnnotator\x12\xb3\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse"%\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p2beta1/images:annotate:\x01*\x12\xa7\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation".\x82\xd3\xe4\x93\x02("#/v1p2beta1/files:asyncBatchAnnotate:\x01*B\x82\x01\n!com.google.cloud.vision.v1p2beta1B\x13ImageAnnotatorProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_text__annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_web__detection__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - ], -) - -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.vision.v1p2beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7139, - serialized_end=7240, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -UNKNOWN = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_FEATURE_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p2beta1.Feature.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LANDMARK_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOGO_DETECTION", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DOCUMENT_TEXT_DETECTION", - index=6, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SAFE_SEARCH_DETECTION", - index=7, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_PROPERTIES", - index=8, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CROP_HINTS", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WEB_DETECTION", - index=10, - number=10, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=544, - serialized_end=790, -) -_sym_db.RegisterEnumDescriptor(_FEATURE_TYPE) - -_FACEANNOTATION_LANDMARK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_LANDMARK", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_LEFT_EYEBROW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_LEFT_EYEBROW", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_RIGHT_EYEBROW", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_RIGHT_EYEBROW", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MIDPOINT_BETWEEN_EYES", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_TIP", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPPER_LIP", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOWER_LIP", index=10, number=10, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_LEFT", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_RIGHT", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_CENTER", index=13, number=13, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_RIGHT", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_LEFT", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_CENTER", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_TOP_BOUNDARY", - index=17, - number=17, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_RIGHT_CORNER", - index=18, - number=18, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_BOTTOM_BOUNDARY", - index=19, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_LEFT_CORNER", - index=20, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_TOP_BOUNDARY", - index=21, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_RIGHT_CORNER", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_BOTTOM_BOUNDARY", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_LEFT_CORNER", - index=24, - number=24, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYEBROW_UPPER_MIDPOINT", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYEBROW_UPPER_MIDPOINT", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EAR_TRAGION", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EAR_TRAGION", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_PUPIL", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_PUPIL", - index=30, - number=30, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FOREHEAD_GLABELLA", - index=31, - number=31, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_GNATHION", - index=32, - number=32, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_LEFT_GONION", - index=33, - number=33, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_RIGHT_GONION", - index=34, - number=34, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1935, - serialized_end=2755, -) -_sym_db.RegisterEnumDescriptor(_FACEANNOTATION_LANDMARK_TYPE) - -_OPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.vision.v1p2beta1.OperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DONE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7056, - serialized_end=7137, -) -_sym_db.RegisterEnumDescriptor(_OPERATIONMETADATA_STATE) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="google.cloud.vision.v1p2beta1.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p2beta1.Feature.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_results", - full_name="google.cloud.vision.v1p2beta1.Feature.max_results", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.vision.v1p2beta1.Feature.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FEATURE_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=437, - serialized_end=790, -) - - -_IMAGESOURCE = _descriptor.Descriptor( - name="ImageSource", - full_name="google.cloud.vision.v1p2beta1.ImageSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_image_uri", - full_name="google.cloud.vision.v1p2beta1.ImageSource.gcs_image_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.vision.v1p2beta1.ImageSource.image_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=792, - serialized_end=847, -) - - -_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.vision.v1p2beta1.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.vision.v1p2beta1.Image.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.cloud.vision.v1p2beta1.Image.source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=849, - serialized_end=933, -) - - -_FACEANNOTATION_LANDMARK = _descriptor.Descriptor( - name="Landmark", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.type", - index=0, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="position", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark.position", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FACEANNOTATION_LANDMARK_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1788, - serialized_end=2755, -) - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fd_bounding_poly", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.fd_bounding_poly", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarks", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.landmarks", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="roll_angle", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.roll_angle", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pan_angle", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.pan_angle", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tilt_angle", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.tilt_angle", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detection_confidence", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.detection_confidence", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarking_confidence", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.landmarking_confidence", - index=7, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="joy_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.joy_likelihood", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sorrow_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.sorrow_likelihood", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="anger_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.anger_likelihood", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="surprise_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.surprise_likelihood", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="under_exposed_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.under_exposed_likelihood", - index=12, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blurred_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.blurred_likelihood", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="headwear_likelihood", - full_name="google.cloud.vision.v1p2beta1.FaceAnnotation.headwear_likelihood", - index=14, - number=15, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FACEANNOTATION_LANDMARK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=936, - serialized_end=2755, -) - - -_LOCATIONINFO = _descriptor.Descriptor( - name="LocationInfo", - full_name="google.cloud.vision.v1p2beta1.LocationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.vision.v1p2beta1.LocationInfo.lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2757, - serialized_end=2809, -) - - -_PROPERTY = _descriptor.Descriptor( - name="Property", - full_name="google.cloud.vision.v1p2beta1.Property", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p2beta1.Property.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p2beta1.Property.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uint64_value", - full_name="google.cloud.vision.v1p2beta1.Property.uint64_value", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2811, - serialized_end=2872, -) - - -_ENTITYANNOTATION = _descriptor.Descriptor( - name="EntityAnnotation", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locale", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.locale", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topicality", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.topicality", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.bounding_poly", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.locations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="properties", - full_name="google.cloud.vision.v1p2beta1.EntityAnnotation.properties", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2875, - serialized_end=3191, -) - - -_SAFESEARCHANNOTATION = _descriptor.Descriptor( - name="SafeSearchAnnotation", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="adult", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation.adult", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spoof", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation.spoof", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="medical", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation.medical", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violence", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation.violence", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="racy", - full_name="google.cloud.vision.v1p2beta1.SafeSearchAnnotation.racy", - index=4, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3194, - serialized_end=3510, -) - - -_LATLONGRECT = _descriptor.Descriptor( - name="LatLongRect", - full_name="google.cloud.vision.v1p2beta1.LatLongRect", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min_lat_lng", - full_name="google.cloud.vision.v1p2beta1.LatLongRect.min_lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_lat_lng", - full_name="google.cloud.vision.v1p2beta1.LatLongRect.max_lat_lng", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3512, - serialized_end=3609, -) - - -_COLORINFO = _descriptor.Descriptor( - name="ColorInfo", - full_name="google.cloud.vision.v1p2beta1.ColorInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.vision.v1p2beta1.ColorInfo.color", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p2beta1.ColorInfo.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pixel_fraction", - full_name="google.cloud.vision.v1p2beta1.ColorInfo.pixel_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3611, - serialized_end=3696, -) - - -_DOMINANTCOLORSANNOTATION = _descriptor.Descriptor( - name="DominantColorsAnnotation", - full_name="google.cloud.vision.v1p2beta1.DominantColorsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="colors", - full_name="google.cloud.vision.v1p2beta1.DominantColorsAnnotation.colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3698, - serialized_end=3782, -) - - -_IMAGEPROPERTIES = _descriptor.Descriptor( - name="ImageProperties", - full_name="google.cloud.vision.v1p2beta1.ImageProperties", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dominant_colors", - full_name="google.cloud.vision.v1p2beta1.ImageProperties.dominant_colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3784, - serialized_end=3883, -) - - -_CROPHINT = _descriptor.Descriptor( - name="CropHint", - full_name="google.cloud.vision.v1p2beta1.CropHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p2beta1.CropHint.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.CropHint.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="importance_fraction", - full_name="google.cloud.vision.v1p2beta1.CropHint.importance_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3885, - serialized_end=4012, -) - - -_CROPHINTSANNOTATION = _descriptor.Descriptor( - name="CropHintsAnnotation", - full_name="google.cloud.vision.v1p2beta1.CropHintsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crop_hints", - full_name="google.cloud.vision.v1p2beta1.CropHintsAnnotation.crop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4014, - serialized_end=4096, -) - - -_CROPHINTSPARAMS = _descriptor.Descriptor( - name="CropHintsParams", - full_name="google.cloud.vision.v1p2beta1.CropHintsParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="aspect_ratios", - full_name="google.cloud.vision.v1p2beta1.CropHintsParams.aspect_ratios", - index=0, - number=1, - type=2, - cpp_type=6, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4098, - serialized_end=4138, -) - - -_WEBDETECTIONPARAMS = _descriptor.Descriptor( - name="WebDetectionParams", - full_name="google.cloud.vision.v1p2beta1.WebDetectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="include_geo_results", - full_name="google.cloud.vision.v1p2beta1.WebDetectionParams.include_geo_results", - index=0, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4140, - serialized_end=4189, -) - - -_IMAGECONTEXT = _descriptor.Descriptor( - name="ImageContext", - full_name="google.cloud.vision.v1p2beta1.ImageContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_long_rect", - full_name="google.cloud.vision.v1p2beta1.ImageContext.lat_long_rect", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.vision.v1p2beta1.ImageContext.language_hints", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_params", - full_name="google.cloud.vision.v1p2beta1.ImageContext.crop_hints_params", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection_params", - full_name="google.cloud.vision.v1p2beta1.ImageContext.web_detection_params", - index=3, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4192, - serialized_end=4453, -) - - -_ANNOTATEIMAGEREQUEST = _descriptor.Descriptor( - name="AnnotateImageRequest", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageRequest.image", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4456, - serialized_end=4657, -) - - -_IMAGEANNOTATIONCONTEXT = _descriptor.Descriptor( - name="ImageAnnotationContext", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotationContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotationContext.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotationContext.page_number", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4659, - serialized_end=4717, -) - - -_ANNOTATEIMAGERESPONSE = _descriptor.Descriptor( - name="AnnotateImageResponse", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.face_annotations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmark_annotations", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.landmark_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logo_annotations", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.logo_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_annotations", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.text_annotations", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_text_annotation", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.full_text_annotation", - index=5, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="safe_search_annotation", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.safe_search_annotation", - index=6, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_properties_annotation", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.image_properties_annotation", - index=7, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_annotation", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.crop_hints_annotation", - index=8, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.web_detection", - index=9, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.error", - index=10, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="context", - full_name="google.cloud.vision.v1p2beta1.AnnotateImageResponse.context", - index=11, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4720, - serialized_end=5626, -) - - -_ANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AnnotateFileResponse", - full_name="google.cloud.vision.v1p2beta1.AnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p2beta1.AnnotateFileResponse.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p2beta1.AnnotateFileResponse.responses", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5629, - serialized_end=5790, -) - - -_BATCHANNOTATEIMAGESREQUEST = _descriptor.Descriptor( - name="BatchAnnotateImagesRequest", - full_name="google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5792, - serialized_end=5891, -) - - -_BATCHANNOTATEIMAGESRESPONSE = _descriptor.Descriptor( - name="BatchAnnotateImagesResponse", - full_name="google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5893, - serialized_end=5995, -) - - -_ASYNCANNOTATEFILEREQUEST = _descriptor.Descriptor( - name="AsyncAnnotateFileRequest", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest.output_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5998, - serialized_end=6284, -) - - -_ASYNCANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AsyncAnnotateFileResponse", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse.output_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6286, - serialized_end=6381, -) - - -_ASYNCBATCHANNOTATEFILESREQUEST = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesRequest", - full_name="google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6383, - serialized_end=6490, -) - - -_ASYNCBATCHANNOTATEFILESRESPONSE = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesResponse", - full_name="google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6492, - serialized_end=6602, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.vision.v1p2beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.vision.v1p2beta1.InputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.vision.v1p2beta1.InputConfig.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6604, - serialized_end=6698, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.vision.v1p2beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.vision.v1p2beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="batch_size", - full_name="google.cloud.vision.v1p2beta1.OutputConfig.batch_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6700, - serialized_end=6806, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.vision.v1p2beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p2beta1.GcsSource.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6808, - serialized_end=6832, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.vision.v1p2beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p2beta1.GcsDestination.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6834, - serialized_end=6863, -) - - -_OPERATIONMETADATA = _descriptor.Descriptor( - name="OperationMetadata", - full_name="google.cloud.vision.v1p2beta1.OperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.vision.v1p2beta1.OperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.vision.v1p2beta1.OperationMetadata.create_time", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.vision.v1p2beta1.OperationMetadata.update_time", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_OPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6866, - serialized_end=7137, -) - -_FEATURE.fields_by_name["type"].enum_type = _FEATURE_TYPE -_FEATURE_TYPE.containing_type = _FEATURE -_IMAGE.fields_by_name["source"].message_type = _IMAGESOURCE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "type" -].enum_type = _FACEANNOTATION_LANDMARK_TYPE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "position" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._POSITION -) -_FACEANNOTATION_LANDMARK.containing_type = _FACEANNOTATION -_FACEANNOTATION_LANDMARK_TYPE.containing_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name[ - "fd_bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name["landmarks"].message_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name["joy_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["sorrow_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["anger_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["surprise_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["under_exposed_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["blurred_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["headwear_likelihood"].enum_type = _LIKELIHOOD -_LOCATIONINFO.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_ENTITYANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_ENTITYANNOTATION.fields_by_name["locations"].message_type = _LOCATIONINFO -_ENTITYANNOTATION.fields_by_name["properties"].message_type = _PROPERTY -_SAFESEARCHANNOTATION.fields_by_name["adult"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["spoof"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["medical"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["violence"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["racy"].enum_type = _LIKELIHOOD -_LATLONGRECT.fields_by_name[ - "min_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LATLONGRECT.fields_by_name[ - "max_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_COLORINFO.fields_by_name["color"].message_type = google_dot_type_dot_color__pb2._COLOR -_DOMINANTCOLORSANNOTATION.fields_by_name["colors"].message_type = _COLORINFO -_IMAGEPROPERTIES.fields_by_name[ - "dominant_colors" -].message_type = _DOMINANTCOLORSANNOTATION -_CROPHINT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CROPHINTSANNOTATION.fields_by_name["crop_hints"].message_type = _CROPHINT -_IMAGECONTEXT.fields_by_name["lat_long_rect"].message_type = _LATLONGRECT -_IMAGECONTEXT.fields_by_name["crop_hints_params"].message_type = _CROPHINTSPARAMS -_IMAGECONTEXT.fields_by_name["web_detection_params"].message_type = _WEBDETECTIONPARAMS -_ANNOTATEIMAGEREQUEST.fields_by_name["image"].message_type = _IMAGE -_ANNOTATEIMAGEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ANNOTATEIMAGEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ANNOTATEIMAGERESPONSE.fields_by_name["face_annotations"].message_type = _FACEANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "landmark_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "logo_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "label_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "text_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "full_text_annotation" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_text__annotation__pb2._TEXTANNOTATION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "safe_search_annotation" -].message_type = _SAFESEARCHANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "image_properties_annotation" -].message_type = _IMAGEPROPERTIES -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "crop_hints_annotation" -].message_type = _CROPHINTSANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "web_detection" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_web__detection__pb2._WEBDETECTION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEIMAGERESPONSE.fields_by_name["context"].message_type = _IMAGEANNOTATIONCONTEXT -_ANNOTATEFILERESPONSE.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ANNOTATEFILERESPONSE.fields_by_name["responses"].message_type = _ANNOTATEIMAGERESPONSE -_BATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEIMAGEREQUEST -_BATCHANNOTATEIMAGESRESPONSE.fields_by_name[ - "responses" -].message_type = _ANNOTATEIMAGERESPONSE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ASYNCANNOTATEFILEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ASYNCANNOTATEFILEREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCANNOTATEFILERESPONSE.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCBATCHANNOTATEFILESREQUEST.fields_by_name[ - "requests" -].message_type = _ASYNCANNOTATEFILEREQUEST -_ASYNCBATCHANNOTATEFILESRESPONSE.fields_by_name[ - "responses" -].message_type = _ASYNCANNOTATEFILERESPONSE -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OPERATIONMETADATA.fields_by_name["state"].enum_type = _OPERATIONMETADATA_STATE -_OPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA_STATE.containing_type = _OPERATIONMETADATA -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["ImageSource"] = _IMAGESOURCE -DESCRIPTOR.message_types_by_name["Image"] = _IMAGE -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["LocationInfo"] = _LOCATIONINFO -DESCRIPTOR.message_types_by_name["Property"] = _PROPERTY -DESCRIPTOR.message_types_by_name["EntityAnnotation"] = _ENTITYANNOTATION -DESCRIPTOR.message_types_by_name["SafeSearchAnnotation"] = _SAFESEARCHANNOTATION -DESCRIPTOR.message_types_by_name["LatLongRect"] = _LATLONGRECT -DESCRIPTOR.message_types_by_name["ColorInfo"] = _COLORINFO -DESCRIPTOR.message_types_by_name["DominantColorsAnnotation"] = _DOMINANTCOLORSANNOTATION -DESCRIPTOR.message_types_by_name["ImageProperties"] = _IMAGEPROPERTIES -DESCRIPTOR.message_types_by_name["CropHint"] = _CROPHINT -DESCRIPTOR.message_types_by_name["CropHintsAnnotation"] = _CROPHINTSANNOTATION -DESCRIPTOR.message_types_by_name["CropHintsParams"] = _CROPHINTSPARAMS -DESCRIPTOR.message_types_by_name["WebDetectionParams"] = _WEBDETECTIONPARAMS -DESCRIPTOR.message_types_by_name["ImageContext"] = _IMAGECONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageRequest"] = _ANNOTATEIMAGEREQUEST -DESCRIPTOR.message_types_by_name["ImageAnnotationContext"] = _IMAGEANNOTATIONCONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageResponse"] = _ANNOTATEIMAGERESPONSE -DESCRIPTOR.message_types_by_name["AnnotateFileResponse"] = _ANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesRequest" -] = _BATCHANNOTATEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesResponse" -] = _BATCHANNOTATEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name["AsyncAnnotateFileRequest"] = _ASYNCANNOTATEFILEREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncAnnotateFileResponse" -] = _ASYNCANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesRequest" -] = _ASYNCBATCHANNOTATEFILESREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesResponse" -] = _ASYNCBATCHANNOTATEFILESRESPONSE -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OperationMetadata"] = _OPERATIONMETADATA -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Feature = _reflection.GeneratedProtocolMessageType( - "Feature", - (_message.Message,), - dict( - DESCRIPTOR=_FEATURE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The type of Google Cloud Vision API detection to perform, - and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. - - - Attributes: - type: - The feature type. - max_results: - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. - model: - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Feature) - ), -) -_sym_db.RegisterMessage(Feature) - -ImageSource = _reflection.GeneratedProtocolMessageType( - "ImageSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGESOURCE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""External image source (Google Cloud Storage or web URL - image location). - - - Attributes: - gcs_image_uri: - \ **Use ``image_uri`` instead.** The Google Cloud Storage URI - of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - image_uri: - The URI of the source image. Can be either: 1. A Google Cloud - Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ for - more info. 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS URLs, Google cannot - guarantee that the request will be completed. Your request - may fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for production - applications. When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ImageSource) - ), -) -_sym_db.RegisterMessage(ImageSource) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Client image to perform Google Cloud Vision API tasks - over. - - - Attributes: - content: - Image content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - source: - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - Landmark=_reflection.GeneratedProtocolMessageType( - "Landmark", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION_LANDMARK, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""A face-specific landmark (for example, a face feature). - - - Attributes: - type: - Face landmark type. - position: - Face landmark position. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.FaceAnnotation.Landmark) - ), - ), - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""A face annotation object contains the results of face - detection. - - - Attributes: - bounding_poly: - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned in - ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on the - landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. - fd_bounding_poly: - The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on the - initial face detection, hence the fd (face detection) prefix. - landmarks: - Detected face landmarks. - roll_angle: - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation of the face relative to the image vertical - about the axis perpendicular to the face. Range [-180,180]. - pan_angle: - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. - tilt_angle: - Pitch angle, which indicates the upwards/downwards angle that - the face is pointing relative to the image's horizontal plane. - Range [-180,180]. - detection_confidence: - Detection confidence. Range [0, 1]. - landmarking_confidence: - Face landmarking confidence. Range [0, 1]. - joy_likelihood: - Joy likelihood. - sorrow_likelihood: - Sorrow likelihood. - anger_likelihood: - Anger likelihood. - surprise_likelihood: - Surprise likelihood. - under_exposed_likelihood: - Under-exposed likelihood. - blurred_likelihood: - Blurred likelihood. - headwear_likelihood: - Headwear likelihood. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) -_sym_db.RegisterMessage(FaceAnnotation.Landmark) - -LocationInfo = _reflection.GeneratedProtocolMessageType( - "LocationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONINFO, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Detected entity location information. - - - Attributes: - lat_lng: - lat/long location coordinates. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.LocationInfo) - ), -) -_sym_db.RegisterMessage(LocationInfo) - -Property = _reflection.GeneratedProtocolMessageType( - "Property", - (_message.Message,), - dict( - DESCRIPTOR=_PROPERTY, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""A ``Property`` consists of a user-supplied name/value - pair. - - - Attributes: - name: - Name of the property. - value: - Value of the property. - uint64_value: - Value of numeric properties. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Property) - ), -) -_sym_db.RegisterMessage(Property) - -EntityAnnotation = _reflection.GeneratedProtocolMessageType( - "EntityAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Set of detected entity features. - - - Attributes: - mid: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - locale: - The language code for the locale in which the entity textual - ``description`` is expressed. - description: - Entity textual description, expressed in its ``locale`` - language. - score: - Overall score of the result. Range [0, 1]. - confidence: - \ **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. - topicality: - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" than - to an image containing a detected distant towering building, - even though the confidence that there is a tower in each image - may be the same. Range [0, 1]. - bounding_poly: - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. - locations: - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place where - the image was taken. Location information is usually present - for landmarks. - properties: - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies the - entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.EntityAnnotation) - ), -) -_sym_db.RegisterMessage(EntityAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType( - "SafeSearchAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_SAFESEARCHANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Set of features pertaining to the image, computed by - computer vision methods over safe-search verticals (for example, adult, - spoof, medical, violence). - - - Attributes: - adult: - Represents the adult content likelihood for the image. Adult - content may contain elements such as nudity, pornographic - images or cartoons, or sexual activities. - spoof: - Spoof likelihood. The likelihood that an modification was made - to the image's canonical version to make it appear funny or - offensive. - medical: - Likelihood that this is a medical image. - violence: - Likelihood that this image contains violent content. - racy: - Likelihood that the request image contains racy content. Racy - content may include (but is not limited to) skimpy or sheer - clothing, strategically covered nudity, lewd or provocative - poses, or close-ups of sensitive body areas. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.SafeSearchAnnotation) - ), -) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -LatLongRect = _reflection.GeneratedProtocolMessageType( - "LatLongRect", - (_message.Message,), - dict( - DESCRIPTOR=_LATLONGRECT, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Rectangle determined by min and max ``LatLng`` pairs. - - - Attributes: - min_lat_lng: - Min lat/long pair. - max_lat_lng: - Max lat/long pair. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.LatLongRect) - ), -) -_sym_db.RegisterMessage(LatLongRect) - -ColorInfo = _reflection.GeneratedProtocolMessageType( - "ColorInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COLORINFO, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Color information consists of RGB channels, score, and the - fraction of the image that the color occupies in the image. - - - Attributes: - color: - RGB components of the color. - score: - Image-specific score for this color. Value in range [0, 1]. - pixel_fraction: - The fraction of pixels the color occupies in the image. Value - in range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ColorInfo) - ), -) -_sym_db.RegisterMessage(ColorInfo) - -DominantColorsAnnotation = _reflection.GeneratedProtocolMessageType( - "DominantColorsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_DOMINANTCOLORSANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Set of dominant colors and their corresponding scores. - - - Attributes: - colors: - RGB color values with their score and pixel fraction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.DominantColorsAnnotation) - ), -) -_sym_db.RegisterMessage(DominantColorsAnnotation) - -ImageProperties = _reflection.GeneratedProtocolMessageType( - "ImageProperties", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPROPERTIES, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Stores image properties, such as dominant colors. - - - Attributes: - dominant_colors: - If present, dominant colors completed successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ImageProperties) - ), -) -_sym_db.RegisterMessage(ImageProperties) - -CropHint = _reflection.GeneratedProtocolMessageType( - "CropHint", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINT, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Single crop hint that is used to generate a new crop when - serving an image. - - - Attributes: - bounding_poly: - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. - confidence: - Confidence of this being a salient region. Range [0, 1]. - importance_fraction: - Fraction of importance of this salient region with respect to - the original image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.CropHint) - ), -) -_sym_db.RegisterMessage(CropHint) - -CropHintsAnnotation = _reflection.GeneratedProtocolMessageType( - "CropHintsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Set of crop hints that are used to generate new crops when - serving images. - - - Attributes: - crop_hints: - Crop hint results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.CropHintsAnnotation) - ), -) -_sym_db.RegisterMessage(CropHintsAnnotation) - -CropHintsParams = _reflection.GeneratedProtocolMessageType( - "CropHintsParams", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSPARAMS, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Parameters for crop hints annotation request. - - - Attributes: - aspect_ratios: - Aspect ratios in floats, representing the ratio of the width - to the height of the image. For example, if the desired aspect - ratio is 4/3, the corresponding float value should be 1.33333. - If not specified, the best possible crop is returned. The - number of provided aspect ratios is limited to a maximum of - 16; any aspect ratios provided after the 16th are ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.CropHintsParams) - ), -) -_sym_db.RegisterMessage(CropHintsParams) - -WebDetectionParams = _reflection.GeneratedProtocolMessageType( - "WebDetectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTIONPARAMS, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Parameters for web detection request. - - - Attributes: - include_geo_results: - Whether to include results derived from the geo information in - the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetectionParams) - ), -) -_sym_db.RegisterMessage(WebDetectionParams) - -ImageContext = _reflection.GeneratedProtocolMessageType( - "ImageContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECONTEXT, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Image context and/or feature-specific parameters. - - - Attributes: - lat_long_rect: - Not used. - language_hints: - List of languages to use for TEXT\_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not needed. In rare - cases, when the language of the text in the image is known, - setting a hint will help get better results (although it will - be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. - crop_hints_params: - Parameters for crop hints annotation request. - web_detection_params: - Parameters for web detection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ImageContext) - ), -) -_sym_db.RegisterMessage(ImageContext) - -AnnotateImageRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGEREQUEST, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Request for performing Google Cloud Vision API tasks over - a user-provided image, with user-requested features. - - - Attributes: - image: - The image to be processed. - features: - Requested features. - image_context: - Additional context that may accompany the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AnnotateImageRequest) - ), -) -_sym_db.RegisterMessage(AnnotateImageRequest) - -ImageAnnotationContext = _reflection.GeneratedProtocolMessageType( - "ImageAnnotationContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEANNOTATIONCONTEXT, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""If an image was produced from a file (e.g. a PDF), this - message gives information about the source of that image. - - - Attributes: - uri: - The URI of the file used to produce the image. - page_number: - If the file was a PDF or TIFF, this field gives the page - number within the file used to produce the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.ImageAnnotationContext) - ), -) -_sym_db.RegisterMessage(ImageAnnotationContext) - -AnnotateImageResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateImageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGERESPONSE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Response to an image annotation request. - - - Attributes: - face_annotations: - If present, face detection has completed successfully. - landmark_annotations: - If present, landmark detection has completed successfully. - logo_annotations: - If present, logo detection has completed successfully. - label_annotations: - If present, label detection has completed successfully. - text_annotations: - If present, text (OCR) detection has completed successfully. - full_text_annotation: - If present, text (OCR) detection or document (OCR) text - detection has completed successfully. This annotation provides - the structural hierarchy for the OCR detected text. - safe_search_annotation: - If present, safe-search annotation has completed successfully. - image_properties_annotation: - If present, image properties were extracted successfully. - crop_hints_annotation: - If present, crop hints have completed successfully. - web_detection: - If present, web detection has completed successfully. - error: - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be correct, - even when ``error`` is set. - context: - If present, contextual information is needed to understand - where this image comes from. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AnnotateImageResponse) - ), -) -_sym_db.RegisterMessage(AnnotateImageResponse) - -AnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Response to a single file annotation request. A file may - contain one or more images, which individually have their own responses. - - - Attributes: - input_config: - Information about the file for which this response is - generated. - responses: - Individual responses to images found within the file. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AnnotateFileResponse) - -BatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Multiple image annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual image annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.BatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesRequest) - -BatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Response to a batch image annotation request. - - - Attributes: - responses: - Individual responses to image annotation requests within the - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.BatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesResponse) - -AsyncAnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""An offline file annotation request. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - output_config: - Required. The desired output location and metadata (e.g. - format). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AsyncAnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileRequest) - -AsyncAnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The response for a single offline file annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncAnnotateFileRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AsyncAnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileResponse) - -AsyncBatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Multiple async file annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual async file annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesRequest) - -AsyncBatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Response to an async batch file annotation request. - - - Attributes: - responses: - The list of file annotation responses, one for each request in - AsyncBatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.AsyncBatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesResponse) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The desired input location and metadata. - - - Attributes: - gcs_source: - The Google Cloud Storage location to read the input from. - mime_type: - The type of the file. Currently only "application/pdf" and - "image/tiff" are supported. Wildcards are not supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The desired output location and metadata. - - - Attributes: - gcs_destination: - The Google Cloud Storage location to write the output(s) to. - batch_size: - The max number of response protos to put into each output JSON - file on GCS. The valid range is [1, 100]. If not specified, - the default value is 20. For example, for one pdf file with - 100 pages, 100 response protos will be generated. If - ``batch_size`` = 20, then 5 json files each containing 20 - response protos will be written under the prefix - ``gcs_destination``.\ ``uri``. Currently, batch\_size only - applies to GcsDestination, with potential future support for - other output configurations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the input will be - read from. - - - Attributes: - uri: - Google Cloud Storage URI for the input file. This must only be - a GCS object. Wildcards are not currently supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the output will be - written to. - - - Attributes: - uri: - Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. Examples: - File: gs://bucket- - name/filename.json - Prefix: gs://bucket-name/prefix/here/ - - File: gs://bucket-name/prefix/here If multiple outputs, each - response is still AnnotateFileResponse, each of which contains - some subset of the full list of AnnotateImageResponse. - Multiple outputs can happen if, for example, the output JSON - is too large and overflows into multiple sharded files. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.vision_v1p2beta1.proto.image_annotator_pb2", - __doc__="""Contains metadata for the BatchAnnotateImages operation. - - - Attributes: - state: - Current state of the batch operation. - create_time: - The time when the batch request was received. - update_time: - The time when the operation result was last updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - - -DESCRIPTOR._options = None - -_IMAGEANNOTATOR = _descriptor.ServiceDescriptor( - name="ImageAnnotator", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotator", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=7243, - serialized_end=7611, - methods=[ - _descriptor.MethodDescriptor( - name="BatchAnnotateImages", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotator.BatchAnnotateImages", - index=0, - containing_service=None, - input_type=_BATCHANNOTATEIMAGESREQUEST, - output_type=_BATCHANNOTATEIMAGESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p2beta1/images:annotate:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateFiles", - full_name="google.cloud.vision.v1p2beta1.ImageAnnotator.AsyncBatchAnnotateFiles", - index=1, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEFILESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002("#/v1p2beta1/files:asyncBatchAnnotate:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_IMAGEANNOTATOR) - -DESCRIPTOR.services_by_name["ImageAnnotator"] = _IMAGEANNOTATOR - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py b/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py deleted file mode 100644 index 9fb214587c2a..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p2beta1.proto import ( - image_annotator_pb2 as google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class ImageAnnotatorStub(object): - """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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchAnnotateImages = channel.unary_unary( - "/google.cloud.vision.v1p2beta1.ImageAnnotator/BatchAnnotateImages", - request_serializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.FromString, - ) - self.AsyncBatchAnnotateFiles = channel.unary_unary( - "/google.cloud.vision.v1p2beta1.ImageAnnotator/AsyncBatchAnnotateFiles", - request_serializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ImageAnnotatorServicer(object): - """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. - """ - - def BatchAnnotateImages(self, request, context): - """Run image detection and annotation for a batch of images. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AsyncBatchAnnotateFiles(self, request, context): - """Run async image detection and annotation for a list of generic files (e.g. - PDF) 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). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ImageAnnotatorServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchAnnotateImages": grpc.unary_unary_rpc_method_handler( - servicer.BatchAnnotateImages, - request_deserializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.SerializeToString, - ), - "AsyncBatchAnnotateFiles": grpc.unary_unary_rpc_method_handler( - servicer.AsyncBatchAnnotateFiles, - request_deserializer=google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p2beta1.ImageAnnotator", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p2beta1/proto/product_search.proto b/vision/google/cloud/vision_v1p2beta1/proto/product_search.proto deleted file mode 100644 index 85e4e0784e1c..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/product_search.proto +++ /dev/null @@ -1,161 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/cloud/vision/v1p3beta1/product_search_service.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - - -// Parameters for a product search request. -message ProductSearchParams { - // The resource name of the catalog to search. - // - // Format is: `productSearch/catalogs/CATALOG_NAME`. - string catalog_name = 1; - - // The category to search in. - // Optional. It is inferred by the system if it is not specified. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 2; - - // The product category to search in. - // Optional. It is inferred by the system if it is not specified. - // Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`, - // `skirt`, `top`, `shorts`, and `pants`. - string product_category = 5; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - // [Deprecated] Use `bounding_poly`. - NormalizedBoundingPoly normalized_bounding_poly = 3; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - BoundingPoly bounding_poly = 9; - - // Specifies the verbosity of the product search results. - // Optional. Defaults to `BASIC`. - ProductSearchResultsView view = 4; - - // The resource name of a [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for similar images. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - string product_set = 6; - - // The list of product categories to search in. Currently, we only consider - // the first category, and either "homegoods" or "apparel" should be - // specified. - repeated string product_categories = 7; - - // The filtering expression. This can be used to restrict search results based - // on Product labels. We currently support an AND of OR of key-value - // expressions, where each expression within an OR must have the same key. - // - // For example, "(color = red OR color = blue) AND brand = Google" is - // acceptable, but not "(color = red OR brand = Google)" or "color: red". - string filter = 8; -} - -// Results for a product search request. -message ProductSearchResults { - // Information about a product. - message ProductInfo { - // Product ID. - string product_id = 1; - - // The URI of the image which matched the query image. - // - // This field is returned only if `view` is set to `FULL` in - // the request. - string image_uri = 2; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 3; - } - - // Information about a product. - message Result { - // The Product. - Product product = 1; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 2; - - // The resource name of the image from the product that is the closest match - // to the query. - string image = 3; - } - - // Product category. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 1; - - // Product category. - // Supported values are `bag` and `shoe`. - // [Deprecated] `product_category` is provided in each Product. - string product_category = 4; - - // Timestamp of the index which provided these results. Changes made after - // this time are not reflected in the current results. - google.protobuf.Timestamp index_time = 2; - - // List of detected products. - repeated ProductInfo products = 3; - - // List of results, one for each product match. - repeated Result results = 5; -} - -// Supported product search categories. -enum ProductSearchCategory { - // Default value used when a category is not specified. - PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; - - // Shoes category. - SHOES = 1; - - // Bags category. - BAGS = 2; -} - -// Specifies the fields to include in product search results. -enum ProductSearchResultsView { - // Product search results contain only `product_category` and `product_id`. - // Default value. - BASIC = 0; - - // Product search results contain `product_category`, `product_id`, - // `image_uri`, and `score`. - FULL = 1; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/product_search_service.proto b/vision/google/cloud/vision_v1p2beta1/proto/product_search_service.proto deleted file mode 100644 index 90388e36e228..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/product_search_service.proto +++ /dev/null @@ -1,825 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchServiceProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - - -// 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.v1p3beta1.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.v1p3beta1.Product] resources, named -// `projects/*/locations/*/products/*` -// -// - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, named -// `projects/*/locations/*/products/*/referenceImages/*` -service ProductSearch { - // Creates and returns a new ProductSet resource. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - // 4096 characters. - rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - body: "product_set" - }; - } - - // Lists ProductSets in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - // than 1. - rpc ListProductSets(ListProductSetsRequest) returns (ListProductSetsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - }; - } - - // Gets information associated with a ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc GetProductSet(GetProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - patch: "/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}" - body: "product_set" - }; - } - - // Permanently deletes a ProductSet. All Products and ReferenceImages in the - // ProductSet will be deleted. - // - // The actual image files are not deleted from Google Cloud Storage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc DeleteProductSet(DeleteProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc CreateProduct(CreateProductRequest) returns (Product) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/products" - body: "product" - }; - } - - // Lists products in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/products" - }; - } - - // Gets information associated with a Product. - // - // Possible errors: - // - // * Returns NOT_FOUND if the Product does not exist. - rpc GetProduct(GetProductRequest) returns (Product) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // Makes changes to a Product resource. - // Only display_name, description and labels 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. - rpc UpdateProduct(UpdateProductRequest) returns (Product) { - option (google.api.http) = { - patch: "/v1p3beta1/{product.name=projects/*/locations/*/products/*}" - body: "product" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the product does not exist. - rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // 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. - rpc CreateReferenceImage(CreateReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - body: "reference_image" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the reference image does not exist. - rpc DeleteReferenceImage(DeleteReferenceImageRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc ListReferenceImages(ListReferenceImagesRequest) returns (ListReferenceImagesResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - }; - } - - // Gets information associated with a ReferenceImage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the specified image does not exist. - rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc AddProductToProductSet(AddProductToProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct" - body: "*" - }; - } - - // Removes a Product from the specified ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND If the Product is not found under the ProductSet. - rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct" - body: "*" - }; - } - - // 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. - rpc ListProductsInProductSet(ListProductsInProductSetRequest) returns (ListProductsInProductSetResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" - }; - } - - // 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.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc ImportProductSets(ImportProductSetsRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets:import" - body: "*" - }; - } -} - -// A Product contains ReferenceImages. -message Product { - // A product label represented as a key-value pair. - message KeyValue { - // The key of the label attached to the product. Cannot be empty and cannot - // exceed 128 bytes. - string key = 1; - - // The value of the label attached to the product. Cannot be empty and - // cannot exceed 128 bytes. - string value = 2; - } - - // The resource name of the product. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - // - // This field is ignored when creating a product. - string name = 1; - - // The user-provided name for this Product. Must not be empty. Must be at most - // 4096 characters long. - string display_name = 2; - - // User-provided metadata to be stored with this product. Must be at most 4096 - // characters long. - string description = 3; - - // The category for the product identified by the reference image. This should - // be either "homegoods" or "apparel". - // - // This field is immutable. - string product_category = 4; - - // Key-value pairs that can be attached to a product. At query time, - // constraints can be specified based on the product_labels. - // - // Note that integer values can be provided as strings, e.g. "1199". Only - // strings with integer values can match a range-based restriction which is - // to be supported soon. - // - // Multiple values can be assigned to the same key. One product may have up to - // 100 product_labels. - repeated KeyValue product_labels = 5; -} - -// A ProductSet contains Products. A ProductSet can contain a maximum of 1 -// million reference images. If the limit is exceeded, periodic indexing will -// fail. -message ProductSet { - // The resource name of the ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - // - // This field is ignored when creating a ProductSet. - string name = 1; - - // The user-provided name for this ProductSet. Must not be empty. Must be at - // most 4096 characters long. - string display_name = 2; - - // Output only. The time at which this ProductSet was last indexed. Query - // results will reflect all updates before this time. If this ProductSet has - // never been indexed, this field is 0. - // - // This field is ignored when creating a ProductSet. - google.protobuf.Timestamp index_time = 3; - - // Output only. If there was an error with indexing the product set, the field - // is populated. - // - // This field is ignored when creating a ProductSet. - google.rpc.Status index_error = 4; -} - -// A `ReferenceImage` represents a product image and its associated metadata, -// such as bounding boxes. -message ReferenceImage { - // The resource name of the reference image. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - // - // This field is ignored when creating a reference image. - string name = 1; - - // The Google Cloud Storage URI of the reference image. - // - // The URI must start with `gs://`. - // - // Required. - string uri = 2; - - // Bounding polygons around the areas of interest in the reference image. - // Optional. If this field is empty, the system will try to detect regions of - // interest. At most 10 bounding polygons will be used. - // - // The provided shape is converted into a non-rotated rectangle. Once - // converted, the small edge of the rectangle must be greater than or equal - // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - // is not). - repeated BoundingPoly bounding_polys = 3; -} - -// Request message for the `CreateProduct` method. -message CreateProductRequest { - // The project in which the Product should be created. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The product to create. - Product product = 2; - - // A user-supplied resource id for this Product. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_id = 3; -} - -// Request message for the `ListProducts` method. -message ListProductsRequest { - // The project OR ProductSet from which Products should be listed. - // - // Format: - // `projects/PROJECT_ID/locations/LOC_ID` - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProducts` method. -message ListProductsResponse { - // List of products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProduct` method. -message GetProductRequest { - // Resource name of the Product to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `UpdateProduct` method. -message UpdateProductRequest { - // The Product resource which replaces the one on the server. - // product.name is immutable. - Product product = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields - // to update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask paths include `product_labels`, `display_name` and - // `description`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProduct` method. -message DeleteProductRequest { - // Resource name of product to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `CreateProductSet` method. -message CreateProductSetRequest { - // The project in which the ProductSet should be created. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The ProductSet to create. - ProductSet product_set = 2; - - // A user-supplied resource id for this ProductSet. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_set_id = 3; -} - -// Request message for the `ListProductSets` method. -message ListProductSetsRequest { - // The project from which ProductSets should be listed. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductSets` method. -message ListProductSetsResponse { - // List of ProductSets. - repeated ProductSet product_sets = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProductSet` method. -message GetProductSetRequest { - // Resource name of the ProductSet to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `UpdateProductSet` method. -message UpdateProductSetRequest { - // The ProductSet resource which replaces the one on the server. - ProductSet product_set = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to - // update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask path is `display_name`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProductSet` method. -message DeleteProductSetRequest { - // Resource name of the ProductSet to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `CreateReferenceImage` method. -message CreateReferenceImageRequest { - // Resource name of the product in which to create the reference image. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The reference image to create. - // If an image ID is specified, it is ignored. - ReferenceImage reference_image = 2; - - // A user-supplied resource id for the ReferenceImage to be added. If set, - // the server will attempt to use this value as the resource id. If it is - // already in use, an error is returned with code ALREADY_EXISTS. Must be at - // most 128 characters long. It cannot contain the character `/`. - string reference_image_id = 3; -} - -// Request message for the `ListReferenceImages` method. -message ListReferenceImagesRequest { - // Resource name of the product containing the reference images. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // A token identifying a page of results to be returned. This is the value - // of `nextPageToken` returned in a previous reference image list request. - // - // Defaults to the first page if not specified. - string page_token = 3; -} - -// Response message for the `ListReferenceImages` method. -message ListReferenceImagesResponse { - // The list of reference images. - repeated ReferenceImage reference_images = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string next_page_token = 3; -} - -// Request message for the `GetReferenceImage` method. -message GetReferenceImageRequest { - // The resource name of the ReferenceImage to get. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - string name = 1; -} - -// Request message for the `DeleteReferenceImage` method. -message DeleteReferenceImageRequest { - // The resource name of the reference image to delete. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - string name = 1; -} - -// Request message for the `AddProductToProductSet` method. -message AddProductToProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be added to this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `RemoveProductFromProductSet` method. -message RemoveProductFromProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be removed from this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `ListProductsInProductSet` method. -message ListProductsInProductSetRequest { - // The ProductSet resource for which to retrieve Products. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductsInProductSet` method. -message ListProductsInProductSetResponse { - // The list of Products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// The Google Cloud Storage location for a csv file which preserves a list of -// ImportProductSetRequests in each line. -message ImportProductSetsGcsSource { - // The Google Cloud Storage URI of the input csv file. - // - // The URI must start with gs:// - // - // The format of the input csv file should be one image per line. - // In each line, there are 6 columns. - // 1. image_uri - // 2, image_id - // 3. product_set_id - // 4. product_id - // 5, product_category - // 6, product_display_name - // 7, labels - // 8. bounding_poly - // - // Columns 1, 3, 4, and 5 are required, other columns are optional. A new - // ProductSet/Product with the same id will be created on the fly - // if the ProductSet/Product specified by product_set_id/product_id does not - // exist. - // - // The image_id field is optional but has to be unique if provided. If it is - // empty, we will automatically assign an unique id to the image. - // - // The product_display_name field is optional. If it is empty, a space (" ") - // is used as the place holder for the product display_name, which can - // be updated later through the realtime API. - // - // If the Product with product_id already exists, the fields - // product_display_name, product_category and labels are ignored. - // - // If a Product doesn't exist and needs to be created on the fly, the - // product_display_name field refers to [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], the - // product_category field refers to [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], and the - // labels field refers to [Product.labels][]. - // - // Labels (optional) should be a line containing a list of comma-separated - // key-value pairs, with the format - // "key_1=value_1,key_2=value_2,...,key_n=value_n". - // - // The bounding_poly (optional) field is used to identify one region of - // interest from the image in the same manner as CreateReferenceImage. If no - // bounding_poly is specified, the system will try to detect regions of - // interest automatically. - // - // Note that the pipeline will resize the image if the image resolution is too - // large to process (above 20MP). - // - // Also note that at most one bounding_poly is allowed per line. If the image - // contains multiple regions of interest, the csv should contain one line per - // region of interest. - // - // The bounding_poly column should contain an even number of comma-separated - // numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative - // integers should be used for absolute bounding polygons, and float values - // in [0, 1] should be used for normalized bounding polygons. - string csv_file_uri = 1; -} - -// The input content for the `ImportProductSets` method. -message ImportProductSetsInputConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for a csv file which preserves a list - // of ImportProductSetRequests in each line. - ImportProductSetsGcsSource gcs_source = 1; - } -} - -// Request message for the `ImportProductSets` method. -message ImportProductSetsRequest { - // The project in which the ProductSets should be imported. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The input content for the list of requests. - ImportProductSetsInputConfig input_config = 2; -} - -// Response message for the `ImportProductSets` method. -// -// This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] field. -message ImportProductSetsResponse { - // The list of reference_images that are imported successfully. - repeated ReferenceImage reference_images = 1; - - // The rpc status for each ImportProductSet request, including both successes - // and errors. - // - // The number of statuses here matches the number of lines in the csv file, - // and statuses[i] stores the success or failure status of processing the i-th - // line of the csv, starting from line 0. - repeated google.rpc.Status statuses = 2; -} - -// Metadata for the batch operations such as the current state. -// -// This is included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message BatchOperationMetadata { - // Enumerates the possible states that the batch request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is actively being processed. - PROCESSING = 1; - - // The request is done and at least one item has been successfully - // processed. - SUCCESSFUL = 2; - - // The request is done and no item has been successfully processed. - FAILED = 3; - - // The request is done after the longrunning.Operations.CancelOperation has - // been called by the user. Any records that were processed before the - // cancel command are output as specified in the request. - CANCELLED = 4; - } - - // The current state of the batch operation. - State state = 1; - - // The time when the batch request was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the batch request is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is set to true. - google.protobuf.Timestamp end_time = 3; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation.proto b/vision/google/cloud/vision_v1p2beta1/proto/text_annotation.proto deleted file mode 100644 index b35eb47e8e45..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation.proto +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p2beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p2beta1/geometry.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "TextAnnotationProto"; -option java_package = "com.google.cloud.vision.v1p2beta1"; - -// TextAnnotation contains a structured representation of OCR extracted text. -// The hierarchy of an OCR extracted text structure is like this: -// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol -// Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please refer -// to the -// [TextAnnotation.TextProperty][google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty] -// message definition below for more detail. -message TextAnnotation { - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // Detected start or end of a structural component. - message DetectedBreak { - // Enum to denote the type of break found. New line, space etc. - enum BreakType { - // Unknown break label type. - UNKNOWN = 0; - - // Regular space. - SPACE = 1; - - // Sure space (very wide). - SURE_SPACE = 2; - - // Line-wrapping break. - EOL_SURE_SPACE = 3; - - // End-line hyphen that is not present in text; does not co-occur with - // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4; - - // Line break that ends a paragraph. - LINE_BREAK = 5; - } - - // Detected break type. - BreakType type = 1; - - // True if break prepends the element. - bool is_prefix = 2; - } - - // Additional information detected on the structural component. - message TextProperty { - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 1; - - // Detected start or end of a text segment. - DetectedBreak detected_break = 2; - } - - // List of pages detected by OCR. - repeated Page pages = 1; - - // UTF-8 text detected on the pages. - string text = 2; -} - -// Detected page from OCR. -message Page { - // Additional information detected on the page. - TextAnnotation.TextProperty property = 1; - - // Page width. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 width = 2; - - // Page height. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 height = 3; - - // List of blocks of text, images etc on this page. - repeated Block blocks = 4; - - // Confidence of the OCR results on the page. Range [0, 1]. - float confidence = 5; -} - -// Logical element on the page. -message Block { - // Type of a block (text, image etc) as identified by OCR. - enum BlockType { - // Unknown block type. - UNKNOWN = 0; - - // Regular text block. - TEXT = 1; - - // Table block. - TABLE = 2; - - // Image block. - PICTURE = 3; - - // Horizontal/vertical line box. - RULER = 4; - - // Barcode block. - BARCODE = 5; - } - - // Additional information detected for the block. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the block. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // - // * when the text is horizontal it might look like: - // - // 0----1 - // | | - // 3----2 - // - // * when it's rotated 180 degrees around the top-left corner it becomes: - // - // 2----3 - // | | - // 1----0 - // - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of paragraphs in this block (if this blocks is of type text). - repeated Paragraph paragraphs = 3; - - // Detected block type (text, image etc) for this block. - BlockType block_type = 4; - - // Confidence of the OCR results on the block. Range [0, 1]. - float confidence = 5; -} - -// Structural unit of text representing a number of words in certain order. -message Paragraph { - // Additional information detected for the paragraph. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the paragraph. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of words in this paragraph. - repeated Word words = 3; - - // Confidence of the OCR results for the paragraph. Range [0, 1]. - float confidence = 4; -} - -// A word representation. -message Word { - // Additional information detected for the word. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the word. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of symbols in the word. - // The order of the symbols follows the natural reading order. - repeated Symbol symbols = 3; - - // Confidence of the OCR results for the word. Range [0, 1]. - float confidence = 4; -} - -// A single symbol representation. -message Symbol { - // Additional information detected for the symbol. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the symbol. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // The actual UTF-8 representation of the symbol. - string text = 3; - - // Confidence of the OCR results for the symbol. Range [0, 1]. - float confidence = 4; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py b/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py deleted file mode 100644 index 4d63c57ffce4..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py +++ /dev/null @@ -1,1139 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p2beta1/proto/text_annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p2beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p2beta1/proto/text_annotation.proto", - package="google.cloud.vision.v1p2beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p2beta1B\023TextAnnotationProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p2beta1/proto/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p2beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p2beta1/proto/geometry.proto"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p2beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p2beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p2beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p2beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p2beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p2beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p2beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x82\x01\n!com.google.cloud.vision.v1p2beta1B\x13TextAnnotationProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - ], -) - - -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE = _descriptor.EnumDescriptor( - name="BreakType", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.BreakType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPACE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SURE_SPACE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EOL_SURE_SPACE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LINE_BREAK", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=444, - serialized_end=543, -) -_sym_db.RegisterEnumDescriptor(_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE) - -_BLOCK_BLOCKTYPE = _descriptor.EnumDescriptor( - name="BlockType", - full_name="google.cloud.vision.v1p2beta1.Block.BlockType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PICTURE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RULER", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BARCODE", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1236, - serialized_end=1318, -) -_sym_db.RegisterEnumDescriptor(_BLOCK_BLOCKTYPE) - - -_TEXTANNOTATION_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=259, - serialized_end=320, -) - -_TEXTANNOTATION_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_prefix", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak.is_prefix", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=323, - serialized_end=543, -) - -_TEXTANNOTATION_TEXTPROPERTY = _descriptor.Descriptor( - name="TextProperty", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.detected_languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=546, - serialized_end=737, -) - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.pages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p2beta1.TextAnnotation.text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _TEXTANNOTATION_DETECTEDLANGUAGE, - _TEXTANNOTATION_DETECTEDBREAK, - _TEXTANNOTATION_TEXTPROPERTY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=175, - serialized_end=737, -) - - -_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.vision.v1p2beta1.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p2beta1.Page.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.vision.v1p2beta1.Page.width", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.vision.v1p2beta1.Page.height", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.vision.v1p2beta1.Page.blocks", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.Page.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=740, - serialized_end=929, -) - - -_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.vision.v1p2beta1.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p2beta1.Block.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p2beta1.Block.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.vision.v1p2beta1.Block.paragraphs", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="block_type", - full_name="google.cloud.vision.v1p2beta1.Block.block_type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.Block.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BLOCK_BLOCKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=932, - serialized_end=1318, -) - - -_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.vision.v1p2beta1.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p2beta1.Paragraph.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p2beta1.Paragraph.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.vision.v1p2beta1.Paragraph.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.Paragraph.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1321, - serialized_end=1549, -) - - -_WORD = _descriptor.Descriptor( - name="Word", - full_name="google.cloud.vision.v1p2beta1.Word", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p2beta1.Word.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p2beta1.Word.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="symbols", - full_name="google.cloud.vision.v1p2beta1.Word.symbols", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.Word.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1552, - serialized_end=1779, -) - - -_SYMBOL = _descriptor.Descriptor( - name="Symbol", - full_name="google.cloud.vision.v1p2beta1.Symbol", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p2beta1.Symbol.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p2beta1.Symbol.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p2beta1.Symbol.text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p2beta1.Symbol.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1782, - serialized_end=1969, -) - -_TEXTANNOTATION_DETECTEDLANGUAGE.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE -_TEXTANNOTATION_DETECTEDBREAK.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE.containing_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_languages" -].message_type = _TEXTANNOTATION_DETECTEDLANGUAGE -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_break" -].message_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.containing_type = _TEXTANNOTATION -_TEXTANNOTATION.fields_by_name["pages"].message_type = _PAGE -_PAGE.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PAGE.fields_by_name["blocks"].message_type = _BLOCK -_BLOCK.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_BLOCK.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_BLOCK.fields_by_name["paragraphs"].message_type = _PARAGRAPH -_BLOCK.fields_by_name["block_type"].enum_type = _BLOCK_BLOCKTYPE -_BLOCK_BLOCKTYPE.containing_type = _BLOCK -_PARAGRAPH.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PARAGRAPH.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PARAGRAPH.fields_by_name["words"].message_type = _WORD -_WORD.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_WORD.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_WORD.fields_by_name["symbols"].message_type = _SYMBOL -_SYMBOL.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_SYMBOL.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p2beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["Page"] = _PAGE -DESCRIPTOR.message_types_by_name["Block"] = _BLOCK -DESCRIPTOR.message_types_by_name["Paragraph"] = _PARAGRAPH -DESCRIPTOR.message_types_by_name["Word"] = _WORD -DESCRIPTOR.message_types_by_name["Symbol"] = _SYMBOL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DetectedLanguage=_reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDLANGUAGE, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Detected language for a structural component. - - - Attributes: - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.TextAnnotation.DetectedLanguage) - ), - ), - DetectedBreak=_reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDBREAK, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Detected start or end of a structural component. - - - Attributes: - type: - Detected break type. - is_prefix: - True if break prepends the element. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.TextAnnotation.DetectedBreak) - ), - ), - TextProperty=_reflection.GeneratedProtocolMessageType( - "TextProperty", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_TEXTPROPERTY, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Additional information detected on the structural - component. - - - Attributes: - detected_languages: - A list of detected languages together with confidence. - detected_break: - Detected start or end of a text segment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty) - ), - ), - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have their - own properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p2beta1.TextAnnotation.TextProperty] - message definition below for more detail. - - - Attributes: - pages: - List of pages detected by OCR. - text: - UTF-8 text detected on the pages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) -_sym_db.RegisterMessage(TextAnnotation.DetectedLanguage) -_sym_db.RegisterMessage(TextAnnotation.DetectedBreak) -_sym_db.RegisterMessage(TextAnnotation.TextProperty) - -Page = _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - DESCRIPTOR=_PAGE, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Detected page from OCR. - - - Attributes: - property: - Additional information detected on the page. - width: - Page width. For PDFs the unit is points. For images (including - TIFFs) the unit is pixels. - height: - Page height. For PDFs the unit is points. For images - (including TIFFs) the unit is pixels. - blocks: - List of blocks of text, images etc on this page. - confidence: - Confidence of the OCR results on the page. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Page) - ), -) -_sym_db.RegisterMessage(Page) - -Block = _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_BLOCK, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Logical element on the page. - - - Attributes: - property: - Additional information detected for the block. - bounding_box: - The bounding box for the block. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: :: - 0----1 | | 3----2 - when it's rotated 180 - degrees around the top-left corner it becomes: :: - 2----3 | | 1----0 and the vertice order will - still be (0, 1, 2, 3). - paragraphs: - List of paragraphs in this block (if this blocks is of type - text). - block_type: - Detected block type (text, image etc) for this block. - confidence: - Confidence of the OCR results on the block. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Block) - ), -) -_sym_db.RegisterMessage(Block) - -Paragraph = _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_PARAGRAPH, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""Structural unit of text representing a number of words in - certain order. - - - Attributes: - property: - Additional information detected for the paragraph. - bounding_box: - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. When - a rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - words: - List of words in this paragraph. - confidence: - Confidence of the OCR results for the paragraph. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Paragraph) - ), -) -_sym_db.RegisterMessage(Paragraph) - -Word = _reflection.GeneratedProtocolMessageType( - "Word", - (_message.Message,), - dict( - DESCRIPTOR=_WORD, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""A word representation. - - - Attributes: - property: - Additional information detected for the word. - bounding_box: - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - symbols: - List of symbols in the word. The order of the symbols follows - the natural reading order. - confidence: - Confidence of the OCR results for the word. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Word) - ), -) -_sym_db.RegisterMessage(Word) - -Symbol = _reflection.GeneratedProtocolMessageType( - "Symbol", - (_message.Message,), - dict( - DESCRIPTOR=_SYMBOL, - __module__="google.cloud.vision_v1p2beta1.proto.text_annotation_pb2", - __doc__="""A single symbol representation. - - - Attributes: - property: - Additional information detected for the symbol. - bounding_box: - The bounding box for the symbol. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - text: - The actual UTF-8 representation of the symbol. - confidence: - Confidence of the OCR results for the symbol. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.Symbol) - ), -) -_sym_db.RegisterMessage(Symbol) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py b/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p2beta1/proto/web_detection.proto b/vision/google/cloud/vision_v1p2beta1/proto/web_detection.proto deleted file mode 100644 index f2b9dfef00dc..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/web_detection.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p2beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "WebDetectionProto"; -option java_package = "com.google.cloud.vision.v1p2beta1"; - -// Relevant information for the image from the Internet. -message WebDetection { - // Entity deduced from similar images on the Internet. - message WebEntity { - // Opaque entity ID. - string entity_id = 1; - - // Overall relevancy score for the entity. - // Not normalized and not comparable across different image queries. - float score = 2; - - // Canonical description of the entity, in English. - string description = 3; - } - - // Metadata for online images. - message WebImage { - // The result image URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the image. - float score = 2; - } - - // Metadata for web pages. - message WebPage { - // The result web page URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the web page. - float score = 2; - - // Title for the web page, may contain HTML markups. - string page_title = 3; - - // Fully matching images on the page. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 4; - - // Partial matching images on the page. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its - // crops. - repeated WebImage partial_matching_images = 5; - } - - // Label to provide extra metadata for the web detection. - message WebLabel { - // Label for extra metadata. - string label = 1; - - // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - // For more information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - } - - // Deduced entities from similar images on the Internet. - repeated WebEntity web_entities = 1; - - // Fully matching images from the Internet. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 2; - - // Partial matching images from the Internet. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its crops. - repeated WebImage partial_matching_images = 3; - - // Web pages containing the matching images from the Internet. - repeated WebPage pages_with_matching_images = 4; - - // The visually similar image results. - repeated WebImage visually_similar_images = 6; - - // Best guess text labels for the request image. - repeated WebLabel best_guess_labels = 8; -} diff --git a/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py b/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py deleted file mode 100644 index 41b604642a4c..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py +++ /dev/null @@ -1,616 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p2beta1/proto/web_detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p2beta1/proto/web_detection.proto", - package="google.cloud.vision.v1p2beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p2beta1B\021WebDetectionProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n7google/cloud/vision_v1p2beta1/proto/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p2beta1\x1a\x1cgoogle/api/annotations.proto"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p2beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p2beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p2beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB\x80\x01\n!com.google.cloud.vision.v1p2beta1B\x11WebDetectionProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p2beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_WEBDETECTION_WEBENTITY = _descriptor.Descriptor( - name="WebEntity", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebEntity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebEntity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebEntity.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebEntity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=642, - serialized_end=708, -) - -_WEBDETECTION_WEBIMAGE = _descriptor.Descriptor( - name="WebImage", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebImage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebImage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=710, - serialized_end=748, -) - -_WEBDETECTION_WEBPAGE = _descriptor.Descriptor( - name="WebPage", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_title", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage.page_title", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage.full_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebPage.partial_matching_images", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=751, - serialized_end=979, -) - -_WEBDETECTION_WEBLABEL = _descriptor.Descriptor( - name="WebLabel", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebLabel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebLabel.label", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p2beta1.WebDetection.WebLabel.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1029, -) - -_WEBDETECTION = _descriptor.Descriptor( - name="WebDetection", - full_name="google.cloud.vision.v1p2beta1.WebDetection", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="web_entities", - full_name="google.cloud.vision.v1p2beta1.WebDetection.web_entities", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.full_matching_images", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.partial_matching_images", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages_with_matching_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.pages_with_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visually_similar_images", - full_name="google.cloud.vision.v1p2beta1.WebDetection.visually_similar_images", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="best_guess_labels", - full_name="google.cloud.vision.v1p2beta1.WebDetection.best_guess_labels", - index=5, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _WEBDETECTION_WEBENTITY, - _WEBDETECTION_WEBIMAGE, - _WEBDETECTION_WEBPAGE, - _WEBDETECTION_WEBLABEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=121, - serialized_end=1029, -) - -_WEBDETECTION_WEBENTITY.containing_type = _WEBDETECTION -_WEBDETECTION_WEBIMAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBPAGE.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBLABEL.containing_type = _WEBDETECTION -_WEBDETECTION.fields_by_name["web_entities"].message_type = _WEBDETECTION_WEBENTITY -_WEBDETECTION.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "pages_with_matching_images" -].message_type = _WEBDETECTION_WEBPAGE -_WEBDETECTION.fields_by_name[ - "visually_similar_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name["best_guess_labels"].message_type = _WEBDETECTION_WEBLABEL -DESCRIPTOR.message_types_by_name["WebDetection"] = _WEBDETECTION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -WebDetection = _reflection.GeneratedProtocolMessageType( - "WebDetection", - (_message.Message,), - dict( - WebEntity=_reflection.GeneratedProtocolMessageType( - "WebEntity", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBENTITY, - __module__="google.cloud.vision_v1p2beta1.proto.web_detection_pb2", - __doc__="""Entity deduced from similar images on the Internet. - - - Attributes: - entity_id: - Opaque entity ID. - score: - Overall relevancy score for the entity. Not normalized and not - comparable across different image queries. - description: - Canonical description of the entity, in English. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetection.WebEntity) - ), - ), - WebImage=_reflection.GeneratedProtocolMessageType( - "WebImage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBIMAGE, - __module__="google.cloud.vision_v1p2beta1.proto.web_detection_pb2", - __doc__="""Metadata for online images. - - - Attributes: - url: - The result image URL. - score: - (Deprecated) Overall relevancy score for the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetection.WebImage) - ), - ), - WebPage=_reflection.GeneratedProtocolMessageType( - "WebPage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBPAGE, - __module__="google.cloud.vision_v1p2beta1.proto.web_detection_pb2", - __doc__="""Metadata for web pages. - - - Attributes: - url: - The result web page URL. - score: - (Deprecated) Overall relevancy score for the web page. - page_title: - Title for the web page, may contain HTML markups. - full_matching_images: - Fully matching images on the page. Can include resized copies - of the query image. - partial_matching_images: - Partial matching images on the page. Those images are similar - enough to share some key-point features. For example an - original image will likely have partial matching for its - crops. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetection.WebPage) - ), - ), - WebLabel=_reflection.GeneratedProtocolMessageType( - "WebLabel", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBLABEL, - __module__="google.cloud.vision_v1p2beta1.proto.web_detection_pb2", - __doc__="""Label to provide extra metadata for the web detection. - - - Attributes: - label: - Label for extra metadata. - language_code: - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see http://www.unicode.org/re - ports/tr35/#Unicode\_locale\_identifier. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetection.WebLabel) - ), - ), - DESCRIPTOR=_WEBDETECTION, - __module__="google.cloud.vision_v1p2beta1.proto.web_detection_pb2", - __doc__="""Relevant information for the image from the Internet. - - - Attributes: - web_entities: - Deduced entities from similar images on the Internet. - full_matching_images: - Fully matching images from the Internet. Can include resized - copies of the query image. - partial_matching_images: - Partial matching images from the Internet. Those images are - similar enough to share some key-point features. For example - an original image will likely have partial matching for its - crops. - pages_with_matching_images: - Web pages containing the matching images from the Internet. - visually_similar_images: - The visually similar image results. - best_guess_labels: - Best guess text labels for the request image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p2beta1.WebDetection) - ), -) -_sym_db.RegisterMessage(WebDetection) -_sym_db.RegisterMessage(WebDetection.WebEntity) -_sym_db.RegisterMessage(WebDetection.WebImage) -_sym_db.RegisterMessage(WebDetection.WebPage) -_sym_db.RegisterMessage(WebDetection.WebLabel) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py b/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p2beta1/types.py b/vision/google/cloud/vision_v1p2beta1/types.py deleted file mode 100644 index 74d539aa3bed..000000000000 --- a/vision/google/cloud/vision_v1p2beta1/types.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.vision_v1p2beta1.proto import geometry_pb2 -from google.cloud.vision_v1p2beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p2beta1.proto import text_annotation_pb2 -from google.cloud.vision_v1p2beta1.proto import web_detection_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 -from google.type import latlng_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - color_pb2, - latlng_pb2, -] - -_local_modules = [ - geometry_pb2, - image_annotator_pb2, - text_annotation_pb2, - web_detection_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.vision_v1p2beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/vision/google/cloud/vision_v1p3beta1/__init__.py b/vision/google/cloud/vision_v1p3beta1/__init__.py deleted file mode 100644 index 65b99da6f705..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.vision_helpers.decorators import add_single_feature_methods -from google.cloud.vision_helpers import VisionHelpers -import sys -import warnings - -from google.cloud.vision_v1p3beta1 import types -from google.cloud.vision_v1p3beta1.gapic import enums -from google.cloud.vision_v1p3beta1.gapic import image_annotator_client as iac -from google.cloud.vision_v1p3beta1.gapic import product_search_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class ProductSearchClient(product_search_client.ProductSearchClient): - __doc__ = product_search_client.ProductSearchClient.__doc__ - enums = enums - - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient): - __doc__ = iac.ImageAnnotatorClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "ProductSearchClient", "ImageAnnotatorClient") diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/__init__.py b/vision/google/cloud/vision_v1p3beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/enums.py b/vision/google/cloud/vision_v1p3beta1/gapic/enums.py deleted file mode 100644 index 8755caa9f414..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/enums.py +++ /dev/null @@ -1,285 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Likelihood(enum.IntEnum): - """ - A bucketized representation of likelihood, which is intended to give clients - highly stable results across model upgrades. - - Attributes: - UNKNOWN (int): Unknown likelihood. - VERY_UNLIKELY (int): It is very unlikely that the image belongs to the specified vertical. - UNLIKELY (int): It is unlikely that the image belongs to the specified vertical. - POSSIBLE (int): It is possible that the image belongs to the specified vertical. - LIKELY (int): It is likely that the image belongs to the specified vertical. - VERY_LIKELY (int): It is very likely that the image belongs to the specified vertical. - """ - - UNKNOWN = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class ProductSearchCategory(enum.IntEnum): - """ - Supported product search categories. - - Attributes: - PRODUCT_SEARCH_CATEGORY_UNSPECIFIED (int): Default value used when a category is not specified. - SHOES (int): Shoes category. - BAGS (int): Bags category. - """ - - PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0 - SHOES = 1 - BAGS = 2 - - -class ProductSearchResultsView(enum.IntEnum): - """ - Specifies the fields to include in product search results. - - Attributes: - BASIC (int): Product search results contain only ``product_category`` and - ``product_id``. Default value. - FULL (int): Product search results contain ``product_category``, ``product_id``, - ``image_uri``, and ``score``. - """ - - BASIC = 0 - FULL = 1 - - -class BatchOperationMetadata(object): - class State(enum.IntEnum): - """ - Enumerates the possible states that the batch request can be in. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - PROCESSING (int): Request is actively being processed. - SUCCESSFUL (int): The request is done and at least one item has been successfully - processed. - FAILED (int): The request is done and no item has been successfully processed. - CANCELLED (int): The request is done after the longrunning.Operations.CancelOperation has - been called by the user. Any records that were processed before the - cancel command are output as specified in the request. - """ - - STATE_UNSPECIFIED = 0 - PROCESSING = 1 - SUCCESSFUL = 2 - FAILED = 3 - CANCELLED = 4 - - -class Block(object): - class BlockType(enum.IntEnum): - """ - Type of a block (text, image etc) as identified by OCR. - - Attributes: - UNKNOWN (int): Unknown block type. - TEXT (int): Regular text block. - TABLE (int): Table block. - PICTURE (int): Image block. - RULER (int): Horizontal/vertical line box. - BARCODE (int): Barcode block. - """ - - UNKNOWN = 0 - TEXT = 1 - TABLE = 2 - PICTURE = 3 - RULER = 4 - BARCODE = 5 - - -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. - - Attributes: - UNKNOWN_LANDMARK (int): Unknown face landmark detected. Should not be filled. - LEFT_EYE (int): Left eye. - RIGHT_EYE (int): Right eye. - LEFT_OF_LEFT_EYEBROW (int): Left of left eyebrow. - RIGHT_OF_LEFT_EYEBROW (int): Right of left eyebrow. - LEFT_OF_RIGHT_EYEBROW (int): Left of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW (int): Right of right eyebrow. - MIDPOINT_BETWEEN_EYES (int): Midpoint between eyes. - NOSE_TIP (int): Nose tip. - UPPER_LIP (int): Upper lip. - LOWER_LIP (int): Lower lip. - MOUTH_LEFT (int): Mouth left. - MOUTH_RIGHT (int): Mouth right. - MOUTH_CENTER (int): Mouth center. - NOSE_BOTTOM_RIGHT (int): Nose, bottom right. - NOSE_BOTTOM_LEFT (int): Nose, bottom left. - NOSE_BOTTOM_CENTER (int): Nose, bottom center. - LEFT_EYE_TOP_BOUNDARY (int): Left eye, top boundary. - LEFT_EYE_RIGHT_CORNER (int): Left eye, right corner. - LEFT_EYE_BOTTOM_BOUNDARY (int): Left eye, bottom boundary. - LEFT_EYE_LEFT_CORNER (int): Left eye, left corner. - RIGHT_EYE_TOP_BOUNDARY (int): Right eye, top boundary. - RIGHT_EYE_RIGHT_CORNER (int): Right eye, right corner. - RIGHT_EYE_BOTTOM_BOUNDARY (int): Right eye, bottom boundary. - RIGHT_EYE_LEFT_CORNER (int): Right eye, left corner. - LEFT_EYEBROW_UPPER_MIDPOINT (int): Left eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT (int): Right eyebrow, upper midpoint. - LEFT_EAR_TRAGION (int): Left ear tragion. - RIGHT_EAR_TRAGION (int): Right ear tragion. - LEFT_EYE_PUPIL (int): Left eye pupil. - RIGHT_EYE_PUPIL (int): Right eye pupil. - FOREHEAD_GLABELLA (int): Forehead glabella. - CHIN_GNATHION (int): Chin gnathion. - CHIN_LEFT_GONION (int): Chin left gonion. - CHIN_RIGHT_GONION (int): Chin right gonion. - """ - - UNKNOWN_LANDMARK = 0 - LEFT_EYE = 1 - RIGHT_EYE = 2 - LEFT_OF_LEFT_EYEBROW = 3 - RIGHT_OF_LEFT_EYEBROW = 4 - LEFT_OF_RIGHT_EYEBROW = 5 - RIGHT_OF_RIGHT_EYEBROW = 6 - MIDPOINT_BETWEEN_EYES = 7 - NOSE_TIP = 8 - UPPER_LIP = 9 - LOWER_LIP = 10 - MOUTH_LEFT = 11 - MOUTH_RIGHT = 12 - MOUTH_CENTER = 13 - NOSE_BOTTOM_RIGHT = 14 - NOSE_BOTTOM_LEFT = 15 - NOSE_BOTTOM_CENTER = 16 - LEFT_EYE_TOP_BOUNDARY = 17 - LEFT_EYE_RIGHT_CORNER = 18 - LEFT_EYE_BOTTOM_BOUNDARY = 19 - LEFT_EYE_LEFT_CORNER = 20 - RIGHT_EYE_TOP_BOUNDARY = 21 - RIGHT_EYE_RIGHT_CORNER = 22 - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - RIGHT_EYE_LEFT_CORNER = 24 - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - LEFT_EAR_TRAGION = 27 - RIGHT_EAR_TRAGION = 28 - LEFT_EYE_PUPIL = 29 - RIGHT_EYE_PUPIL = 30 - FOREHEAD_GLABELLA = 31 - CHIN_GNATHION = 32 - CHIN_LEFT_GONION = 33 - 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): - """ - Batch operation states. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - CREATED (int): Request is received. - RUNNING (int): Request is actively being processed. - DONE (int): The batch processing is done. - CANCELLED (int): The batch processing was cancelled. - """ - - STATE_UNSPECIFIED = 0 - CREATED = 1 - 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 diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py b/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py deleted file mode 100644 index 5c36b36937a5..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py +++ /dev/null @@ -1,334 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1p3beta1 ImageAnnotator API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import grpc - -from google.cloud.vision_v1p3beta1.gapic import enums -from google.cloud.vision_v1p3beta1.gapic import image_annotator_client_config -from google.cloud.vision_v1p3beta1.gapic.transports import ( - image_annotator_grpc_transport, -) -from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2_grpc -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ImageAnnotatorClient(object): - """ - 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. - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1p3beta1.ImageAnnotator" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ImageAnnotatorClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ImageAnnotatorGrpcTransport, - Callable[[~.Credentials, type], ~.ImageAnnotatorGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = image_annotator_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=image_annotator_grpc_transport.ImageAnnotatorGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = image_annotator_grpc_transport.ImageAnnotatorGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_annotate_images( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Run image detection and annotation for a batch of images. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_images(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p3beta1.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_v1p3beta1.types.AnnotateImageRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.BatchAnnotateImagesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_images, - default_retry=self._method_configs["BatchAnnotateImages"].retry, - default_timeout=self._method_configs["BatchAnnotateImages"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateImagesRequest(requests=requests) - return self._inner_api_calls["batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def async_batch_annotate_files( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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). - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.async_batch_annotate_files(requests) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p3beta1.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_v1p3beta1.types.AsyncAnnotateFileRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_files, - default_retry=self._method_configs["AsyncBatchAnnotateFiles"].retry, - default_timeout=self._method_configs["AsyncBatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest(requests=requests) - operation = self._inner_api_calls["async_batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateFilesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py b/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py deleted file mode 100644 index 41adece1cb2a..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py +++ /dev/null @@ -1,33 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p3beta1.ImageAnnotator": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py b/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py deleted file mode 100644 index 3a6ebff964e2..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client.py +++ /dev/null @@ -1,1921 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1p3beta1 ProductSearch API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import grpc - -from google.cloud.vision_v1p3beta1.gapic import enums -from google.cloud.vision_v1p3beta1.gapic import product_search_client_config -from google.cloud.vision_v1p3beta1.gapic.transports import product_search_grpc_transport -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ProductSearchClient(object): - """ - 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`` 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`` resources, named - ``projects/*/locations/*/products/*`` - - - Each ``Product`` has a collection of ``ReferenceImage`` resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1p3beta1.ProductSearch" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ProductSearchClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - @classmethod - def product_path(cls, project, location, product): - """Return a fully-qualified product string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}", - project=project, - location=location, - product=product, - ) - - @classmethod - def product_set_path(cls, project, location, product_set): - """Return a fully-qualified product_set string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/productSets/{product_set}", - project=project, - location=location, - product_set=product_set, - ) - - @classmethod - def reference_image_path(cls, project, location, product, reference_image): - """Return a fully-qualified reference_image string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}", - project=project, - location=location, - product=product, - reference_image=reference_image, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ProductSearchGrpcTransport, - Callable[[~.Credentials, type], ~.ProductSearchGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = product_search_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=product_search_grpc_transport.ProductSearchGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = product_search_grpc_transport.ProductSearchGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_product_set( - self, - parent, - product_set, - product_set_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> # TODO: Initialize `product_set_id`: - >>> product_set_id = '' - >>> - >>> response = client.create_product_set(parent, product_set, product_set_id) - - Args: - parent (str): The project in which the ProductSet should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set (Union[dict, ~google.cloud.vision_v1p3beta1.types.ProductSet]): The ProductSet to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` - product_set_id (str): A user-supplied resource id for this ProductSet. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product_set, - default_retry=self._method_configs["CreateProductSet"].retry, - default_timeout=self._method_configs["CreateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_product_sets( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_product_sets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_product_sets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The project from which ProductSets should be listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_product_sets, - default_retry=self._method_configs["ListProductSets"].retry, - default_timeout=self._method_configs["ListProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductSetsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_product_sets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="product_sets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> response = client.get_product_set(name) - - Args: - name (str): Resource name of the ProductSet to get. - - Format is: - ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product_set, - default_retry=self._method_configs["GetProductSet"].retry, - default_timeout=self._method_configs["GetProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product_set( - self, - product_set, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_product_set(product_set, update_mask) - - Args: - product_set (Union[dict, ~google.cloud.vision_v1p3beta1.types.ProductSet]): The ProductSet resource which replaces the one on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` - update_mask (Union[dict, ~google.cloud.vision_v1p3beta1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask path - is ``display_name``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product_set, - default_retry=self._method_configs["UpdateProductSet"].retry, - default_timeout=self._method_configs["UpdateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product_set.name", product_set.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Permanently deletes a ProductSet. All Products and ReferenceImages in - the ProductSet will be deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> client.delete_product_set(name) - - Args: - name (str): Resource name of the ProductSet to delete. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product_set, - default_retry=self._method_configs["DeleteProductSet"].retry, - default_timeout=self._method_configs["DeleteProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_product( - self, - parent, - product, - product_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> # TODO: Initialize `product_id`: - >>> product_id = '' - >>> - >>> response = client.create_product(parent, product, product_id) - - Args: - parent (str): The project in which the Product should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product (Union[dict, ~google.cloud.vision_v1p3beta1.types.Product]): The product to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.Product` - product_id (str): A user-supplied resource id for this Product. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product, - default_retry=self._method_configs["CreateProduct"].retry, - default_timeout=self._method_configs["CreateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): The project OR ProductSet from which Products should be listed. - - Format: ``projects/PROJECT_ID/locations/LOC_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p3beta1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products, - default_retry=self._method_configs["ListProducts"].retry, - default_timeout=self._method_configs["ListProducts"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> response = client.get_product(name) - - Args: - name (str): Resource name of the Product to get. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product, - default_retry=self._method_configs["GetProduct"].retry, - default_timeout=self._method_configs["GetProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product( - self, - product, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Makes changes to a Product resource. Only display\_name, description and - labels 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_product(product, update_mask) - - Args: - product (Union[dict, ~google.cloud.vision_v1p3beta1.types.Product]): The Product resource which replaces the one on the server. - product.name is immutable. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.Product` - update_mask (Union[dict, ~google.cloud.vision_v1p3beta1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name`` and ``description``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product, - default_retry=self._method_configs["UpdateProduct"].retry, - default_timeout=self._method_configs["UpdateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product.name", product.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Possible errors: - - - Returns NOT\_FOUND if the product does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> client.delete_product(name) - - Args: - name (str): Resource name of product to delete. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product, - default_retry=self._method_configs["DeleteProduct"].retry, - default_timeout=self._method_configs["DeleteProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_reference_image( - self, - parent, - reference_image, - reference_image_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # TODO: Initialize `reference_image`: - >>> reference_image = {} - >>> - >>> # TODO: Initialize `reference_image_id`: - >>> reference_image_id = '' - >>> - >>> response = client.create_reference_image(parent, reference_image, reference_image_id) - - Args: - parent (str): Resource name of the product in which to create the reference image. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image (Union[dict, ~google.cloud.vision_v1p3beta1.types.ReferenceImage]): The reference image to create. - If an image ID is specified, it is ignored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.ReferenceImage` - reference_image_id (str): A user-supplied resource id for the ReferenceImage to be added. If set, - the server will attempt to use this value as the resource id. If it is - already in use, an error is returned with code ALREADY\_EXISTS. Must be - at most 128 characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "create_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_reference_image, - default_retry=self._method_configs["CreateReferenceImage"].retry, - default_timeout=self._method_configs["CreateReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Possible errors: - - - Returns NOT\_FOUND if the reference image does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> client.delete_reference_image(name) - - Args: - name (str): The resource name of the reference image to delete. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_reference_image, - default_retry=self._method_configs["DeleteReferenceImage"].retry, - default_timeout=self._method_configs["DeleteReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_reference_images( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_reference_images(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_reference_images(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Resource name of the product containing the reference images. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p3beta1.types.ReferenceImage` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_reference_images" not in self._inner_api_calls: - self._inner_api_calls[ - "list_reference_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_reference_images, - default_retry=self._method_configs["ListReferenceImages"].retry, - default_timeout=self._method_configs["ListReferenceImages"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_reference_images"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="reference_images", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> response = client.get_reference_image(name) - - Args: - name (str): The resource name of the ReferenceImage to get. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "get_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_reference_image, - default_retry=self._method_configs["GetReferenceImage"].retry, - default_timeout=self._method_configs["GetReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def add_product_to_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # TODO: Initialize `product`: - >>> product = '' - >>> - >>> client.add_product_to_product_set(name, product) - - Args: - name (str): The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): The resource name for the Product to be added to this ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "add_product_to_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "add_product_to_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.add_product_to_product_set, - default_retry=self._method_configs["AddProductToProductSet"].retry, - default_timeout=self._method_configs["AddProductToProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["add_product_to_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def remove_product_from_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Removes a Product from the specified ProductSet. - - Possible errors: - - - Returns NOT\_FOUND If the Product is not found under the ProductSet. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # TODO: Initialize `product`: - >>> product = '' - >>> - >>> client.remove_product_from_product_set(name, product) - - Args: - name (str): The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): The resource name for the Product to be removed from this ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "remove_product_from_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "remove_product_from_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.remove_product_from_product_set, - default_retry=self._method_configs["RemoveProductFromProductSet"].retry, - default_timeout=self._method_configs[ - "RemoveProductFromProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["remove_product_from_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products_in_product_set( - self, - name, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products_in_product_set(name): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products_in_product_set(name).pages: - ... for element in page: - ... # process element - ... pass - - Args: - name (str): The ProductSet resource for which to retrieve Products. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p3beta1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products_in_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products_in_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products_in_product_set, - default_retry=self._method_configs["ListProductsInProductSet"].retry, - default_timeout=self._method_configs[ - "ListProductsInProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products_in_product_set"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def import_product_sets( - self, - parent, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Asynchronous API that imports a list of reference images to specified - product sets based on a list of image information. - - The ``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``. - - Example: - >>> from google.cloud import vision_v1p3beta1 - >>> - >>> client = vision_v1p3beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_product_sets(parent, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): The project in which the ProductSets should be imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - input_config (Union[dict, ~google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig]): The input content for the list of requests. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p3beta1.types.ImportProductSetsInputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p3beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "import_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_product_sets, - default_retry=self._method_configs["ImportProductSets"].retry, - default_timeout=self._method_configs["ImportProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_product_sets"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - product_search_service_pb2.ImportProductSetsResponse, - metadata_type=product_search_service_pb2.BatchOperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py b/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py deleted file mode 100644 index 9c732f9258fc..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py +++ /dev/null @@ -1,113 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p3beta1.ProductSearch": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProducts": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListReferenceImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AddProductToProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RemoveProductFromProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProductsInProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ImportProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/transports/__init__.py b/vision/google/cloud/vision_v1p3beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py b/vision/google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py deleted file mode 100644 index 926c3a5c7581..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py +++ /dev/null @@ -1,150 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2_grpc - - -class ImageAnnotatorGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p3beta1 ImageAnnotator API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "image_annotator_stub": image_annotator_pb2_grpc.ImageAnnotatorStub(channel) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`. - - Run image detection and annotation for a batch of images. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateImages - - @property - def async_batch_annotate_files(self): - """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 - 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). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateFiles diff --git a/vision/google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py b/vision/google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py deleted file mode 100644 index 302033b2d97a..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py +++ /dev/null @@ -1,490 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2_grpc - - -class ProductSearchGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p3beta1 ProductSearch API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "product_search_stub": product_search_service_pb2_grpc.ProductSearchStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`. - - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProductSet - - @property - def list_product_sets(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`. - - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductSets - - @property - def get_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`. - - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProductSet - - @property - def update_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProductSet - - @property - def delete_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`. - - Permanently deletes a ProductSet. All Products and ReferenceImages in - the ProductSet will be deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProductSet - - @property - def create_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProduct - - @property - def list_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_products`. - - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProducts - - @property - def get_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product`. - - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProduct - - @property - def update_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product`. - - Makes changes to a Product resource. Only display\_name, description and - labels 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProduct - - @property - def delete_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product`. - - 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. - - Possible errors: - - - Returns NOT\_FOUND if the product does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProduct - - @property - def create_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_reference_image`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateReferenceImage - - @property - def delete_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`. - - 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. - - Possible errors: - - - Returns NOT\_FOUND if the reference image does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteReferenceImage - - @property - def list_reference_images(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListReferenceImages - - @property - def get_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`. - - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetReferenceImage - - @property - def add_product_to_product_set(self): - """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. - - One Product can be added to at most 100 ProductSets. - - Possible errors: - - - Returns NOT\_FOUND if the Product or the ProductSet doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].AddProductToProductSet - - @property - def remove_product_from_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.remove_product_from_product_set`. - - Removes a Product from the specified ProductSet. - - Possible errors: - - - Returns NOT\_FOUND If the Product is not found under the ProductSet. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].RemoveProductFromProductSet - - @property - def list_products_in_product_set(self): - """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 - empty. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductsInProductSet - - @property - def import_product_sets(self): - """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. - - The ``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``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ImportProductSets diff --git a/vision/google/cloud/vision_v1p3beta1/proto/__init__.py b/vision/google/cloud/vision_v1p3beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p3beta1/proto/geometry.proto b/vision/google/cloud/vision_v1p3beta1/proto/geometry.proto deleted file mode 100644 index 28b768eaa792..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/geometry.proto +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} - -// A normalized bounding polygon around a portion of an image. -message NormalizedBoundingPoly { - // Normalized vertices of the bounding polygon. - repeated NormalizedVertex vertices = 1; -} - -// A 3D position in the image, used primarily for Face detection landmarks. -// A valid Position must have both x and y coordinates. -// The position coordinates are in the same scale as the original image. -message Position { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; - - // Z coordinate (or depth). - float z = 3; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2.py deleted file mode 100644 index 2dea7b6982e3..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,431 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/geometry.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\rGeometryProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n2google/cloud/vision_v1p3beta1/proto/geometry.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.NormalizedVertex"[\n\x16NormalizedBoundingPoly\x12\x41\n\x08vertices\x18\x01 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.NormalizedVertex"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42|\n!com.google.cloud.vision.v1p3beta1B\rGeometryProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.vision.v1p3beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p3beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p3beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=115, - serialized_end=145, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.vision.v1p3beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p3beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p3beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=147, - serialized_end=187, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.vision.v1p3beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.vision.v1p3beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.vision.v1p3beta1.BoundingPoly.normalized_vertices", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=190, - serialized_end=339, -) - - -_NORMALIZEDBOUNDINGPOLY = _descriptor.Descriptor( - name="NormalizedBoundingPoly", - full_name="google.cloud.vision.v1p3beta1.NormalizedBoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.vision.v1p3beta1.NormalizedBoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=341, - serialized_end=432, -) - - -_POSITION = _descriptor.Descriptor( - name="Position", - full_name="google.cloud.vision.v1p3beta1.Position", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p3beta1.Position.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p3beta1.Position.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="z", - full_name="google.cloud.vision.v1p3beta1.Position.z", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=434, - serialized_end=477, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -_NORMALIZEDBOUNDINGPOLY.fields_by_name["vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -DESCRIPTOR.message_types_by_name["NormalizedBoundingPoly"] = _NORMALIZEDBOUNDINGPOLY -DESCRIPTOR.message_types_by_name["Position"] = _POSITION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.vision_v1p3beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.vision_v1p3beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.vision_v1p3beta1.proto.geometry_pb2", - __doc__="""A bounding polygon for the detected image annotation. - - - Attributes: - vertices: - The bounding polygon vertices. - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - -NormalizedBoundingPoly = _reflection.GeneratedProtocolMessageType( - "NormalizedBoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDBOUNDINGPOLY, - __module__="google.cloud.vision_v1p3beta1.proto.geometry_pb2", - __doc__="""A normalized bounding polygon around a portion of an - image. - - - Attributes: - vertices: - Normalized vertices of the bounding polygon. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.NormalizedBoundingPoly) - ), -) -_sym_db.RegisterMessage(NormalizedBoundingPoly) - -Position = _reflection.GeneratedProtocolMessageType( - "Position", - (_message.Message,), - dict( - DESCRIPTOR=_POSITION, - __module__="google.cloud.vision_v1p3beta1.proto.geometry_pb2", - __doc__="""A 3D position in the image, used primarily for Face - detection landmarks. A valid Position must have both x and y - coordinates. The position coordinates are in the same scale as the - original image. - - - Attributes: - x: - X coordinate. - y: - Y coordinate. - z: - Z coordinate (or depth). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Position) - ), -) -_sym_db.RegisterMessage(Position) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator.proto b/vision/google/cloud/vision_v1p3beta1/proto/image_annotator.proto deleted file mode 100644 index 2ac3ddb8b21c..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator.proto +++ /dev/null @@ -1,803 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/cloud/vision/v1p3beta1/product_search.proto"; -import "google/cloud/vision/v1p3beta1/text_annotation.proto"; -import "google/cloud/vision/v1p3beta1/web_detection.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; -import "google/type/latlng.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ImageAnnotatorProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// 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. -service ImageAnnotator { - // Run image detection and annotation for a batch of images. - rpc BatchAnnotateImages(BatchAnnotateImagesRequest) - returns (BatchAnnotateImagesResponse) { - option (google.api.http) = { - post: "/v1p3beta1/images:annotate" - body: "*" - }; - } - - // 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). - rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p3beta1/files:asyncBatchAnnotate" - body: "*" - }; - } -} - -// The type of Google Cloud Vision API detection to perform, and the maximum -// number of results to return for that type. Multiple `Feature` objects can -// be specified in the `features` list. -message Feature { - // Type of Google Cloud Vision API feature to be extracted. - enum Type { - // Unspecified feature type. - TYPE_UNSPECIFIED = 0; - - // Run face detection. - FACE_DETECTION = 1; - - // Run landmark detection. - LANDMARK_DETECTION = 2; - - // Run logo detection. - LOGO_DETECTION = 3; - - // Run label detection. - LABEL_DETECTION = 4; - - // 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. - TEXT_DETECTION = 5; - - // Run dense text document OCR. Takes precedence when both - // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. - DOCUMENT_TEXT_DETECTION = 11; - - // Run Safe Search to detect potentially unsafe - // or undesirable content. - SAFE_SEARCH_DETECTION = 6; - - // Compute a set of image properties, such as the - // image's dominant colors. - IMAGE_PROPERTIES = 7; - - // Run crop hints. - CROP_HINTS = 9; - - // Run web detection. - WEB_DETECTION = 10; - - // Run Product Search. - PRODUCT_SEARCH = 12; - - // Run localizer for object detection. - OBJECT_LOCALIZATION = 19; - } - - // The feature type. - Type type = 1; - - // Maximum number of results of this type. Does not apply to - // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - int32 max_results = 2; - - // Model to use for the feature. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// External image source (Google Cloud Storage or web URL image location). -message ImageSource { - // **Use `image_uri` instead.** - // - // The Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - string gcs_image_uri = 1; - - // The URI of the source image. Can be either: - // - // 1. A Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. - // - // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - // HTTP/HTTPS URLs, Google cannot guarantee that the request will be - // completed. Your request may fail if the specified host denies the - // request (e.g. due to request throttling or DOS prevention), or if Google - // throttles requests to the site for abuse prevention. You should not - // depend on externally-hosted images for production applications. - // - // When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - // precedence. - string image_uri = 2; -} - -// Client image to perform Google Cloud Vision API tasks over. -message Image { - // Image content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 1; - - // Google Cloud Storage image location, or publicly-accessible image - // URL. If both `content` and `source` are provided for an image, `content` - // takes precedence and is used to perform the image annotation request. - ImageSource source = 2; -} - -// A face annotation object contains the results of face detection. -message FaceAnnotation { - // A face-specific landmark (for example, a face feature). - message Landmark { - // 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. - enum Type { - // Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0; - - // Left eye. - LEFT_EYE = 1; - - // Right eye. - RIGHT_EYE = 2; - - // Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3; - - // Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4; - - // Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5; - - // Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6; - - // Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7; - - // Nose tip. - NOSE_TIP = 8; - - // Upper lip. - UPPER_LIP = 9; - - // Lower lip. - LOWER_LIP = 10; - - // Mouth left. - MOUTH_LEFT = 11; - - // Mouth right. - MOUTH_RIGHT = 12; - - // Mouth center. - MOUTH_CENTER = 13; - - // Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14; - - // Nose, bottom left. - NOSE_BOTTOM_LEFT = 15; - - // Nose, bottom center. - NOSE_BOTTOM_CENTER = 16; - - // Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17; - - // Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18; - - // Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19; - - // Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20; - - // Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21; - - // Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22; - - // Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23; - - // Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24; - - // Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25; - - // Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26; - - // Left ear tragion. - LEFT_EAR_TRAGION = 27; - - // Right ear tragion. - RIGHT_EAR_TRAGION = 28; - - // Left eye pupil. - LEFT_EYE_PUPIL = 29; - - // Right eye pupil. - RIGHT_EYE_PUPIL = 30; - - // Forehead glabella. - FOREHEAD_GLABELLA = 31; - - // Chin gnathion. - CHIN_GNATHION = 32; - - // Chin left gonion. - CHIN_LEFT_GONION = 33; - - // Chin right gonion. - CHIN_RIGHT_GONION = 34; - } - - // Face landmark type. - Type type = 3; - - // Face landmark position. - Position position = 4; - } - - // The bounding polygon around the face. The coordinates of the bounding box - // are in the original image's scale, as returned in `ImageParams`. - // The bounding box is computed to "frame" the face in accordance with human - // expectations. It is based on the landmarker results. - // Note that one or more x and/or y coordinates may not be generated in the - // `BoundingPoly` (the polygon will be unbounded) if only a partial face - // appears in the image to be annotated. - BoundingPoly bounding_poly = 1; - - // The `fd_bounding_poly` bounding polygon is tighter than the - // `boundingPoly`, and encloses only the skin part of the face. Typically, it - // is used to eliminate the face from any image analysis that detects the - // "amount of skin" visible in an image. It is not based on the - // landmarker results, only on the initial face detection, hence - // the fd (face detection) prefix. - BoundingPoly fd_bounding_poly = 2; - - // Detected face landmarks. - repeated Landmark landmarks = 3; - - // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - // of the face relative to the image vertical about the axis perpendicular to - // the face. Range [-180,180]. - float roll_angle = 4; - - // Yaw angle, which indicates the leftward/rightward angle that the face is - // pointing relative to the vertical plane perpendicular to the image. Range - // [-180,180]. - float pan_angle = 5; - - // Pitch angle, which indicates the upwards/downwards angle that the face is - // pointing relative to the image's horizontal plane. Range [-180,180]. - float tilt_angle = 6; - - // Detection confidence. Range [0, 1]. - float detection_confidence = 7; - - // Face landmarking confidence. Range [0, 1]. - float landmarking_confidence = 8; - - // Joy likelihood. - Likelihood joy_likelihood = 9; - - // Sorrow likelihood. - Likelihood sorrow_likelihood = 10; - - // Anger likelihood. - Likelihood anger_likelihood = 11; - - // Surprise likelihood. - Likelihood surprise_likelihood = 12; - - // Under-exposed likelihood. - Likelihood under_exposed_likelihood = 13; - - // Blurred likelihood. - Likelihood blurred_likelihood = 14; - - // Headwear likelihood. - Likelihood headwear_likelihood = 15; -} - -// Detected entity location information. -message LocationInfo { - // lat/long location coordinates. - google.type.LatLng lat_lng = 1; -} - -// A `Property` consists of a user-supplied name/value pair. -message Property { - // Name of the property. - string name = 1; - - // Value of the property. - string value = 2; - - // Value of numeric properties. - uint64 uint64_value = 3; -} - -// Set of detected entity features. -message EntityAnnotation { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string mid = 1; - - // The language code for the locale in which the entity textual - // `description` is expressed. - string locale = 2; - - // Entity textual description, expressed in its `locale` language. - string description = 3; - - // Overall score of the result. Range [0, 1]. - float score = 4; - - // **Deprecated. Use `score` instead.** - // The accuracy of the entity detection in an image. - // For example, for an image in which the "Eiffel Tower" entity is detected, - // this field represents the confidence that there is a tower in the query - // image. Range [0, 1]. - float confidence = 5; - - // The relevancy of the ICA (Image Content Annotation) label to the - // image. For example, the relevancy of "tower" is likely higher to an image - // containing the detected "Eiffel Tower" than to an image containing a - // detected distant towering building, even though the confidence that - // there is a tower in each image may be the same. Range [0, 1]. - float topicality = 6; - - // Image region to which this entity belongs. Not produced - // for `LABEL_DETECTION` features. - BoundingPoly bounding_poly = 7; - - // The location information for the detected entity. Multiple - // `LocationInfo` elements can be present because one location may - // indicate the location of the scene in the image, and another location - // may indicate the location of the place where the image was taken. - // Location information is usually present for landmarks. - repeated LocationInfo locations = 8; - - // Some entities may have optional user-supplied `Property` (name/value) - // fields, such a score or string that qualifies the entity. - repeated Property properties = 9; -} - -// Set of detected objects with bounding boxes. -message LocalizedObjectAnnotation { - // Object ID that should align with EntityAnnotation mid. - string mid = 1; - - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - - // Object name, expressed in its `language_code` language. - string name = 3; - - // Score of the result. Range [0, 1]. - float score = 4; - - // Image region to which this object belongs. This must be populated. - BoundingPoly bounding_poly = 5; -} - -// Set of features pertaining to the image, computed by computer vision -// methods over safe-search verticals (for example, adult, spoof, medical, -// violence). -message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. Adult content may - // contain elements such as nudity, pornographic images or cartoons, or - // sexual activities. - Likelihood adult = 1; - - // Spoof likelihood. The likelihood that an modification - // was made to the image's canonical version to make it appear - // funny or offensive. - Likelihood spoof = 2; - - // Likelihood that this is a medical image. - Likelihood medical = 3; - - // Likelihood that this image contains violent content. - Likelihood violence = 4; - - // Likelihood that the request image contains racy content. Racy content may - // include (but is not limited to) skimpy or sheer clothing, strategically - // covered nudity, lewd or provocative poses, or close-ups of sensitive - // body areas. - Likelihood racy = 9; -} - -// Rectangle determined by min and max `LatLng` pairs. -message LatLongRect { - // Min lat/long pair. - google.type.LatLng min_lat_lng = 1; - - // Max lat/long pair. - google.type.LatLng max_lat_lng = 2; -} - -// Color information consists of RGB channels, score, and the fraction of -// the image that the color occupies in the image. -message ColorInfo { - // RGB components of the color. - google.type.Color color = 1; - - // Image-specific score for this color. Value in range [0, 1]. - float score = 2; - - // The fraction of pixels the color occupies in the image. - // Value in range [0, 1]. - float pixel_fraction = 3; -} - -// Set of dominant colors and their corresponding scores. -message DominantColorsAnnotation { - // RGB color values with their score and pixel fraction. - repeated ColorInfo colors = 1; -} - -// Stores image properties, such as dominant colors. -message ImageProperties { - // If present, dominant colors completed successfully. - DominantColorsAnnotation dominant_colors = 1; -} - -// Single crop hint that is used to generate a new crop when serving an image. -message CropHint { - // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale, as returned in `ImageParams`. - BoundingPoly bounding_poly = 1; - - // Confidence of this being a salient region. Range [0, 1]. - float confidence = 2; - - // Fraction of importance of this salient region with respect to the original - // image. - float importance_fraction = 3; -} - -// Set of crop hints that are used to generate new crops when serving images. -message CropHintsAnnotation { - // Crop hint results. - repeated CropHint crop_hints = 1; -} - -// Parameters for crop hints annotation request. -message CropHintsParams { - // Aspect ratios in floats, representing the ratio of the width to the height - // of the image. For example, if the desired aspect ratio is 4/3, the - // corresponding float value should be 1.33333. If not specified, the - // best possible crop is returned. The number of provided aspect ratios is - // limited to a maximum of 16; any aspect ratios provided after the 16th are - // ignored. - repeated float aspect_ratios = 1; -} - -// Parameters for web detection request. -message WebDetectionParams { - // Whether to include results derived from the geo information in the image. - bool include_geo_results = 2; -} - -// Image context and/or feature-specific parameters. -message ImageContext { - // Not used. - LatLongRect lat_long_rect = 1; - - // List of languages to use for TEXT_DETECTION. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Text detection returns an - // error if one or more of the specified languages is not one of the - // [supported languages](/vision/docs/languages). - repeated string language_hints = 2; - - // Parameters for crop hints annotation request. - CropHintsParams crop_hints_params = 4; - - // Parameters for product search. - google.cloud.vision.v1p3beta1.ProductSearchParams product_search_params = 5; - - // Parameters for web detection. - WebDetectionParams web_detection_params = 6; -} - -// Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features. -message AnnotateImageRequest { - // The image to be processed. - Image image = 1; - - // Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image. - ImageContext image_context = 3; -} - -// If an image was produced from a file (e.g. a PDF), this message gives -// information about the source of that image. -message ImageAnnotationContext { - // The URI of the file used to produce the image. - string uri = 1; - - // If the file was a PDF or TIFF, this field gives the page number within - // the file used to produce the image. - int32 page_number = 2; -} - -// Response to an image annotation request. -message AnnotateImageResponse { - // If present, face detection has completed successfully. - repeated FaceAnnotation face_annotations = 1; - - // If present, landmark detection has completed successfully. - repeated EntityAnnotation landmark_annotations = 2; - - // If present, logo detection has completed successfully. - repeated EntityAnnotation logo_annotations = 3; - - // If present, label detection has completed successfully. - repeated EntityAnnotation label_annotations = 4; - - // If present, localized object detection has completed successfully. - // This will be sorted descending by confidence score. - repeated LocalizedObjectAnnotation localized_object_annotations = 22; - - // If present, text (OCR) detection has completed successfully. - repeated EntityAnnotation text_annotations = 5; - - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. - // This annotation provides the structural hierarchy for the OCR detected - // text. - TextAnnotation full_text_annotation = 12; - - // If present, safe-search annotation has completed successfully. - SafeSearchAnnotation safe_search_annotation = 6; - - // If present, image properties were extracted successfully. - ImageProperties image_properties_annotation = 8; - - // If present, crop hints have completed successfully. - CropHintsAnnotation crop_hints_annotation = 11; - - // If present, web detection has completed successfully. - WebDetection web_detection = 13; - - // If present, product search has completed successfully. - google.cloud.vision.v1p3beta1.ProductSearchResults product_search_results = - 14; - - // If set, represents the error message for the operation. - // Note that filled-in image annotations are guaranteed to be - // correct, even when `error` is set. - google.rpc.Status error = 9; - - // If present, contextual information is needed to understand where this image - // comes from. - ImageAnnotationContext context = 21; -} - -// Response to a single file annotation request. A file may contain one or more -// images, which individually have their own responses. -message AnnotateFileResponse { - // Information about the file for which this response is generated. - InputConfig input_config = 1; - - // Individual responses to images found within the file. - repeated AnnotateImageResponse responses = 2; -} - -// Multiple image annotation requests are batched into a single service call. -message BatchAnnotateImagesRequest { - // Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1; -} - -// Response to a batch image annotation request. -message BatchAnnotateImagesResponse { - // Individual responses to image annotation requests within the batch. - repeated AnnotateImageResponse responses = 1; -} - -// An offline file annotation request. -message AsyncAnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 4; -} - -// The response for a single offline file annotation request. -message AsyncAnnotateFileResponse { - // The output location and metadata from AsyncAnnotateFileRequest. - OutputConfig output_config = 1; -} - -// Multiple async file annotation requests are batched into a single service -// call. -message AsyncBatchAnnotateFilesRequest { - // Individual async file annotation requests for this batch. - repeated AsyncAnnotateFileRequest requests = 1; -} - -// Response to an async batch file annotation request. -message AsyncBatchAnnotateFilesResponse { - // The list of file annotation responses, one for each request in - // AsyncBatchAnnotateFilesRequest. - repeated AsyncAnnotateFileResponse responses = 1; -} - -// The desired input location and metadata. -message InputConfig { - // The Google Cloud Storage location to read the input from. - GcsSource gcs_source = 1; - - // The type of the file. Currently only "application/pdf" and "image/tiff" - // are supported. Wildcards are not supported. - string mime_type = 2; -} - -// The desired output location and metadata. -message OutputConfig { - // The Google Cloud Storage location to write the output(s) to. - GcsDestination gcs_destination = 1; - - // The max number of response protos to put into each output JSON file on - // Google Cloud Storage. - // The valid range is [1, 100]. If not specified, the default value is 20. - // - // For example, for one pdf file with 100 pages, 100 response protos will - // be generated. If `batch_size` = 20, then 5 json files each - // containing 20 response protos will be written under the prefix - // `gcs_destination`.`uri`. - // - // Currently, batch_size only applies to GcsDestination, with potential future - // support for other output configurations. - int32 batch_size = 2; -} - -// The Google Cloud Storage location where the input will be read from. -message GcsSource { - // Google Cloud Storage URI for the input file. This must only be a - // Google Cloud Storage object. Wildcards are not currently supported. - string uri = 1; -} - -// The Google Cloud Storage location where the output will be written to. -message GcsDestination { - // Google Cloud Storage URI where the results will be stored. Results will - // be in JSON format and preceded by its corresponding input URI. This field - // can either represent a single file, or a prefix for multiple outputs. - // Prefixes must end in a `/`. - // - // Examples: - // - // * File: gs://bucket-name/filename.json - // * Prefix: gs://bucket-name/prefix/here/ - // * File: gs://bucket-name/prefix/here - // - // If multiple outputs, each response is still AnnotateFileResponse, each of - // which contains some subset of the full list of AnnotateImageResponse. - // Multiple outputs can happen if, for example, the output JSON is too large - // and overflows into multiple sharded files. - string uri = 1; -} - -// A bucketized representation of likelihood, which is intended to give clients -// highly stable results across model upgrades. -enum Likelihood { - // Unknown likelihood. - UNKNOWN = 0; - - // It is very unlikely that the image belongs to the specified vertical. - VERY_UNLIKELY = 1; - - // It is unlikely that the image belongs to the specified vertical. - UNLIKELY = 2; - - // It is possible that the image belongs to the specified vertical. - POSSIBLE = 3; - - // It is likely that the image belongs to the specified vertical. - LIKELY = 4; - - // It is very likely that the image belongs to the specified vertical. - VERY_LIKELY = 5; -} - -// Contains metadata for the BatchAnnotateImages operation. -message OperationMetadata { - // Batch operation states. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is received. - CREATED = 1; - - // Request is actively being processed. - RUNNING = 2; - - // The batch processing is done. - DONE = 3; - - // The batch processing was cancelled. - CANCELLED = 4; - } - // Current state of the batch operation. - State state = 1; - - // The time when the batch request was received. - google.protobuf.Timestamp create_time = 5; - - // The time when the operation result was last updated. - google.protobuf.Timestamp update_time = 6; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py deleted file mode 100644 index 49ba71862edd..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py +++ /dev/null @@ -1,4177 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/image_annotator.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p3beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p3beta1.proto import ( - product_search_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__pb2, -) -from google.cloud.vision_v1p3beta1.proto import ( - text_annotation_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_text__annotation__pb2, -) -from google.cloud.vision_v1p3beta1.proto import ( - web_detection_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_web__detection__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/image_annotator.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\023ImageAnnotatorProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p3beta1/proto/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p3beta1/proto/geometry.proto\x1a\x38google/cloud/vision_v1p3beta1/proto/product_search.proto\x1a\x39google/cloud/vision_v1p3beta1/proto/text_annotation.proto\x1a\x37google/cloud/vision_v1p3beta1/proto/web_detection.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p3beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.ImageSource"\x9b\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p3beta1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xbc\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x12\n\nconfidence\x18\x05 \x01(\x02\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.Property"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p3beta1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.ColorInfo"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p3beta1.DominantColorsAnnotation"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p3beta1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\xd8\x02\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.CropHintsParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p3beta1.WebDetectionParams"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p3beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p3beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p3beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p3beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p3beta1.ImageAnnotationContext"\xa1\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse"c\n\x1a\x42\x61tchAnnotateImagesRequest\x12\x45\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.AnnotateImageRequest"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.AnnotateImageResponse"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p3beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.OutputConfig"k\n\x1e\x41syncBatchAnnotateFilesRequest\x12I\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse"^\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p3beta1.GcsSource\x12\x11\n\tmime_type\x18\x02 \x01(\t"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p3beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf0\x02\n\x0eImageAnnotator\x12\xb3\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse"%\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p3beta1/images:annotate:\x01*\x12\xa7\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation".\x82\xd3\xe4\x93\x02("#/v1p3beta1/files:asyncBatchAnnotate:\x01*B\x82\x01\n!com.google.cloud.vision.v1p3beta1B\x13ImageAnnotatorProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_text__annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_web__detection__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - ], -) - -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.vision.v1p3beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7669, - serialized_end=7770, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -UNKNOWN = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_FEATURE_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p3beta1.Feature.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LANDMARK_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOGO_DETECTION", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DOCUMENT_TEXT_DETECTION", - index=6, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SAFE_SEARCH_DETECTION", - index=7, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_PROPERTIES", - index=8, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CROP_HINTS", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WEB_DETECTION", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PRODUCT_SEARCH", - index=11, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_LOCALIZATION", - index=12, - number=19, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=602, - serialized_end=893, -) -_sym_db.RegisterEnumDescriptor(_FEATURE_TYPE) - -_FACEANNOTATION_LANDMARK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_LANDMARK", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_LEFT_EYEBROW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_LEFT_EYEBROW", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_RIGHT_EYEBROW", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_RIGHT_EYEBROW", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MIDPOINT_BETWEEN_EYES", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_TIP", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPPER_LIP", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOWER_LIP", index=10, number=10, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_LEFT", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_RIGHT", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_CENTER", index=13, number=13, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_RIGHT", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_LEFT", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_CENTER", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_TOP_BOUNDARY", - index=17, - number=17, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_RIGHT_CORNER", - index=18, - number=18, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_BOTTOM_BOUNDARY", - index=19, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_LEFT_CORNER", - index=20, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_TOP_BOUNDARY", - index=21, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_RIGHT_CORNER", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_BOTTOM_BOUNDARY", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_LEFT_CORNER", - index=24, - number=24, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYEBROW_UPPER_MIDPOINT", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYEBROW_UPPER_MIDPOINT", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EAR_TRAGION", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EAR_TRAGION", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_PUPIL", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_PUPIL", - index=30, - number=30, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FOREHEAD_GLABELLA", - index=31, - number=31, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_GNATHION", - index=32, - number=32, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_LEFT_GONION", - index=33, - number=33, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_RIGHT_GONION", - index=34, - number=34, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2038, - serialized_end=2858, -) -_sym_db.RegisterEnumDescriptor(_FACEANNOTATION_LANDMARK_TYPE) - -_OPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.vision.v1p3beta1.OperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DONE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=7586, - serialized_end=7667, -) -_sym_db.RegisterEnumDescriptor(_OPERATIONMETADATA_STATE) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="google.cloud.vision.v1p3beta1.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p3beta1.Feature.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_results", - full_name="google.cloud.vision.v1p3beta1.Feature.max_results", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.vision.v1p3beta1.Feature.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FEATURE_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=495, - serialized_end=893, -) - - -_IMAGESOURCE = _descriptor.Descriptor( - name="ImageSource", - full_name="google.cloud.vision.v1p3beta1.ImageSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_image_uri", - full_name="google.cloud.vision.v1p3beta1.ImageSource.gcs_image_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.vision.v1p3beta1.ImageSource.image_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=895, - serialized_end=950, -) - - -_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.vision.v1p3beta1.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.vision.v1p3beta1.Image.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.cloud.vision.v1p3beta1.Image.source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=952, - serialized_end=1036, -) - - -_FACEANNOTATION_LANDMARK = _descriptor.Descriptor( - name="Landmark", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.type", - index=0, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="position", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark.position", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FACEANNOTATION_LANDMARK_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1891, - serialized_end=2858, -) - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fd_bounding_poly", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.fd_bounding_poly", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarks", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.landmarks", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="roll_angle", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.roll_angle", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pan_angle", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.pan_angle", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tilt_angle", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.tilt_angle", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detection_confidence", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.detection_confidence", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarking_confidence", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.landmarking_confidence", - index=7, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="joy_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.joy_likelihood", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sorrow_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.sorrow_likelihood", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="anger_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.anger_likelihood", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="surprise_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.surprise_likelihood", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="under_exposed_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.under_exposed_likelihood", - index=12, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blurred_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.blurred_likelihood", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="headwear_likelihood", - full_name="google.cloud.vision.v1p3beta1.FaceAnnotation.headwear_likelihood", - index=14, - number=15, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FACEANNOTATION_LANDMARK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1039, - serialized_end=2858, -) - - -_LOCATIONINFO = _descriptor.Descriptor( - name="LocationInfo", - full_name="google.cloud.vision.v1p3beta1.LocationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.vision.v1p3beta1.LocationInfo.lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2860, - serialized_end=2912, -) - - -_PROPERTY = _descriptor.Descriptor( - name="Property", - full_name="google.cloud.vision.v1p3beta1.Property", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.Property.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p3beta1.Property.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uint64_value", - full_name="google.cloud.vision.v1p3beta1.Property.uint64_value", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2914, - serialized_end=2975, -) - - -_ENTITYANNOTATION = _descriptor.Descriptor( - name="EntityAnnotation", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locale", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.locale", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topicality", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.topicality", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.bounding_poly", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.locations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="properties", - full_name="google.cloud.vision.v1p3beta1.EntityAnnotation.properties", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2978, - serialized_end=3294, -) - - -_LOCALIZEDOBJECTANNOTATION = _descriptor.Descriptor( - name="LocalizedObjectAnnotation", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation.bounding_poly", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3297, - serialized_end=3457, -) - - -_SAFESEARCHANNOTATION = _descriptor.Descriptor( - name="SafeSearchAnnotation", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="adult", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation.adult", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spoof", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation.spoof", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="medical", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation.medical", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violence", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation.violence", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="racy", - full_name="google.cloud.vision.v1p3beta1.SafeSearchAnnotation.racy", - index=4, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3460, - serialized_end=3776, -) - - -_LATLONGRECT = _descriptor.Descriptor( - name="LatLongRect", - full_name="google.cloud.vision.v1p3beta1.LatLongRect", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min_lat_lng", - full_name="google.cloud.vision.v1p3beta1.LatLongRect.min_lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_lat_lng", - full_name="google.cloud.vision.v1p3beta1.LatLongRect.max_lat_lng", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3778, - serialized_end=3875, -) - - -_COLORINFO = _descriptor.Descriptor( - name="ColorInfo", - full_name="google.cloud.vision.v1p3beta1.ColorInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.vision.v1p3beta1.ColorInfo.color", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.ColorInfo.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pixel_fraction", - full_name="google.cloud.vision.v1p3beta1.ColorInfo.pixel_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3877, - serialized_end=3962, -) - - -_DOMINANTCOLORSANNOTATION = _descriptor.Descriptor( - name="DominantColorsAnnotation", - full_name="google.cloud.vision.v1p3beta1.DominantColorsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="colors", - full_name="google.cloud.vision.v1p3beta1.DominantColorsAnnotation.colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3964, - serialized_end=4048, -) - - -_IMAGEPROPERTIES = _descriptor.Descriptor( - name="ImageProperties", - full_name="google.cloud.vision.v1p3beta1.ImageProperties", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dominant_colors", - full_name="google.cloud.vision.v1p3beta1.ImageProperties.dominant_colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4050, - serialized_end=4149, -) - - -_CROPHINT = _descriptor.Descriptor( - name="CropHint", - full_name="google.cloud.vision.v1p3beta1.CropHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p3beta1.CropHint.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.CropHint.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="importance_fraction", - full_name="google.cloud.vision.v1p3beta1.CropHint.importance_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4151, - serialized_end=4278, -) - - -_CROPHINTSANNOTATION = _descriptor.Descriptor( - name="CropHintsAnnotation", - full_name="google.cloud.vision.v1p3beta1.CropHintsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crop_hints", - full_name="google.cloud.vision.v1p3beta1.CropHintsAnnotation.crop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4280, - serialized_end=4362, -) - - -_CROPHINTSPARAMS = _descriptor.Descriptor( - name="CropHintsParams", - full_name="google.cloud.vision.v1p3beta1.CropHintsParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="aspect_ratios", - full_name="google.cloud.vision.v1p3beta1.CropHintsParams.aspect_ratios", - index=0, - number=1, - type=2, - cpp_type=6, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4364, - serialized_end=4404, -) - - -_WEBDETECTIONPARAMS = _descriptor.Descriptor( - name="WebDetectionParams", - full_name="google.cloud.vision.v1p3beta1.WebDetectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="include_geo_results", - full_name="google.cloud.vision.v1p3beta1.WebDetectionParams.include_geo_results", - index=0, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4406, - serialized_end=4455, -) - - -_IMAGECONTEXT = _descriptor.Descriptor( - name="ImageContext", - full_name="google.cloud.vision.v1p3beta1.ImageContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_long_rect", - full_name="google.cloud.vision.v1p3beta1.ImageContext.lat_long_rect", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.vision.v1p3beta1.ImageContext.language_hints", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_params", - full_name="google.cloud.vision.v1p3beta1.ImageContext.crop_hints_params", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_search_params", - full_name="google.cloud.vision.v1p3beta1.ImageContext.product_search_params", - index=3, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection_params", - full_name="google.cloud.vision.v1p3beta1.ImageContext.web_detection_params", - index=4, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4458, - serialized_end=4802, -) - - -_ANNOTATEIMAGEREQUEST = _descriptor.Descriptor( - name="AnnotateImageRequest", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageRequest.image", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4805, - serialized_end=5006, -) - - -_IMAGEANNOTATIONCONTEXT = _descriptor.Descriptor( - name="ImageAnnotationContext", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotationContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotationContext.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotationContext.page_number", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5008, - serialized_end=5066, -) - - -_ANNOTATEIMAGERESPONSE = _descriptor.Descriptor( - name="AnnotateImageResponse", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.face_annotations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmark_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.landmark_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logo_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.logo_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="localized_object_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.localized_object_annotations", - index=4, - number=22, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.text_annotations", - index=5, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_text_annotation", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.full_text_annotation", - index=6, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="safe_search_annotation", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.safe_search_annotation", - index=7, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_properties_annotation", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.image_properties_annotation", - index=8, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_annotation", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.crop_hints_annotation", - index=9, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.web_detection", - index=10, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_search_results", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.product_search_results", - index=11, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.error", - index=12, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="context", - full_name="google.cloud.vision.v1p3beta1.AnnotateImageResponse.context", - index=13, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5069, - serialized_end=6156, -) - - -_ANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AnnotateFileResponse", - full_name="google.cloud.vision.v1p3beta1.AnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p3beta1.AnnotateFileResponse.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p3beta1.AnnotateFileResponse.responses", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6159, - serialized_end=6320, -) - - -_BATCHANNOTATEIMAGESREQUEST = _descriptor.Descriptor( - name="BatchAnnotateImagesRequest", - full_name="google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6322, - serialized_end=6421, -) - - -_BATCHANNOTATEIMAGESRESPONSE = _descriptor.Descriptor( - name="BatchAnnotateImagesResponse", - full_name="google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6423, - serialized_end=6525, -) - - -_ASYNCANNOTATEFILEREQUEST = _descriptor.Descriptor( - name="AsyncAnnotateFileRequest", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest.output_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6528, - serialized_end=6814, -) - - -_ASYNCANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AsyncAnnotateFileResponse", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse.output_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6816, - serialized_end=6911, -) - - -_ASYNCBATCHANNOTATEFILESREQUEST = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesRequest", - full_name="google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6913, - serialized_end=7020, -) - - -_ASYNCBATCHANNOTATEFILESRESPONSE = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesResponse", - full_name="google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7022, - serialized_end=7132, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.vision.v1p3beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.vision.v1p3beta1.InputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.vision.v1p3beta1.InputConfig.mime_type", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7134, - serialized_end=7228, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.vision.v1p3beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.vision.v1p3beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="batch_size", - full_name="google.cloud.vision.v1p3beta1.OutputConfig.batch_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7230, - serialized_end=7336, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.vision.v1p3beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p3beta1.GcsSource.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7338, - serialized_end=7362, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.vision.v1p3beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p3beta1.GcsDestination.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7364, - serialized_end=7393, -) - - -_OPERATIONMETADATA = _descriptor.Descriptor( - name="OperationMetadata", - full_name="google.cloud.vision.v1p3beta1.OperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.vision.v1p3beta1.OperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.vision.v1p3beta1.OperationMetadata.create_time", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.vision.v1p3beta1.OperationMetadata.update_time", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_OPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7396, - serialized_end=7667, -) - -_FEATURE.fields_by_name["type"].enum_type = _FEATURE_TYPE -_FEATURE_TYPE.containing_type = _FEATURE -_IMAGE.fields_by_name["source"].message_type = _IMAGESOURCE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "type" -].enum_type = _FACEANNOTATION_LANDMARK_TYPE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "position" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._POSITION -) -_FACEANNOTATION_LANDMARK.containing_type = _FACEANNOTATION -_FACEANNOTATION_LANDMARK_TYPE.containing_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name[ - "fd_bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name["landmarks"].message_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name["joy_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["sorrow_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["anger_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["surprise_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["under_exposed_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["blurred_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["headwear_likelihood"].enum_type = _LIKELIHOOD -_LOCATIONINFO.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_ENTITYANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_ENTITYANNOTATION.fields_by_name["locations"].message_type = _LOCATIONINFO -_ENTITYANNOTATION.fields_by_name["properties"].message_type = _PROPERTY -_LOCALIZEDOBJECTANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_SAFESEARCHANNOTATION.fields_by_name["adult"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["spoof"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["medical"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["violence"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["racy"].enum_type = _LIKELIHOOD -_LATLONGRECT.fields_by_name[ - "min_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LATLONGRECT.fields_by_name[ - "max_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_COLORINFO.fields_by_name["color"].message_type = google_dot_type_dot_color__pb2._COLOR -_DOMINANTCOLORSANNOTATION.fields_by_name["colors"].message_type = _COLORINFO -_IMAGEPROPERTIES.fields_by_name[ - "dominant_colors" -].message_type = _DOMINANTCOLORSANNOTATION -_CROPHINT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CROPHINTSANNOTATION.fields_by_name["crop_hints"].message_type = _CROPHINT -_IMAGECONTEXT.fields_by_name["lat_long_rect"].message_type = _LATLONGRECT -_IMAGECONTEXT.fields_by_name["crop_hints_params"].message_type = _CROPHINTSPARAMS -_IMAGECONTEXT.fields_by_name[ - "product_search_params" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__pb2._PRODUCTSEARCHPARAMS -) -_IMAGECONTEXT.fields_by_name["web_detection_params"].message_type = _WEBDETECTIONPARAMS -_ANNOTATEIMAGEREQUEST.fields_by_name["image"].message_type = _IMAGE -_ANNOTATEIMAGEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ANNOTATEIMAGEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ANNOTATEIMAGERESPONSE.fields_by_name["face_annotations"].message_type = _FACEANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "landmark_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "logo_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "label_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "localized_object_annotations" -].message_type = _LOCALIZEDOBJECTANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "text_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "full_text_annotation" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_text__annotation__pb2._TEXTANNOTATION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "safe_search_annotation" -].message_type = _SAFESEARCHANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "image_properties_annotation" -].message_type = _IMAGEPROPERTIES -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "crop_hints_annotation" -].message_type = _CROPHINTSANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "web_detection" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_web__detection__pb2._WEBDETECTION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "product_search_results" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__pb2._PRODUCTSEARCHRESULTS -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEIMAGERESPONSE.fields_by_name["context"].message_type = _IMAGEANNOTATIONCONTEXT -_ANNOTATEFILERESPONSE.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ANNOTATEFILERESPONSE.fields_by_name["responses"].message_type = _ANNOTATEIMAGERESPONSE -_BATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEIMAGEREQUEST -_BATCHANNOTATEIMAGESRESPONSE.fields_by_name[ - "responses" -].message_type = _ANNOTATEIMAGERESPONSE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ASYNCANNOTATEFILEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ASYNCANNOTATEFILEREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCANNOTATEFILERESPONSE.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCBATCHANNOTATEFILESREQUEST.fields_by_name[ - "requests" -].message_type = _ASYNCANNOTATEFILEREQUEST -_ASYNCBATCHANNOTATEFILESRESPONSE.fields_by_name[ - "responses" -].message_type = _ASYNCANNOTATEFILERESPONSE -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OPERATIONMETADATA.fields_by_name["state"].enum_type = _OPERATIONMETADATA_STATE -_OPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA_STATE.containing_type = _OPERATIONMETADATA -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["ImageSource"] = _IMAGESOURCE -DESCRIPTOR.message_types_by_name["Image"] = _IMAGE -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["LocationInfo"] = _LOCATIONINFO -DESCRIPTOR.message_types_by_name["Property"] = _PROPERTY -DESCRIPTOR.message_types_by_name["EntityAnnotation"] = _ENTITYANNOTATION -DESCRIPTOR.message_types_by_name[ - "LocalizedObjectAnnotation" -] = _LOCALIZEDOBJECTANNOTATION -DESCRIPTOR.message_types_by_name["SafeSearchAnnotation"] = _SAFESEARCHANNOTATION -DESCRIPTOR.message_types_by_name["LatLongRect"] = _LATLONGRECT -DESCRIPTOR.message_types_by_name["ColorInfo"] = _COLORINFO -DESCRIPTOR.message_types_by_name["DominantColorsAnnotation"] = _DOMINANTCOLORSANNOTATION -DESCRIPTOR.message_types_by_name["ImageProperties"] = _IMAGEPROPERTIES -DESCRIPTOR.message_types_by_name["CropHint"] = _CROPHINT -DESCRIPTOR.message_types_by_name["CropHintsAnnotation"] = _CROPHINTSANNOTATION -DESCRIPTOR.message_types_by_name["CropHintsParams"] = _CROPHINTSPARAMS -DESCRIPTOR.message_types_by_name["WebDetectionParams"] = _WEBDETECTIONPARAMS -DESCRIPTOR.message_types_by_name["ImageContext"] = _IMAGECONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageRequest"] = _ANNOTATEIMAGEREQUEST -DESCRIPTOR.message_types_by_name["ImageAnnotationContext"] = _IMAGEANNOTATIONCONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageResponse"] = _ANNOTATEIMAGERESPONSE -DESCRIPTOR.message_types_by_name["AnnotateFileResponse"] = _ANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesRequest" -] = _BATCHANNOTATEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesResponse" -] = _BATCHANNOTATEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name["AsyncAnnotateFileRequest"] = _ASYNCANNOTATEFILEREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncAnnotateFileResponse" -] = _ASYNCANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesRequest" -] = _ASYNCBATCHANNOTATEFILESREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesResponse" -] = _ASYNCBATCHANNOTATEFILESRESPONSE -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OperationMetadata"] = _OPERATIONMETADATA -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Feature = _reflection.GeneratedProtocolMessageType( - "Feature", - (_message.Message,), - dict( - DESCRIPTOR=_FEATURE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The type of Google Cloud Vision API detection to perform, - and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. - - - Attributes: - type: - The feature type. - max_results: - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. - model: - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Feature) - ), -) -_sym_db.RegisterMessage(Feature) - -ImageSource = _reflection.GeneratedProtocolMessageType( - "ImageSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGESOURCE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""External image source (Google Cloud Storage or web URL - image location). - - - Attributes: - gcs_image_uri: - \ **Use ``image_uri`` instead.** The Google Cloud Storage URI - of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - image_uri: - The URI of the source image. Can be either: 1. A Google Cloud - Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ for - more info. 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS URLs, Google cannot - guarantee that the request will be completed. Your request - may fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for production - applications. When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageSource) - ), -) -_sym_db.RegisterMessage(ImageSource) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Client image to perform Google Cloud Vision API tasks - over. - - - Attributes: - content: - Image content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - source: - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - Landmark=_reflection.GeneratedProtocolMessageType( - "Landmark", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION_LANDMARK, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""A face-specific landmark (for example, a face feature). - - - Attributes: - type: - Face landmark type. - position: - Face landmark position. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.FaceAnnotation.Landmark) - ), - ), - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""A face annotation object contains the results of face - detection. - - - Attributes: - bounding_poly: - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale, as returned in - ``ImageParams``. The bounding box is computed to "frame" the - face in accordance with human expectations. It is based on the - landmarker results. Note that one or more x and/or y - coordinates may not be generated in the ``BoundingPoly`` (the - polygon will be unbounded) if only a partial face appears in - the image to be annotated. - fd_bounding_poly: - The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on the - initial face detection, hence the fd (face detection) prefix. - landmarks: - Detected face landmarks. - roll_angle: - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation of the face relative to the image vertical - about the axis perpendicular to the face. Range [-180,180]. - pan_angle: - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. - tilt_angle: - Pitch angle, which indicates the upwards/downwards angle that - the face is pointing relative to the image's horizontal plane. - Range [-180,180]. - detection_confidence: - Detection confidence. Range [0, 1]. - landmarking_confidence: - Face landmarking confidence. Range [0, 1]. - joy_likelihood: - Joy likelihood. - sorrow_likelihood: - Sorrow likelihood. - anger_likelihood: - Anger likelihood. - surprise_likelihood: - Surprise likelihood. - under_exposed_likelihood: - Under-exposed likelihood. - blurred_likelihood: - Blurred likelihood. - headwear_likelihood: - Headwear likelihood. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) -_sym_db.RegisterMessage(FaceAnnotation.Landmark) - -LocationInfo = _reflection.GeneratedProtocolMessageType( - "LocationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONINFO, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Detected entity location information. - - - Attributes: - lat_lng: - lat/long location coordinates. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LocationInfo) - ), -) -_sym_db.RegisterMessage(LocationInfo) - -Property = _reflection.GeneratedProtocolMessageType( - "Property", - (_message.Message,), - dict( - DESCRIPTOR=_PROPERTY, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""A ``Property`` consists of a user-supplied name/value - pair. - - - Attributes: - name: - Name of the property. - value: - Value of the property. - uint64_value: - Value of numeric properties. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Property) - ), -) -_sym_db.RegisterMessage(Property) - -EntityAnnotation = _reflection.GeneratedProtocolMessageType( - "EntityAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Set of detected entity features. - - - Attributes: - mid: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - locale: - The language code for the locale in which the entity textual - ``description`` is expressed. - description: - Entity textual description, expressed in its ``locale`` - language. - score: - Overall score of the result. Range [0, 1]. - confidence: - \ **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. - topicality: - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" than - to an image containing a detected distant towering building, - even though the confidence that there is a tower in each image - may be the same. Range [0, 1]. - bounding_poly: - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. - locations: - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place where - the image was taken. Location information is usually present - for landmarks. - properties: - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies the - entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.EntityAnnotation) - ), -) -_sym_db.RegisterMessage(EntityAnnotation) - -LocalizedObjectAnnotation = _reflection.GeneratedProtocolMessageType( - "LocalizedObjectAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LOCALIZEDOBJECTANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Set of detected objects with bounding boxes. - - - Attributes: - mid: - Object ID that should align with EntityAnnotation mid. - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - name: - Object name, expressed in its ``language_code`` language. - score: - Score of the result. Range [0, 1]. - bounding_poly: - Image region to which this object belongs. This must be - populated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LocalizedObjectAnnotation) - ), -) -_sym_db.RegisterMessage(LocalizedObjectAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType( - "SafeSearchAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_SAFESEARCHANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Set of features pertaining to the image, computed by - computer vision methods over safe-search verticals (for example, adult, - spoof, medical, violence). - - - Attributes: - adult: - Represents the adult content likelihood for the image. Adult - content may contain elements such as nudity, pornographic - images or cartoons, or sexual activities. - spoof: - Spoof likelihood. The likelihood that an modification was made - to the image's canonical version to make it appear funny or - offensive. - medical: - Likelihood that this is a medical image. - violence: - Likelihood that this image contains violent content. - racy: - Likelihood that the request image contains racy content. Racy - content may include (but is not limited to) skimpy or sheer - clothing, strategically covered nudity, lewd or provocative - poses, or close-ups of sensitive body areas. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.SafeSearchAnnotation) - ), -) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -LatLongRect = _reflection.GeneratedProtocolMessageType( - "LatLongRect", - (_message.Message,), - dict( - DESCRIPTOR=_LATLONGRECT, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Rectangle determined by min and max ``LatLng`` pairs. - - - Attributes: - min_lat_lng: - Min lat/long pair. - max_lat_lng: - Max lat/long pair. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.LatLongRect) - ), -) -_sym_db.RegisterMessage(LatLongRect) - -ColorInfo = _reflection.GeneratedProtocolMessageType( - "ColorInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COLORINFO, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Color information consists of RGB channels, score, and the - fraction of the image that the color occupies in the image. - - - Attributes: - color: - RGB components of the color. - score: - Image-specific score for this color. Value in range [0, 1]. - pixel_fraction: - The fraction of pixels the color occupies in the image. Value - in range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ColorInfo) - ), -) -_sym_db.RegisterMessage(ColorInfo) - -DominantColorsAnnotation = _reflection.GeneratedProtocolMessageType( - "DominantColorsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_DOMINANTCOLORSANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Set of dominant colors and their corresponding scores. - - - Attributes: - colors: - RGB color values with their score and pixel fraction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DominantColorsAnnotation) - ), -) -_sym_db.RegisterMessage(DominantColorsAnnotation) - -ImageProperties = _reflection.GeneratedProtocolMessageType( - "ImageProperties", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPROPERTIES, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Stores image properties, such as dominant colors. - - - Attributes: - dominant_colors: - If present, dominant colors completed successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageProperties) - ), -) -_sym_db.RegisterMessage(ImageProperties) - -CropHint = _reflection.GeneratedProtocolMessageType( - "CropHint", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINT, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Single crop hint that is used to generate a new crop when - serving an image. - - - Attributes: - bounding_poly: - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale, as - returned in ``ImageParams``. - confidence: - Confidence of this being a salient region. Range [0, 1]. - importance_fraction: - Fraction of importance of this salient region with respect to - the original image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHint) - ), -) -_sym_db.RegisterMessage(CropHint) - -CropHintsAnnotation = _reflection.GeneratedProtocolMessageType( - "CropHintsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Set of crop hints that are used to generate new crops when - serving images. - - - Attributes: - crop_hints: - Crop hint results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHintsAnnotation) - ), -) -_sym_db.RegisterMessage(CropHintsAnnotation) - -CropHintsParams = _reflection.GeneratedProtocolMessageType( - "CropHintsParams", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSPARAMS, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Parameters for crop hints annotation request. - - - Attributes: - aspect_ratios: - Aspect ratios in floats, representing the ratio of the width - to the height of the image. For example, if the desired aspect - ratio is 4/3, the corresponding float value should be 1.33333. - If not specified, the best possible crop is returned. The - number of provided aspect ratios is limited to a maximum of - 16; any aspect ratios provided after the 16th are ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CropHintsParams) - ), -) -_sym_db.RegisterMessage(CropHintsParams) - -WebDetectionParams = _reflection.GeneratedProtocolMessageType( - "WebDetectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTIONPARAMS, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Parameters for web detection request. - - - Attributes: - include_geo_results: - Whether to include results derived from the geo information in - the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetectionParams) - ), -) -_sym_db.RegisterMessage(WebDetectionParams) - -ImageContext = _reflection.GeneratedProtocolMessageType( - "ImageContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECONTEXT, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Image context and/or feature-specific parameters. - - - Attributes: - lat_long_rect: - Not used. - language_hints: - List of languages to use for TEXT\_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not needed. In rare - cases, when the language of the text in the image is known, - setting a hint will help get better results (although it will - be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. - crop_hints_params: - Parameters for crop hints annotation request. - product_search_params: - Parameters for product search. - web_detection_params: - Parameters for web detection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageContext) - ), -) -_sym_db.RegisterMessage(ImageContext) - -AnnotateImageRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGEREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Request for performing Google Cloud Vision API tasks over - a user-provided image, with user-requested features. - - - Attributes: - image: - The image to be processed. - features: - Requested features. - image_context: - Additional context that may accompany the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateImageRequest) - ), -) -_sym_db.RegisterMessage(AnnotateImageRequest) - -ImageAnnotationContext = _reflection.GeneratedProtocolMessageType( - "ImageAnnotationContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEANNOTATIONCONTEXT, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""If an image was produced from a file (e.g. a PDF), this - message gives information about the source of that image. - - - Attributes: - uri: - The URI of the file used to produce the image. - page_number: - If the file was a PDF or TIFF, this field gives the page - number within the file used to produce the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImageAnnotationContext) - ), -) -_sym_db.RegisterMessage(ImageAnnotationContext) - -AnnotateImageResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateImageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGERESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Response to an image annotation request. - - - Attributes: - face_annotations: - If present, face detection has completed successfully. - landmark_annotations: - If present, landmark detection has completed successfully. - logo_annotations: - If present, logo detection has completed successfully. - label_annotations: - If present, label detection has completed successfully. - localized_object_annotations: - If present, localized object detection has completed - successfully. This will be sorted descending by confidence - score. - text_annotations: - If present, text (OCR) detection has completed successfully. - full_text_annotation: - If present, text (OCR) detection or document (OCR) text - detection has completed successfully. This annotation provides - the structural hierarchy for the OCR detected text. - safe_search_annotation: - If present, safe-search annotation has completed successfully. - image_properties_annotation: - If present, image properties were extracted successfully. - crop_hints_annotation: - If present, crop hints have completed successfully. - web_detection: - If present, web detection has completed successfully. - product_search_results: - If present, product search has completed successfully. - error: - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be correct, - even when ``error`` is set. - context: - If present, contextual information is needed to understand - where this image comes from. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateImageResponse) - ), -) -_sym_db.RegisterMessage(AnnotateImageResponse) - -AnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Response to a single file annotation request. A file may - contain one or more images, which individually have their own responses. - - - Attributes: - input_config: - Information about the file for which this response is - generated. - responses: - Individual responses to images found within the file. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AnnotateFileResponse) - -BatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Multiple image annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual image annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesRequest) - -BatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Response to a batch image annotation request. - - - Attributes: - responses: - Individual responses to image annotation requests within the - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesResponse) - -AsyncAnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""An offline file annotation request. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - output_config: - Required. The desired output location and metadata (e.g. - format). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileRequest) - -AsyncAnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The response for a single offline file annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncAnnotateFileRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncAnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileResponse) - -AsyncBatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Multiple async file annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual async file annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesRequest) - -AsyncBatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Response to an async batch file annotation request. - - - Attributes: - responses: - The list of file annotation responses, one for each request in - AsyncBatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AsyncBatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesResponse) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The desired input location and metadata. - - - Attributes: - gcs_source: - The Google Cloud Storage location to read the input from. - mime_type: - The type of the file. Currently only "application/pdf" and - "image/tiff" are supported. Wildcards are not supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The desired output location and metadata. - - - Attributes: - gcs_destination: - The Google Cloud Storage location to write the output(s) to. - batch_size: - The max number of response protos to put into each output JSON - file on Google Cloud Storage. The valid range is [1, 100]. If - not specified, the default value is 20. For example, for one - pdf file with 100 pages, 100 response protos will be - generated. If ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written under the prefix - ``gcs_destination``.\ ``uri``. Currently, batch\_size only - applies to GcsDestination, with potential future support for - other output configurations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the input will be - read from. - - - Attributes: - uri: - Google Cloud Storage URI for the input file. This must only be - a Google Cloud Storage object. Wildcards are not currently - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the output will be - written to. - - - Attributes: - uri: - Google Cloud Storage URI where the results will be stored. - Results will be in JSON format and preceded by its - corresponding input URI. This field can either represent a - single file, or a prefix for multiple outputs. Prefixes must - end in a ``/``. Examples: - File: gs://bucket- - name/filename.json - Prefix: gs://bucket-name/prefix/here/ - - File: gs://bucket-name/prefix/here If multiple outputs, each - response is still AnnotateFileResponse, each of which contains - some subset of the full list of AnnotateImageResponse. - Multiple outputs can happen if, for example, the output JSON - is too large and overflows into multiple sharded files. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.vision_v1p3beta1.proto.image_annotator_pb2", - __doc__="""Contains metadata for the BatchAnnotateImages operation. - - - Attributes: - state: - Current state of the batch operation. - create_time: - The time when the batch request was received. - update_time: - The time when the operation result was last updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - - -DESCRIPTOR._options = None - -_IMAGEANNOTATOR = _descriptor.ServiceDescriptor( - name="ImageAnnotator", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotator", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=7773, - serialized_end=8141, - methods=[ - _descriptor.MethodDescriptor( - name="BatchAnnotateImages", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotator.BatchAnnotateImages", - index=0, - containing_service=None, - input_type=_BATCHANNOTATEIMAGESREQUEST, - output_type=_BATCHANNOTATEIMAGESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p3beta1/images:annotate:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateFiles", - full_name="google.cloud.vision.v1p3beta1.ImageAnnotator.AsyncBatchAnnotateFiles", - index=1, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEFILESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002("#/v1p3beta1/files:asyncBatchAnnotate:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_IMAGEANNOTATOR) - -DESCRIPTOR.services_by_name["ImageAnnotator"] = _IMAGEANNOTATOR - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py deleted file mode 100644 index 4d5a8fdb6fa2..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py +++ /dev/null @@ -1,78 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p3beta1.proto import ( - image_annotator_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class ImageAnnotatorStub(object): - """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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchAnnotateImages = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ImageAnnotator/BatchAnnotateImages", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.FromString, - ) - self.AsyncBatchAnnotateFiles = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ImageAnnotator/AsyncBatchAnnotateFiles", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ImageAnnotatorServicer(object): - """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. - """ - - def BatchAnnotateImages(self, request, context): - """Run image detection and annotation for a batch of images. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AsyncBatchAnnotateFiles(self, request, context): - """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). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ImageAnnotatorServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchAnnotateImages": grpc.unary_unary_rpc_method_handler( - servicer.BatchAnnotateImages, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.SerializeToString, - ), - "AsyncBatchAnnotateFiles": grpc.unary_unary_rpc_method_handler( - servicer.AsyncBatchAnnotateFiles, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p3beta1.ImageAnnotator", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search.proto b/vision/google/cloud/vision_v1p3beta1/proto/product_search.proto deleted file mode 100644 index 6a30c08759d5..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search.proto +++ /dev/null @@ -1,162 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/cloud/vision/v1p3beta1/product_search_service.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// Parameters for a product search request. -message ProductSearchParams { - // The resource name of the catalog to search. - // - // Format is: `productSearch/catalogs/CATALOG_NAME`. - string catalog_name = 1; - - // The category to search in. - // Optional. It is inferred by the system if it is not specified. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 2; - - // The product category to search in. - // Optional. It is inferred by the system if it is not specified. - // Supported values are `bag`, `shoe`, `sunglasses`, `dress`, `outerwear`, - // `skirt`, `top`, `shorts`, and `pants`. - string product_category = 5; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - // [Deprecated] Use `bounding_poly`. - NormalizedBoundingPoly normalized_bounding_poly = 3; - - // The bounding polygon around the area of interest in the image. - // Optional. If it is not specified, system discretion will be applied. - BoundingPoly bounding_poly = 9; - - // Specifies the verbosity of the product search results. - // Optional. Defaults to `BASIC`. - ProductSearchResultsView view = 4; - - // The resource name of a - // [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be searched for - // similar images. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - string product_set = 6; - - // The list of product categories to search in. Currently, we only consider - // the first category, and either "homegoods" or "apparel" should be - // specified. - repeated string product_categories = 7; - - // The filtering expression. This can be used to restrict search results based - // on Product labels. We currently support an AND of OR of key-value - // expressions, where each expression within an OR must have the same key. - // - // For example, "(color = red OR color = blue) AND brand = Google" is - // acceptable, but not "(color = red OR brand = Google)" or "color: red". - string filter = 8; -} - -// Results for a product search request. -message ProductSearchResults { - // Information about a product. - message ProductInfo { - // Product ID. - string product_id = 1; - - // The URI of the image which matched the query image. - // - // This field is returned only if `view` is set to `FULL` in - // the request. - string image_uri = 2; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 3; - } - - // Information about a product. - message Result { - // The Product. - Product product = 1; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - // - // This field is returned only if `view` is set to `FULL` in - // the request. - float score = 2; - - // The resource name of the image from the product that is the closest match - // to the query. - string image = 3; - } - - // Product category. - // [Deprecated] Use `product_category`. - ProductSearchCategory category = 1; - - // Product category. - // Supported values are `bag` and `shoe`. - // [Deprecated] `product_category` is provided in each Product. - string product_category = 4; - - // Timestamp of the index which provided these results. Changes made after - // this time are not reflected in the current results. - google.protobuf.Timestamp index_time = 2; - - // List of detected products. - repeated ProductInfo products = 3; - - // List of results, one for each product match. - repeated Result results = 5; -} - -// Supported product search categories. -enum ProductSearchCategory { - // Default value used when a category is not specified. - PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0; - - // Shoes category. - SHOES = 1; - - // Bags category. - BAGS = 2; -} - -// Specifies the fields to include in product search results. -enum ProductSearchResultsView { - // Product search results contain only `product_category` and `product_id`. - // Default value. - BASIC = 0; - - // Product search results contain `product_category`, `product_id`, - // `image_uri`, and `score`. - FULL = 1; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2.py deleted file mode 100644 index 4053ea657115..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2.py +++ /dev/null @@ -1,713 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/product_search.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p3beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p3beta1.proto import ( - product_search_service_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/product_search.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\022ProductSearchProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n8google/cloud/vision_v1p3beta1/proto/product_search.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p3beta1/proto/geometry.proto\x1a@google/cloud/vision_v1p3beta1/proto/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xb2\x03\n\x13ProductSearchParams\x12\x14\n\x0c\x63\x61talog_name\x18\x01 \x01(\t\x12\x46\n\x08\x63\x61tegory\x18\x02 \x01(\x0e\x32\x34.google.cloud.vision.v1p3beta1.ProductSearchCategory\x12\x18\n\x10product_category\x18\x05 \x01(\t\x12W\n\x18normalized_bounding_poly\x18\x03 \x01(\x0b\x32\x35.google.cloud.vision.v1p3beta1.NormalizedBoundingPoly\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x45\n\x04view\x18\x04 \x01(\x0e\x32\x37.google.cloud.vision.v1p3beta1.ProductSearchResultsView\x12\x13\n\x0bproduct_set\x18\x06 \x01(\t\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t"\xee\x03\n\x14ProductSearchResults\x12\x46\n\x08\x63\x61tegory\x18\x01 \x01(\x0e\x32\x34.google.cloud.vision.v1p3beta1.ProductSearchCategory\x12\x18\n\x10product_category\x18\x04 \x01(\t\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12Q\n\x08products\x18\x03 \x03(\x0b\x32?.google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p3beta1.ProductSearchResults.Result\x1a\x43\n\x0bProductInfo\x12\x12\n\nproduct_id\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t\x12\r\n\x05score\x18\x03 \x01(\x02\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t*U\n\x15ProductSearchCategory\x12\'\n#PRODUCT_SEARCH_CATEGORY_UNSPECIFIED\x10\x00\x12\t\n\x05SHOES\x10\x01\x12\x08\n\x04\x42\x41GS\x10\x02*/\n\x18ProductSearchResultsView\x12\t\n\x05\x42\x41SIC\x10\x00\x12\x08\n\x04\x46ULL\x10\x01\x42\x81\x01\n!com.google.cloud.vision.v1p3beta1B\x12ProductSearchProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - -_PRODUCTSEARCHCATEGORY = _descriptor.EnumDescriptor( - name="ProductSearchCategory", - full_name="google.cloud.vision.v1p3beta1.ProductSearchCategory", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="PRODUCT_SEARCH_CATEGORY_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SHOES", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BAGS", index=2, number=2, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1206, - serialized_end=1291, -) -_sym_db.RegisterEnumDescriptor(_PRODUCTSEARCHCATEGORY) - -ProductSearchCategory = enum_type_wrapper.EnumTypeWrapper(_PRODUCTSEARCHCATEGORY) -_PRODUCTSEARCHRESULTSVIEW = _descriptor.EnumDescriptor( - name="ProductSearchResultsView", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResultsView", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="BASIC", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FULL", index=1, number=1, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1293, - serialized_end=1340, -) -_sym_db.RegisterEnumDescriptor(_PRODUCTSEARCHRESULTSVIEW) - -ProductSearchResultsView = enum_type_wrapper.EnumTypeWrapper(_PRODUCTSEARCHRESULTSVIEW) -PRODUCT_SEARCH_CATEGORY_UNSPECIFIED = 0 -SHOES = 1 -BAGS = 2 -BASIC = 0 -FULL = 1 - - -_PRODUCTSEARCHPARAMS = _descriptor.Descriptor( - name="ProductSearchParams", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="catalog_name", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.catalog_name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="category", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.category", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_category", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.product_category", - index=2, - number=5, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_bounding_poly", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.normalized_bounding_poly", - index=3, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.bounding_poly", - index=4, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="view", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.view", - index=5, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.product_set", - index=6, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_categories", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.product_categories", - index=7, - number=7, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.vision.v1p3beta1.ProductSearchParams.filter", - index=8, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=273, - serialized_end=707, -) - - -_PRODUCTSEARCHRESULTS_PRODUCTINFO = _descriptor.Descriptor( - name="ProductInfo", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_id", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.product_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.image_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo.score", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1040, - serialized_end=1107, -) - -_PRODUCTSEARCHRESULTS_RESULT = _descriptor.Descriptor( - name="Result", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.Result", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.Result.product", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.Result.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.Result.image", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1109, - serialized_end=1204, -) - -_PRODUCTSEARCHRESULTS = _descriptor.Descriptor( - name="ProductSearchResults", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="category", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.category", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_category", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.product_category", - index=1, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="index_time", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.index_time", - index=2, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="products", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.products", - index=3, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.vision.v1p3beta1.ProductSearchResults.results", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PRODUCTSEARCHRESULTS_PRODUCTINFO, _PRODUCTSEARCHRESULTS_RESULT], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=710, - serialized_end=1204, -) - -_PRODUCTSEARCHPARAMS.fields_by_name["category"].enum_type = _PRODUCTSEARCHCATEGORY -_PRODUCTSEARCHPARAMS.fields_by_name[ - "normalized_bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._NORMALIZEDBOUNDINGPOLY -) -_PRODUCTSEARCHPARAMS.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PRODUCTSEARCHPARAMS.fields_by_name["view"].enum_type = _PRODUCTSEARCHRESULTSVIEW -_PRODUCTSEARCHRESULTS_PRODUCTINFO.containing_type = _PRODUCTSEARCHRESULTS -_PRODUCTSEARCHRESULTS_RESULT.fields_by_name[ - "product" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2._PRODUCT -) -_PRODUCTSEARCHRESULTS_RESULT.containing_type = _PRODUCTSEARCHRESULTS -_PRODUCTSEARCHRESULTS.fields_by_name["category"].enum_type = _PRODUCTSEARCHCATEGORY -_PRODUCTSEARCHRESULTS.fields_by_name[ - "index_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PRODUCTSEARCHRESULTS.fields_by_name[ - "products" -].message_type = _PRODUCTSEARCHRESULTS_PRODUCTINFO -_PRODUCTSEARCHRESULTS.fields_by_name[ - "results" -].message_type = _PRODUCTSEARCHRESULTS_RESULT -DESCRIPTOR.message_types_by_name["ProductSearchParams"] = _PRODUCTSEARCHPARAMS -DESCRIPTOR.message_types_by_name["ProductSearchResults"] = _PRODUCTSEARCHRESULTS -DESCRIPTOR.enum_types_by_name["ProductSearchCategory"] = _PRODUCTSEARCHCATEGORY -DESCRIPTOR.enum_types_by_name["ProductSearchResultsView"] = _PRODUCTSEARCHRESULTSVIEW -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ProductSearchParams = _reflection.GeneratedProtocolMessageType( - "ProductSearchParams", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHPARAMS, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_pb2", - __doc__="""Parameters for a product search request. - - - Attributes: - catalog_name: - The resource name of the catalog to search. Format is: - ``productSearch/catalogs/CATALOG_NAME``. - category: - The category to search in. Optional. It is inferred by the - system if it is not specified. [Deprecated] Use - ``product_category``. - product_category: - The product category to search in. Optional. It is inferred by - the system if it is not specified. Supported values are - ``bag``, ``shoe``, ``sunglasses``, ``dress``, ``outerwear``, - ``skirt``, ``top``, ``shorts``, and ``pants``. - normalized_bounding_poly: - The bounding polygon around the area of interest in the image. - Optional. If it is not specified, system discretion will be - applied. [Deprecated] Use ``bounding_poly``. - bounding_poly: - The bounding polygon around the area of interest in the image. - Optional. If it is not specified, system discretion will be - applied. - view: - Specifies the verbosity of the product search results. - Optional. Defaults to ``BASIC``. - product_set: - The resource name of a - [ProductSet][google.cloud.vision.v1p3beta1.ProductSet] to be - searched for similar images. Format is: ``projects/PROJECT_ID - /locations/LOC_ID/productSets/PRODUCT_SET_ID``. - product_categories: - The list of product categories to search in. Currently, we - only consider the first category, and either "homegoods" or - "apparel" should be specified. - filter: - The filtering expression. This can be used to restrict search - results based on Product labels. We currently support an AND - of OR of key-value expressions, where each expression within - an OR must have the same key. For example, "(color = red OR - color = blue) AND brand = Google" is acceptable, but not - "(color = red OR brand = Google)" or "color: red". - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchParams) - ), -) -_sym_db.RegisterMessage(ProductSearchParams) - -ProductSearchResults = _reflection.GeneratedProtocolMessageType( - "ProductSearchResults", - (_message.Message,), - dict( - ProductInfo=_reflection.GeneratedProtocolMessageType( - "ProductInfo", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHRESULTS_PRODUCTINFO, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_pb2", - __doc__="""Information about a product. - - - Attributes: - product_id: - Product ID. - image_uri: - The URI of the image which matched the query image. This - field is returned only if ``view`` is set to ``FULL`` in the - request. - score: - A confidence level on the match, ranging from 0 (no - confidence) to 1 (full confidence). This field is returned - only if ``view`` is set to ``FULL`` in the request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.ProductInfo) - ), - ), - Result=_reflection.GeneratedProtocolMessageType( - "Result", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHRESULTS_RESULT, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_pb2", - __doc__="""Information about a product. - - - Attributes: - product: - The Product. - score: - A confidence level on the match, ranging from 0 (no - confidence) to 1 (full confidence). This field is returned - only if ``view`` is set to ``FULL`` in the request. - image: - The resource name of the image from the product that is the - closest match to the query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults.Result) - ), - ), - DESCRIPTOR=_PRODUCTSEARCHRESULTS, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_pb2", - __doc__="""Results for a product search request. - - - Attributes: - category: - Product category. [Deprecated] Use ``product_category``. - product_category: - Product category. Supported values are ``bag`` and ``shoe``. - [Deprecated] ``product_category`` is provided in each Product. - index_time: - Timestamp of the index which provided these results. Changes - made after this time are not reflected in the current results. - products: - List of detected products. - results: - List of results, one for each product match. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSearchResults) - ), -) -_sym_db.RegisterMessage(ProductSearchResults) -_sym_db.RegisterMessage(ProductSearchResults.ProductInfo) -_sym_db.RegisterMessage(ProductSearchResults.Result) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service.proto b/vision/google/cloud/vision_v1p3beta1/proto/product_search_service.proto deleted file mode 100644 index 23919ee7e844..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service.proto +++ /dev/null @@ -1,842 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchServiceProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// 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.v1p3beta1.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.v1p3beta1.Product] resources, named -// `projects/*/locations/*/products/*` -// -// - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of -// [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, -// named -// `projects/*/locations/*/products/*/referenceImages/*` -service ProductSearch { - // Creates and returns a new ProductSet resource. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - // 4096 characters. - rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - body: "product_set" - }; - } - - // Lists ProductSets in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - // than 1. - rpc ListProductSets(ListProductSetsRequest) - returns (ListProductSetsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/productSets" - }; - } - - // Gets information associated with a ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc GetProductSet(GetProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - patch: "/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}" - body: "product_set" - }; - } - - // Permanently deletes a ProductSet. All Products and ReferenceImages in the - // ProductSet will be deleted. - // - // The actual image files are not deleted from Google Cloud Storage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc DeleteProductSet(DeleteProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - }; - } - - // 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. - rpc CreateProduct(CreateProductRequest) returns (Product) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/products" - body: "product" - }; - } - - // Lists products in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*}/products" - }; - } - - // Gets information associated with a Product. - // - // Possible errors: - // - // * Returns NOT_FOUND if the Product does not exist. - rpc GetProduct(GetProductRequest) returns (Product) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // Makes changes to a Product resource. - // Only display_name, description and labels 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. - rpc UpdateProduct(UpdateProductRequest) returns (Product) { - option (google.api.http) = { - patch: "/v1p3beta1/{product.name=projects/*/locations/*/products/*}" - body: "product" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the product does not exist. - rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*}" - }; - } - - // 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. - rpc CreateReferenceImage(CreateReferenceImageRequest) - returns (ReferenceImage) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - body: "reference_image" - }; - } - - // 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. - // - // Possible errors: - // - // * Returns NOT_FOUND if the reference image does not exist. - rpc DeleteReferenceImage(DeleteReferenceImageRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc ListReferenceImages(ListReferenceImagesRequest) - returns (ListReferenceImagesResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - }; - } - - // Gets information associated with a ReferenceImage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the specified image does not exist. - rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - } - - // 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. - rpc AddProductToProductSet(AddProductToProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct" - body: "*" - }; - } - - // Removes a Product from the specified ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND If the Product is not found under the ProductSet. - rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct" - body: "*" - }; - } - - // 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. - rpc ListProductsInProductSet(ListProductsInProductSetRequest) - returns (ListProductsInProductSetResponse) { - option (google.api.http) = { - get: "/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" - }; - } - - // 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.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc ImportProductSets(ImportProductSetsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p3beta1/{parent=projects/*/locations/*}/productSets:import" - body: "*" - }; - } -} - -// A Product contains ReferenceImages. -message Product { - // A product label represented as a key-value pair. - message KeyValue { - // The key of the label attached to the product. Cannot be empty and cannot - // exceed 128 bytes. - string key = 1; - - // The value of the label attached to the product. Cannot be empty and - // cannot exceed 128 bytes. - string value = 2; - } - - // The resource name of the product. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - // - // This field is ignored when creating a product. - string name = 1; - - // The user-provided name for this Product. Must not be empty. Must be at most - // 4096 characters long. - string display_name = 2; - - // User-provided metadata to be stored with this product. Must be at most 4096 - // characters long. - string description = 3; - - // The category for the product identified by the reference image. This should - // be either "homegoods" or "apparel". - // - // This field is immutable. - string product_category = 4; - - // Key-value pairs that can be attached to a product. At query time, - // constraints can be specified based on the product_labels. - // - // Note that integer values can be provided as strings, e.g. "1199". Only - // strings with integer values can match a range-based restriction which is - // to be supported soon. - // - // Multiple values can be assigned to the same key. One product may have up to - // 100 product_labels. - repeated KeyValue product_labels = 5; -} - -// A ProductSet contains Products. A ProductSet can contain a maximum of 1 -// million reference images. If the limit is exceeded, periodic indexing will -// fail. -message ProductSet { - // The resource name of the ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - // - // This field is ignored when creating a ProductSet. - string name = 1; - - // The user-provided name for this ProductSet. Must not be empty. Must be at - // most 4096 characters long. - string display_name = 2; - - // Output only. The time at which this ProductSet was last indexed. Query - // results will reflect all updates before this time. If this ProductSet has - // never been indexed, this field is 0. - // - // This field is ignored when creating a ProductSet. - google.protobuf.Timestamp index_time = 3; - - // Output only. If there was an error with indexing the product set, the field - // is populated. - // - // This field is ignored when creating a ProductSet. - google.rpc.Status index_error = 4; -} - -// A `ReferenceImage` represents a product image and its associated metadata, -// such as bounding boxes. -message ReferenceImage { - // The resource name of the reference image. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - // - // This field is ignored when creating a reference image. - string name = 1; - - // The Google Cloud Storage URI of the reference image. - // - // The URI must start with `gs://`. - // - // Required. - string uri = 2; - - // Bounding polygons around the areas of interest in the reference image. - // Optional. If this field is empty, the system will try to detect regions of - // interest. At most 10 bounding polygons will be used. - // - // The provided shape is converted into a non-rotated rectangle. Once - // converted, the small edge of the rectangle must be greater than or equal - // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - // is not). - repeated BoundingPoly bounding_polys = 3; -} - -// Request message for the `CreateProduct` method. -message CreateProductRequest { - // The project in which the Product should be created. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The product to create. - Product product = 2; - - // A user-supplied resource id for this Product. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_id = 3; -} - -// Request message for the `ListProducts` method. -message ListProductsRequest { - // The project OR ProductSet from which Products should be listed. - // - // Format: - // `projects/PROJECT_ID/locations/LOC_ID` - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProducts` method. -message ListProductsResponse { - // List of products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProduct` method. -message GetProductRequest { - // Resource name of the Product to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `UpdateProduct` method. -message UpdateProductRequest { - // The Product resource which replaces the one on the server. - // product.name is immutable. - Product product = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields - // to update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask paths include `product_labels`, `display_name` and - // `description`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProduct` method. -message DeleteProductRequest { - // Resource name of product to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1; -} - -// Request message for the `CreateProductSet` method. -message CreateProductSetRequest { - // The project in which the ProductSet should be created. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The ProductSet to create. - ProductSet product_set = 2; - - // A user-supplied resource id for this ProductSet. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_set_id = 3; -} - -// Request message for the `ListProductSets` method. -message ListProductSetsRequest { - // The project from which ProductSets should be listed. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductSets` method. -message ListProductSetsResponse { - // List of ProductSets. - repeated ProductSet product_sets = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProductSet` method. -message GetProductSetRequest { - // Resource name of the ProductSet to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `UpdateProductSet` method. -message UpdateProductSetRequest { - // The ProductSet resource which replaces the one on the server. - ProductSet product_set = 1; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to - // update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask path is `display_name`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProductSet` method. -message DeleteProductSetRequest { - // Resource name of the ProductSet to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; -} - -// Request message for the `CreateReferenceImage` method. -message CreateReferenceImageRequest { - // Resource name of the product in which to create the reference image. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The reference image to create. - // If an image ID is specified, it is ignored. - ReferenceImage reference_image = 2; - - // A user-supplied resource id for the ReferenceImage to be added. If set, - // the server will attempt to use this value as the resource id. If it is - // already in use, an error is returned with code ALREADY_EXISTS. Must be at - // most 128 characters long. It cannot contain the character `/`. - string reference_image_id = 3; -} - -// Request message for the `ListReferenceImages` method. -message ListReferenceImagesRequest { - // Resource name of the product containing the reference images. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // A token identifying a page of results to be returned. This is the value - // of `nextPageToken` returned in a previous reference image list request. - // - // Defaults to the first page if not specified. - string page_token = 3; -} - -// Response message for the `ListReferenceImages` method. -message ListReferenceImagesResponse { - // The list of reference images. - repeated ReferenceImage reference_images = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string next_page_token = 3; -} - -// Request message for the `GetReferenceImage` method. -message GetReferenceImageRequest { - // The resource name of the ReferenceImage to get. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - string name = 1; -} - -// Request message for the `DeleteReferenceImage` method. -message DeleteReferenceImageRequest { - // The resource name of the reference image to delete. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - string name = 1; -} - -// Request message for the `AddProductToProductSet` method. -message AddProductToProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be added to this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `RemoveProductFromProductSet` method. -message RemoveProductFromProductSetRequest { - // The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The resource name for the Product to be removed from this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2; -} - -// Request message for the `ListProductsInProductSet` method. -message ListProductsInProductSetRequest { - // The ProductSet resource for which to retrieve Products. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductsInProductSet` method. -message ListProductsInProductSetResponse { - // The list of Products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// The Google Cloud Storage location for a csv file which preserves a list of -// ImportProductSetRequests in each line. -message ImportProductSetsGcsSource { - // The Google Cloud Storage URI of the input csv file. - // - // The URI must start with gs:// - // - // The format of the input csv file should be one image per line. - // In each line, there are 6 columns. - // 1. image_uri - // 2, image_id - // 3. product_set_id - // 4. product_id - // 5, product_category - // 6, product_display_name - // 7, labels - // 8. bounding_poly - // - // Columns 1, 3, 4, and 5 are required, other columns are optional. A new - // ProductSet/Product with the same id will be created on the fly - // if the ProductSet/Product specified by product_set_id/product_id does not - // exist. - // - // The image_id field is optional but has to be unique if provided. If it is - // empty, we will automatically assign an unique id to the image. - // - // The product_display_name field is optional. If it is empty, a space (" ") - // is used as the place holder for the product display_name, which can - // be updated later through the realtime API. - // - // If the Product with product_id already exists, the fields - // product_display_name, product_category and labels are ignored. - // - // If a Product doesn't exist and needs to be created on the fly, the - // product_display_name field refers to - // [Product.display_name][google.cloud.vision.v1p3beta1.Product.display_name], - // the product_category field refers to - // [Product.product_category][google.cloud.vision.v1p3beta1.Product.product_category], - // and the labels field refers to [Product.labels][]. - // - // Labels (optional) should be a line containing a list of comma-separated - // key-value pairs, with the format - // "key_1=value_1,key_2=value_2,...,key_n=value_n". - // - // The bounding_poly (optional) field is used to identify one region of - // interest from the image in the same manner as CreateReferenceImage. If no - // bounding_poly is specified, the system will try to detect regions of - // interest automatically. - // - // Note that the pipeline will resize the image if the image resolution is too - // large to process (above 20MP). - // - // Also note that at most one bounding_poly is allowed per line. If the image - // contains multiple regions of interest, the csv should contain one line per - // region of interest. - // - // The bounding_poly column should contain an even number of comma-separated - // numbers, with the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Nonnegative - // integers should be used for absolute bounding polygons, and float values - // in [0, 1] should be used for normalized bounding polygons. - string csv_file_uri = 1; -} - -// The input content for the `ImportProductSets` method. -message ImportProductSetsInputConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for a csv file which preserves a list - // of ImportProductSetRequests in each line. - ImportProductSetsGcsSource gcs_source = 1; - } -} - -// Request message for the `ImportProductSets` method. -message ImportProductSetsRequest { - // The project in which the ProductSets should be imported. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1; - - // The input content for the list of requests. - ImportProductSetsInputConfig input_config = 2; -} - -// Response message for the `ImportProductSets` method. -// -// This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] -// method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field. -message ImportProductSetsResponse { - // The list of reference_images that are imported successfully. - repeated ReferenceImage reference_images = 1; - - // The rpc status for each ImportProductSet request, including both successes - // and errors. - // - // The number of statuses here matches the number of lines in the csv file, - // and statuses[i] stores the success or failure status of processing the i-th - // line of the csv, starting from line 0. - repeated google.rpc.Status statuses = 2; -} - -// Metadata for the batch operations such as the current state. -// -// This is included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message BatchOperationMetadata { - // Enumerates the possible states that the batch request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is actively being processed. - PROCESSING = 1; - - // The request is done and at least one item has been successfully - // processed. - SUCCESSFUL = 2; - - // The request is done and no item has been successfully processed. - FAILED = 3; - - // The request is done after the longrunning.Operations.CancelOperation has - // been called by the user. Any records that were processed before the - // cancel command are output as specified in the request. - CANCELLED = 4; - } - - // The current state of the batch operation. - State state = 1; - - // The time when the batch request was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the batch request is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is - // set to true. - google.protobuf.Timestamp end_time = 3; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py deleted file mode 100644 index 28e565c5d5ba..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py +++ /dev/null @@ -1,3031 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/product_search_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p3beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/product_search_service.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\031ProductSearchServiceProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n@google/cloud/vision_v1p3beta1/proto/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p3beta1/proto/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xcd\x01\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x18\n\x10product_category\x18\x04 \x01(\t\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p3beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t"\x89\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12.\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\'\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status"p\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0b\n\x03uri\x18\x02 \x01(\t\x12\x43\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly"s\n\x14\x43reateProductRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x37\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x12\n\nproduct_id\x18\x03 \x01(\t"L\n\x13ListProductsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"!\n\x11GetProductRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x80\x01\n\x14UpdateProductRequest\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"$\n\x14\x44\x65leteProductRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x81\x01\n\x17\x43reateProductSetRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12>\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSet\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t"O\n\x16ListProductSetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"$\n\x14GetProductSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x8a\x01\n\x17UpdateProductSetRequest\x12>\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p3beta1.ProductSet\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"\'\n\x17\x44\x65leteProductSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"\x91\x01\n\x1b\x43reateReferenceImageRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x46\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t"S\n\x1aListReferenceImagesRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t"(\n\x18GetReferenceImageRequest\x12\x0c\n\x04name\x18\x01 \x01(\t"+\n\x1b\x44\x65leteReferenceImageRequest\x12\x0c\n\x04name\x18\x01 \x01(\t">\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07product\x18\x02 \x01(\t"C\n"RemoveProductFromProductSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x0f\n\x07product\x18\x02 \x01(\t"V\n\x1fListProductsInProductSetRequest\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p3beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p3beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source"}\n\x18ImportProductSetsRequest\x12\x0e\n\x06parent\x18\x01 \x01(\t\x12Q\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p3beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p3beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04\x32\x9f\x1b\n\rProductSearch\x12\xc2\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p3beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet"K\x82\xd3\xe4\x93\x02\x45"6/v1p3beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\x12\xc0\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p3beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p3beta1.ListProductSetsResponse">\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{parent=projects/*/locations/*}/productSets\x12\xaf\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p3beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet">\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xce\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p3beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p3beta1.ProductSet"W\x82\xd3\xe4\x93\x02Q2B/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\x12\xa2\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p3beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty">\x82\xd3\xe4\x93\x02\x38*6/v1p3beta1/{name=projects/*/locations/*/productSets/*}\x12\xb2\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p3beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product"D\x82\xd3\xe4\x93\x02>"3/v1p3beta1/{parent=projects/*/locations/*}/products:\x07product\x12\xb4\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p3beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p3beta1.ListProductsResponse";\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{parent=projects/*/locations/*}/products\x12\xa3\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p3beta1.GetProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product";\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\xba\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p3beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p3beta1.Product"L\x82\xd3\xe4\x93\x02\x46\x32;/v1p3beta1/{product.name=projects/*/locations/*/products/*}:\x07product\x12\x99\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p3beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty";\x82\xd3\xe4\x93\x02\x35*3/v1p3beta1/{name=projects/*/locations/*/products/*}\x12\xe1\x01\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p3beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage"^\x82\xd3\xe4\x93\x02X"E/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\x12\xb9\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty"M\x82\xd3\xe4\x93\x02G*E/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xdb\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p3beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p3beta1.ListReferenceImagesResponse"M\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages\x12\xca\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p3beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p3beta1.ReferenceImage"M\x82\xd3\xe4\x93\x02G\x12\x45/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\x12\xbc\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p3beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty"L\x82\xd3\xe4\x93\x02\x46"A/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\x12\xc9\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty"O\x82\xd3\xe4\x93\x02I"D/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\x12\xe4\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse"G\x82\xd3\xe4\x93\x02\x41\x12?/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products\x12\xb5\x01\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p3beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation"H\x82\xd3\xe4\x93\x02\x42"=/v1p3beta1/{parent=projects/*/locations/*}/productSets:import:\x01*B\x88\x01\n!com.google.cloud.vision.v1p3beta1B\x19ProductSearchServiceProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_BATCHOPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.vision.v1p3beta1.BatchOperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROCESSING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCESSFUL", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=3307, - serialized_end=3396, -) -_sym_db.RegisterEnumDescriptor(_BATCHOPERATIONMETADATA_STATE) - - -_PRODUCT_KEYVALUE = _descriptor.Descriptor( - name="KeyValue", - full_name="google.cloud.vision.v1p3beta1.Product.KeyValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.vision.v1p3beta1.Product.KeyValue.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p3beta1.Product.KeyValue.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=507, - serialized_end=545, -) - -_PRODUCT = _descriptor.Descriptor( - name="Product", - full_name="google.cloud.vision.v1p3beta1.Product", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.Product.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.vision.v1p3beta1.Product.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p3beta1.Product.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_category", - full_name="google.cloud.vision.v1p3beta1.Product.product_category", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_labels", - full_name="google.cloud.vision.v1p3beta1.Product.product_labels", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PRODUCT_KEYVALUE], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=340, - serialized_end=545, -) - - -_PRODUCTSET = _descriptor.Descriptor( - name="ProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.ProductSet.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.vision.v1p3beta1.ProductSet.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="index_time", - full_name="google.cloud.vision.v1p3beta1.ProductSet.index_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="index_error", - full_name="google.cloud.vision.v1p3beta1.ProductSet.index_error", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=548, - serialized_end=685, -) - - -_REFERENCEIMAGE = _descriptor.Descriptor( - name="ReferenceImage", - full_name="google.cloud.vision.v1p3beta1.ReferenceImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.ReferenceImage.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p3beta1.ReferenceImage.uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_polys", - full_name="google.cloud.vision.v1p3beta1.ReferenceImage.bounding_polys", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=687, - serialized_end=799, -) - - -_CREATEPRODUCTREQUEST = _descriptor.Descriptor( - name="CreateProductRequest", - full_name="google.cloud.vision.v1p3beta1.CreateProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.CreateProductRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p3beta1.CreateProductRequest.product", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_id", - full_name="google.cloud.vision.v1p3beta1.CreateProductRequest.product_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=801, - serialized_end=916, -) - - -_LISTPRODUCTSREQUEST = _descriptor.Descriptor( - name="ListProductsRequest", - full_name="google.cloud.vision.v1p3beta1.ListProductsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.ListProductsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p3beta1.ListProductsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=918, - serialized_end=994, -) - - -_LISTPRODUCTSRESPONSE = _descriptor.Descriptor( - name="ListProductsResponse", - full_name="google.cloud.vision.v1p3beta1.ListProductsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="products", - full_name="google.cloud.vision.v1p3beta1.ListProductsResponse.products", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=996, - serialized_end=1101, -) - - -_GETPRODUCTREQUEST = _descriptor.Descriptor( - name="GetProductRequest", - full_name="google.cloud.vision.v1p3beta1.GetProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.GetProductRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1103, - serialized_end=1136, -) - - -_UPDATEPRODUCTREQUEST = _descriptor.Descriptor( - name="UpdateProductRequest", - full_name="google.cloud.vision.v1p3beta1.UpdateProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p3beta1.UpdateProductRequest.product", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.vision.v1p3beta1.UpdateProductRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1139, - serialized_end=1267, -) - - -_DELETEPRODUCTREQUEST = _descriptor.Descriptor( - name="DeleteProductRequest", - full_name="google.cloud.vision.v1p3beta1.DeleteProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.DeleteProductRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1269, - serialized_end=1305, -) - - -_CREATEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="CreateProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.CreateProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.CreateProductSetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p3beta1.CreateProductSetRequest.product_set", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set_id", - full_name="google.cloud.vision.v1p3beta1.CreateProductSetRequest.product_set_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1308, - serialized_end=1437, -) - - -_LISTPRODUCTSETSREQUEST = _descriptor.Descriptor( - name="ListProductSetsRequest", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1439, - serialized_end=1518, -) - - -_LISTPRODUCTSETSRESPONSE = _descriptor.Descriptor( - name="ListProductSetsResponse", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_sets", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsResponse.product_sets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductSetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1520, - serialized_end=1635, -) - - -_GETPRODUCTSETREQUEST = _descriptor.Descriptor( - name="GetProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.GetProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.GetProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1637, - serialized_end=1673, -) - - -_UPDATEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="UpdateProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.UpdateProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p3beta1.UpdateProductSetRequest.product_set", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.vision.v1p3beta1.UpdateProductSetRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1676, - serialized_end=1814, -) - - -_DELETEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="DeleteProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.DeleteProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.DeleteProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1816, - serialized_end=1855, -) - - -_CREATEREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="CreateReferenceImageRequest", - full_name="google.cloud.vision.v1p3beta1.CreateReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reference_image", - full_name="google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.reference_image", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reference_image_id", - full_name="google.cloud.vision.v1p3beta1.CreateReferenceImageRequest.reference_image_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1858, - serialized_end=2003, -) - - -_LISTREFERENCEIMAGESREQUEST = _descriptor.Descriptor( - name="ListReferenceImagesRequest", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2005, - serialized_end=2088, -) - - -_LISTREFERENCEIMAGESRESPONSE = _descriptor.Descriptor( - name="ListReferenceImagesResponse", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="reference_images", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.reference_images", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p3beta1.ListReferenceImagesResponse.next_page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2091, - serialized_end=2237, -) - - -_GETREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="GetReferenceImageRequest", - full_name="google.cloud.vision.v1p3beta1.GetReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.GetReferenceImageRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2239, - serialized_end=2279, -) - - -_DELETEREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="DeleteReferenceImageRequest", - full_name="google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2281, - serialized_end=2324, -) - - -_ADDPRODUCTTOPRODUCTSETREQUEST = _descriptor.Descriptor( - name="AddProductToProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.AddProductToProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p3beta1.AddProductToProductSetRequest.product", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2326, - serialized_end=2388, -) - - -_REMOVEPRODUCTFROMPRODUCTSETREQUEST = _descriptor.Descriptor( - name="RemoveProductFromProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest.product", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2390, - serialized_end=2457, -) - - -_LISTPRODUCTSINPRODUCTSETREQUEST = _descriptor.Descriptor( - name="ListProductsInProductSetRequest", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2459, - serialized_end=2545, -) - - -_LISTPRODUCTSINPRODUCTSETRESPONSE = _descriptor.Descriptor( - name="ListProductsInProductSetResponse", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="products", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.products", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2547, - serialized_end=2664, -) - - -_IMPORTPRODUCTSETSGCSSOURCE = _descriptor.Descriptor( - name="ImportProductSetsGcsSource", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="csv_file_uri", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2666, - serialized_end=2716, -) - - -_IMPORTPRODUCTSETSINPUTCONFIG = _descriptor.Descriptor( - name="ImportProductSetsInputConfig", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=2718, - serialized_end=2839, -) - - -_IMPORTPRODUCTSETSREQUEST = _descriptor.Descriptor( - name="ImportProductSetsRequest", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsRequest.input_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2841, - serialized_end=2966, -) - - -_IMPORTPRODUCTSETSRESPONSE = _descriptor.Descriptor( - name="ImportProductSetsResponse", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="reference_images", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsResponse.reference_images", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="statuses", - full_name="google.cloud.vision.v1p3beta1.ImportProductSetsResponse.statuses", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2969, - serialized_end=3107, -) - - -_BATCHOPERATIONMETADATA = _descriptor.Descriptor( - name="BatchOperationMetadata", - full_name="google.cloud.vision.v1p3beta1.BatchOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.vision.v1p3beta1.BatchOperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.vision.v1p3beta1.BatchOperationMetadata.submit_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.vision.v1p3beta1.BatchOperationMetadata.end_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BATCHOPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3110, - serialized_end=3396, -) - -_PRODUCT_KEYVALUE.containing_type = _PRODUCT -_PRODUCT.fields_by_name["product_labels"].message_type = _PRODUCT_KEYVALUE -_PRODUCTSET.fields_by_name[ - "index_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PRODUCTSET.fields_by_name[ - "index_error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_REFERENCEIMAGE.fields_by_name[ - "bounding_polys" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CREATEPRODUCTREQUEST.fields_by_name["product"].message_type = _PRODUCT -_LISTPRODUCTSRESPONSE.fields_by_name["products"].message_type = _PRODUCT -_UPDATEPRODUCTREQUEST.fields_by_name["product"].message_type = _PRODUCT -_UPDATEPRODUCTREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEPRODUCTSETREQUEST.fields_by_name["product_set"].message_type = _PRODUCTSET -_LISTPRODUCTSETSRESPONSE.fields_by_name["product_sets"].message_type = _PRODUCTSET -_UPDATEPRODUCTSETREQUEST.fields_by_name["product_set"].message_type = _PRODUCTSET -_UPDATEPRODUCTSETREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEREFERENCEIMAGEREQUEST.fields_by_name[ - "reference_image" -].message_type = _REFERENCEIMAGE -_LISTREFERENCEIMAGESRESPONSE.fields_by_name[ - "reference_images" -].message_type = _REFERENCEIMAGE -_LISTPRODUCTSINPRODUCTSETRESPONSE.fields_by_name["products"].message_type = _PRODUCT -_IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name[ - "gcs_source" -].message_type = _IMPORTPRODUCTSETSGCSSOURCE -_IMPORTPRODUCTSETSINPUTCONFIG.oneofs_by_name["source"].fields.append( - _IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name["gcs_source"] -) -_IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _IMPORTPRODUCTSETSINPUTCONFIG.oneofs_by_name["source"] -_IMPORTPRODUCTSETSREQUEST.fields_by_name[ - "input_config" -].message_type = _IMPORTPRODUCTSETSINPUTCONFIG -_IMPORTPRODUCTSETSRESPONSE.fields_by_name[ - "reference_images" -].message_type = _REFERENCEIMAGE -_IMPORTPRODUCTSETSRESPONSE.fields_by_name[ - "statuses" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_BATCHOPERATIONMETADATA.fields_by_name[ - "state" -].enum_type = _BATCHOPERATIONMETADATA_STATE -_BATCHOPERATIONMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA_STATE.containing_type = _BATCHOPERATIONMETADATA -DESCRIPTOR.message_types_by_name["Product"] = _PRODUCT -DESCRIPTOR.message_types_by_name["ProductSet"] = _PRODUCTSET -DESCRIPTOR.message_types_by_name["ReferenceImage"] = _REFERENCEIMAGE -DESCRIPTOR.message_types_by_name["CreateProductRequest"] = _CREATEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["ListProductsRequest"] = _LISTPRODUCTSREQUEST -DESCRIPTOR.message_types_by_name["ListProductsResponse"] = _LISTPRODUCTSRESPONSE -DESCRIPTOR.message_types_by_name["GetProductRequest"] = _GETPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["UpdateProductRequest"] = _UPDATEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["DeleteProductRequest"] = _DELETEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["CreateProductSetRequest"] = _CREATEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["ListProductSetsRequest"] = _LISTPRODUCTSETSREQUEST -DESCRIPTOR.message_types_by_name["ListProductSetsResponse"] = _LISTPRODUCTSETSRESPONSE -DESCRIPTOR.message_types_by_name["GetProductSetRequest"] = _GETPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["UpdateProductSetRequest"] = _UPDATEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["DeleteProductSetRequest"] = _DELETEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "CreateReferenceImageRequest" -] = _CREATEREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "ListReferenceImagesRequest" -] = _LISTREFERENCEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "ListReferenceImagesResponse" -] = _LISTREFERENCEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name["GetReferenceImageRequest"] = _GETREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "DeleteReferenceImageRequest" -] = _DELETEREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "AddProductToProductSetRequest" -] = _ADDPRODUCTTOPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "RemoveProductFromProductSetRequest" -] = _REMOVEPRODUCTFROMPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListProductsInProductSetRequest" -] = _LISTPRODUCTSINPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListProductsInProductSetResponse" -] = _LISTPRODUCTSINPRODUCTSETRESPONSE -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsGcsSource" -] = _IMPORTPRODUCTSETSGCSSOURCE -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsInputConfig" -] = _IMPORTPRODUCTSETSINPUTCONFIG -DESCRIPTOR.message_types_by_name["ImportProductSetsRequest"] = _IMPORTPRODUCTSETSREQUEST -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsResponse" -] = _IMPORTPRODUCTSETSRESPONSE -DESCRIPTOR.message_types_by_name["BatchOperationMetadata"] = _BATCHOPERATIONMETADATA -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Product = _reflection.GeneratedProtocolMessageType( - "Product", - (_message.Message,), - dict( - KeyValue=_reflection.GeneratedProtocolMessageType( - "KeyValue", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCT_KEYVALUE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""A product label represented as a key-value pair. - - - Attributes: - key: - The key of the label attached to the product. Cannot be empty - and cannot exceed 128 bytes. - value: - The value of the label attached to the product. Cannot be - empty and cannot exceed 128 bytes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Product.KeyValue) - ), - ), - DESCRIPTOR=_PRODUCT, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""A Product contains ReferenceImages. - - - Attributes: - name: - The resource name of the product. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - This field is ignored when creating a product. - display_name: - The user-provided name for this Product. Must not be empty. - Must be at most 4096 characters long. - description: - User-provided metadata to be stored with this product. Must be - at most 4096 characters long. - product_category: - The category for the product identified by the reference - image. This should be either "homegoods" or "apparel". This - field is immutable. - product_labels: - Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product\_labels. Note that integer values can be provided as - strings, e.g. "1199". Only strings with integer values can - match a range-based restriction which is to be supported soon. - Multiple values can be assigned to the same key. One product - may have up to 100 product\_labels. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Product) - ), -) -_sym_db.RegisterMessage(Product) -_sym_db.RegisterMessage(Product.KeyValue) - -ProductSet = _reflection.GeneratedProtocolMessageType( - "ProductSet", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSET, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""A ProductSet contains Products. A ProductSet can contain a - maximum of 1 million reference images. If the limit is exceeded, - periodic indexing will fail. - - - Attributes: - name: - The resource name of the ProductSet. Format is: ``projects/PR - OJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This - field is ignored when creating a ProductSet. - display_name: - The user-provided name for this ProductSet. Must not be empty. - Must be at most 4096 characters long. - index_time: - Output only. The time at which this ProductSet was last - indexed. Query results will reflect all updates before this - time. If this ProductSet has never been indexed, this field is - 0. This field is ignored when creating a ProductSet. - index_error: - Output only. If there was an error with indexing the product - set, the field is populated. This field is ignored when - creating a ProductSet. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ProductSet) - ), -) -_sym_db.RegisterMessage(ProductSet) - -ReferenceImage = _reflection.GeneratedProtocolMessageType( - "ReferenceImage", - (_message.Message,), - dict( - DESCRIPTOR=_REFERENCEIMAGE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. - - - Attributes: - name: - The resource name of the reference image. Format is: ``proje - cts/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceI - mages/IMAGE_ID``. This field is ignored when creating a - reference image. - uri: - The Google Cloud Storage URI of the reference image. The URI - must start with ``gs://``. Required. - bounding_polys: - Bounding polygons around the areas of interest in the - reference image. Optional. If this field is empty, the system - will try to detect regions of interest. At most 10 bounding - polygons will be used. The provided shape is converted into a - non-rotated rectangle. Once converted, the small edge of the - rectangle must be greater than or equal to 300 pixels. The - aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ReferenceImage) - ), -) -_sym_db.RegisterMessage(ReferenceImage) - -CreateProductRequest = _reflection.GeneratedProtocolMessageType( - "CreateProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateProduct`` method. - - - Attributes: - parent: - The project in which the Product should be created. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. - product: - The product to create. - product_id: - A user-supplied resource id for this Product. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY\_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateProductRequest) - ), -) -_sym_db.RegisterMessage(CreateProductRequest) - -ListProductsRequest = _reflection.GeneratedProtocolMessageType( - "ListProductsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProducts`` method. - - - Attributes: - parent: - The project OR ProductSet from which Products should be - listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsRequest) - ), -) -_sym_db.RegisterMessage(ListProductsRequest) - -ListProductsResponse = _reflection.GeneratedProtocolMessageType( - "ListProductsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProducts`` method. - - - Attributes: - products: - List of products. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsResponse) - ), -) -_sym_db.RegisterMessage(ListProductsResponse) - -GetProductRequest = _reflection.GeneratedProtocolMessageType( - "GetProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETPRODUCTREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetProduct`` method. - - - Attributes: - name: - Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetProductRequest) - ), -) -_sym_db.RegisterMessage(GetProductRequest) - -UpdateProductRequest = _reflection.GeneratedProtocolMessageType( - "UpdateProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``UpdateProduct`` method. - - - Attributes: - product: - The Product resource which replaces the one on the server. - product.name is immutable. - update_mask: - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update\_mask isn't specified, all - mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name`` and ``description``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.UpdateProductRequest) - ), -) -_sym_db.RegisterMessage(UpdateProductRequest) - -DeleteProductRequest = _reflection.GeneratedProtocolMessageType( - "DeleteProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteProduct`` method. - - - Attributes: - name: - Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteProductRequest) - ), -) -_sym_db.RegisterMessage(DeleteProductRequest) - -CreateProductSetRequest = _reflection.GeneratedProtocolMessageType( - "CreateProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateProductSet`` method. - - - Attributes: - parent: - The project in which the ProductSet should be created. Format - is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set: - The ProductSet to create. - product_set_id: - A user-supplied resource id for this ProductSet. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY\_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateProductSetRequest) - ), -) -_sym_db.RegisterMessage(CreateProductSetRequest) - -ListProductSetsRequest = _reflection.GeneratedProtocolMessageType( - "ListProductSetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSETSREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProductSets`` method. - - - Attributes: - parent: - The project from which ProductSets should be listed. Format - is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductSetsRequest) - ), -) -_sym_db.RegisterMessage(ListProductSetsRequest) - -ListProductSetsResponse = _reflection.GeneratedProtocolMessageType( - "ListProductSetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSETSRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProductSets`` method. - - - Attributes: - product_sets: - List of ProductSets. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductSetsResponse) - ), -) -_sym_db.RegisterMessage(ListProductSetsResponse) - -GetProductSetRequest = _reflection.GeneratedProtocolMessageType( - "GetProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetProductSet`` method. - - - Attributes: - name: - Resource name of the ProductSet to get. Format is: ``projects - /PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetProductSetRequest) - ), -) -_sym_db.RegisterMessage(GetProductSetRequest) - -UpdateProductSetRequest = _reflection.GeneratedProtocolMessageType( - "UpdateProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``UpdateProductSet`` method. - - - Attributes: - product_set: - The ProductSet resource which replaces the one on the server. - update_mask: - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update\_mask isn't specified, all - mutable fields are to be updated. Valid mask path is - ``display_name``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.UpdateProductSetRequest) - ), -) -_sym_db.RegisterMessage(UpdateProductSetRequest) - -DeleteProductSetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteProductSet`` method. - - - Attributes: - name: - Resource name of the ProductSet to delete. Format is: ``proje - cts/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteProductSetRequest) - ), -) -_sym_db.RegisterMessage(DeleteProductSetRequest) - -CreateReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "CreateReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateReferenceImage`` method. - - - Attributes: - parent: - Resource name of the product in which to create the reference - image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image: - The reference image to create. If an image ID is specified, it - is ignored. - reference_image_id: - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value as - the resource id. If it is already in use, an error is returned - with code ALREADY\_EXISTS. Must be at most 128 characters - long. It cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.CreateReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(CreateReferenceImageRequest) - -ListReferenceImagesRequest = _reflection.GeneratedProtocolMessageType( - "ListReferenceImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTREFERENCEIMAGESREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListReferenceImages`` method. - - - Attributes: - parent: - Resource name of the product containing the reference images. - Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - A token identifying a page of results to be returned. This is - the value of ``nextPageToken`` returned in a previous - reference image list request. Defaults to the first page if - not specified. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesRequest) - ), -) -_sym_db.RegisterMessage(ListReferenceImagesRequest) - -ListReferenceImagesResponse = _reflection.GeneratedProtocolMessageType( - "ListReferenceImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTREFERENCEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListReferenceImages`` method. - - - Attributes: - reference_images: - The list of reference images. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - next_page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListReferenceImagesResponse) - ), -) -_sym_db.RegisterMessage(ListReferenceImagesResponse) - -GetReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "GetReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetReferenceImage`` method. - - - Attributes: - name: - The resource name of the ReferenceImage to get. Format is: ` - `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/refe - renceImages/IMAGE_ID``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.GetReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(GetReferenceImageRequest) - -DeleteReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "DeleteReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteReferenceImage`` method. - - - Attributes: - name: - The resource name of the reference image to delete. Format - is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_I - D/referenceImages/IMAGE_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.DeleteReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(DeleteReferenceImageRequest) - -AddProductToProductSetRequest = _reflection.GeneratedProtocolMessageType( - "AddProductToProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ADDPRODUCTTOPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``AddProductToProductSet`` method. - - - Attributes: - name: - The resource name for the ProductSet to modify. Format is: `` - projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_I - D`` - product: - The resource name for the Product to be added to this - ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.AddProductToProductSetRequest) - ), -) -_sym_db.RegisterMessage(AddProductToProductSetRequest) - -RemoveProductFromProductSetRequest = _reflection.GeneratedProtocolMessageType( - "RemoveProductFromProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_REMOVEPRODUCTFROMPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``RemoveProductFromProductSet`` - method. - - - Attributes: - name: - The resource name for the ProductSet to modify. Format is: `` - projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_I - D`` - product: - The resource name for the Product to be removed from this - ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.RemoveProductFromProductSetRequest) - ), -) -_sym_db.RegisterMessage(RemoveProductFromProductSetRequest) - -ListProductsInProductSetRequest = _reflection.GeneratedProtocolMessageType( - "ListProductsInProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSINPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProductsInProductSet`` - method. - - - Attributes: - name: - The ProductSet resource for which to retrieve Products. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/ - PRODUCT_SET_ID`` - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetRequest) - ), -) -_sym_db.RegisterMessage(ListProductsInProductSetRequest) - -ListProductsInProductSetResponse = _reflection.GeneratedProtocolMessageType( - "ListProductsInProductSetResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSINPRODUCTSETRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProductsInProductSet`` - method. - - - Attributes: - products: - The list of Products. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ListProductsInProductSetResponse) - ), -) -_sym_db.RegisterMessage(ListProductsInProductSetResponse) - -ImportProductSetsGcsSource = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsGcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSGCSSOURCE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""The Google Cloud Storage location for a csv file which - preserves a list of ImportProductSetRequests in each line. - - - Attributes: - csv_file_uri: - The Google Cloud Storage URI of the input csv file. The URI - must start with gs:// The format of the input csv file should - be one image per line. In each line, there are 6 columns. 1. - image\_uri 2, image\_id 3. product\_set\_id 4. product\_id 5, - product\_category 6, product\_display\_name 7, labels 8. - bounding\_poly Columns 1, 3, 4, and 5 are required, other - columns are optional. A new ProductSet/Product with the same - id will be created on the fly if the ProductSet/Product - specified by product\_set\_id/product\_id does not exist. The - image\_id field is optional but has to be unique if provided. - If it is empty, we will automatically assign an unique id to - the image. The product\_display\_name field is optional. If - it is empty, a space (" ") is used as the place holder for the - product display\_name, which can be updated later through the - realtime API. If the Product with product\_id already exists, - the fields product\_display\_name, product\_category and - labels are ignored. If a Product doesn't exist and needs to - be created on the fly, the product\_display\_name field refers - to [Product.display\_name][google.cloud.vision.v1p3beta1.Produ - ct.display\_name], the product\_category field refers to [Prod - uct.product\_category][google.cloud.vision.v1p3beta1.Product.p - roduct\_category], and the labels field refers to - [Product.labels][]. Labels (optional) should be a line - containing a list of comma-separated key-value pairs, with the - format "key\_1=value\_1,key\_2=value\_2,...,key\_n=value\_n". - The bounding\_poly (optional) field is used to identify one - region of interest from the image in the same manner as - CreateReferenceImage. If no bounding\_poly is specified, the - system will try to detect regions of interest automatically. - Note that the pipeline will resize the image if the image - resolution is too large to process (above 20MP). Also note - that at most one bounding\_poly is allowed per line. If the - image contains multiple regions of interest, the csv should - contain one line per region of interest. The bounding\_poly - column should contain an even number of comma-separated - numbers, with the format - "p1\_x,p1\_y,p2\_x,p2\_y,...,pn\_x,pn\_y". Nonnegative - integers should be used for absolute bounding polygons, and - float values in [0, 1] should be used for normalized bounding - polygons. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsGcsSource) - ), -) -_sym_db.RegisterMessage(ImportProductSetsGcsSource) - -ImportProductSetsInputConfig = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSINPUTCONFIG, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""The input content for the ``ImportProductSets`` method. - - - Attributes: - source: - The source of the input. - gcs_source: - The Google Cloud Storage location for a csv file which - preserves a list of ImportProductSetRequests in each line. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsInputConfig) - ), -) -_sym_db.RegisterMessage(ImportProductSetsInputConfig) - -ImportProductSetsRequest = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSREQUEST, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ImportProductSets`` method. - - - Attributes: - parent: - The project in which the ProductSets should be imported. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - input_config: - The input content for the list of requests. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsRequest) - ), -) -_sym_db.RegisterMessage(ImportProductSetsRequest) - -ImportProductSetsResponse = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSRESPONSE, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ImportProductSets`` method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. - - - Attributes: - reference_images: - The list of reference\_images that are imported successfully. - statuses: - The rpc status for each ImportProductSet request, including - both successes and errors. The number of statuses here - matches the number of lines in the csv file, and statuses[i] - stores the success or failure status of processing the i-th - line of the csv, starting from line 0. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.ImportProductSetsResponse) - ), -) -_sym_db.RegisterMessage(ImportProductSetsResponse) - -BatchOperationMetadata = _reflection.GeneratedProtocolMessageType( - "BatchOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHOPERATIONMETADATA, - __module__="google.cloud.vision_v1p3beta1.proto.product_search_service_pb2", - __doc__="""Metadata for the batch operations such as the current - state. - - This is included in the ``metadata`` field of the ``Operation`` returned - by the ``GetOperation`` call of the ``google::longrunning::Operations`` - service. - - - Attributes: - state: - The current state of the batch operation. - submit_time: - The time when the batch request was submitted to the server. - end_time: - The time when the batch request is finished and [google.longru - nning.Operation.done][google.longrunning.Operation.done] is - set to true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.BatchOperationMetadata) - ), -) -_sym_db.RegisterMessage(BatchOperationMetadata) - - -DESCRIPTOR._options = None - -_PRODUCTSEARCH = _descriptor.ServiceDescriptor( - name="ProductSearch", - full_name="google.cloud.vision.v1p3beta1.ProductSearch", - file=DESCRIPTOR, - index=0, - serialized_options=None, - serialized_start=3399, - serialized_end=6886, - methods=[ - _descriptor.MethodDescriptor( - name="CreateProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.CreateProductSet", - index=0, - containing_service=None, - input_type=_CREATEPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - '\202\323\344\223\002E"6/v1p3beta1/{parent=projects/*/locations/*}/productSets:\013product_set' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductSets", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.ListProductSets", - index=1, - containing_service=None, - input_type=_LISTPRODUCTSETSREQUEST, - output_type=_LISTPRODUCTSETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0028\0226/v1p3beta1/{parent=projects/*/locations/*}/productSets" - ), - ), - _descriptor.MethodDescriptor( - name="GetProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.GetProductSet", - index=2, - containing_service=None, - input_type=_GETPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\0028\0226/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.UpdateProductSet", - index=3, - containing_service=None, - input_type=_UPDATEPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\002Q2B/v1p3beta1/{product_set.name=projects/*/locations/*/productSets/*}:\013product_set" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.DeleteProductSet", - index=4, - containing_service=None, - input_type=_DELETEPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0028*6/v1p3beta1/{name=projects/*/locations/*/productSets/*}" - ), - ), - _descriptor.MethodDescriptor( - name="CreateProduct", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.CreateProduct", - index=5, - containing_service=None, - input_type=_CREATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - '\202\323\344\223\002>"3/v1p3beta1/{parent=projects/*/locations/*}/products:\007product' - ), - ), - _descriptor.MethodDescriptor( - name="ListProducts", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.ListProducts", - index=6, - containing_service=None, - input_type=_LISTPRODUCTSREQUEST, - output_type=_LISTPRODUCTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1p3beta1/{parent=projects/*/locations/*}/products" - ), - ), - _descriptor.MethodDescriptor( - name="GetProduct", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.GetProduct", - index=7, - containing_service=None, - input_type=_GETPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1p3beta1/{name=projects/*/locations/*/products/*}" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProduct", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.UpdateProduct", - index=8, - containing_service=None, - input_type=_UPDATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\002F2;/v1p3beta1/{product.name=projects/*/locations/*/products/*}:\007product" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProduct", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.DeleteProduct", - index=9, - containing_service=None, - input_type=_DELETEPRODUCTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0025*3/v1p3beta1/{name=projects/*/locations/*/products/*}" - ), - ), - _descriptor.MethodDescriptor( - name="CreateReferenceImage", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.CreateReferenceImage", - index=10, - containing_service=None, - input_type=_CREATEREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - '\202\323\344\223\002X"E/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\017reference_image' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteReferenceImage", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.DeleteReferenceImage", - index=11, - containing_service=None, - input_type=_DELETEREFERENCEIMAGEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002G*E/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - ), - ), - _descriptor.MethodDescriptor( - name="ListReferenceImages", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.ListReferenceImages", - index=12, - containing_service=None, - input_type=_LISTREFERENCEIMAGESREQUEST, - output_type=_LISTREFERENCEIMAGESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1p3beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - ), - ), - _descriptor.MethodDescriptor( - name="GetReferenceImage", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.GetReferenceImage", - index=13, - containing_service=None, - input_type=_GETREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1p3beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - ), - ), - _descriptor.MethodDescriptor( - name="AddProductToProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.AddProductToProductSet", - index=14, - containing_service=None, - input_type=_ADDPRODUCTTOPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002F"A/v1p3beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="RemoveProductFromProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.RemoveProductFromProductSet", - index=15, - containing_service=None, - input_type=_REMOVEPRODUCTFROMPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002I"D/v1p3beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\001*' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductsInProductSet", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.ListProductsInProductSet", - index=16, - containing_service=None, - input_type=_LISTPRODUCTSINPRODUCTSETREQUEST, - output_type=_LISTPRODUCTSINPRODUCTSETRESPONSE, - serialized_options=_b( - "\202\323\344\223\002A\022?/v1p3beta1/{name=projects/*/locations/*/productSets/*}/products" - ), - ), - _descriptor.MethodDescriptor( - name="ImportProductSets", - full_name="google.cloud.vision.v1p3beta1.ProductSearch.ImportProductSets", - index=17, - containing_service=None, - input_type=_IMPORTPRODUCTSETSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002B"=/v1p3beta1/{parent=projects/*/locations/*}/productSets:import:\001*' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_PRODUCTSEARCH) - -DESCRIPTOR.services_by_name["ProductSearch"] = _PRODUCTSEARCH - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py deleted file mode 100644 index 95c62612d0b8..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py +++ /dev/null @@ -1,505 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p3beta1.proto import ( - product_search_service_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ProductSearchStub(object): - """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.v1p3beta1.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.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` - - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, - named - `projects/*/locations/*/products/*/referenceImages/*` - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/CreateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.ListProductSets = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/ListProductSets", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.FromString, - ) - self.GetProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/GetProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.UpdateProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/UpdateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.DeleteProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/DeleteProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateProduct = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/CreateProduct", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.ListProducts = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/ListProducts", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.FromString, - ) - self.GetProduct = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/GetProduct", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.UpdateProduct = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/UpdateProduct", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.DeleteProduct = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/DeleteProduct", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/CreateReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.DeleteReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/DeleteReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListReferenceImages = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/ListReferenceImages", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.FromString, - ) - self.GetReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/GetReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.AddProductToProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/AddProductToProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.RemoveProductFromProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/RemoveProductFromProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListProductsInProductSet = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/ListProductsInProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.FromString, - ) - self.ImportProductSets = channel.unary_unary( - "/google.cloud.vision.v1p3beta1.ProductSearch/ImportProductSets", - request_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ProductSearchServicer(object): - """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.v1p3beta1.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.v1p3beta1.Product] resources, named - `projects/*/locations/*/products/*` - - - Each [Product][google.cloud.vision.v1p3beta1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1p3beta1.ReferenceImage] resources, - named - `projects/*/locations/*/products/*/referenceImages/*` - """ - - def CreateProductSet(self, request, context): - """Creates and returns a new ProductSet resource. - - Possible errors: - - * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - 4096 characters. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductSets(self, request, context): - """Lists ProductSets in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProductSet(self, request, context): - """Gets information associated with a ProductSet. - - Possible errors: - - * Returns NOT_FOUND if the ProductSet does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProductSet(self, request, context): - """Permanently deletes a ProductSet. All Products and ReferenceImages in the - ProductSet will be deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Possible errors: - - * Returns NOT_FOUND if the ProductSet does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProducts(self, request, context): - """Lists products in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProduct(self, request, context): - """Gets information associated with a Product. - - Possible errors: - - * Returns NOT_FOUND if the Product does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProduct(self, request, context): - """Makes changes to a Product resource. - Only display_name, description and labels 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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProduct(self, request, context): - """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. - - Possible errors: - - * Returns NOT_FOUND if the product does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateReferenceImage(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteReferenceImage(self, request, context): - """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. - - Possible errors: - - * Returns NOT_FOUND if the reference image does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListReferenceImages(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetReferenceImage(self, request, context): - """Gets information associated with a ReferenceImage. - - Possible errors: - - * Returns NOT_FOUND if the specified image does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AddProductToProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RemoveProductFromProductSet(self, request, context): - """Removes a Product from the specified ProductSet. - - Possible errors: - - * Returns NOT_FOUND If the Product is not found under the ProductSet. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductsInProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportProductSets(self, request, context): - """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.v1p3beta1.ImportProductSetsGcsSource.csv_file_uri]. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ProductSearchServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.CreateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "ListProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ListProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.SerializeToString, - ), - "GetProductSet": grpc.unary_unary_rpc_method_handler( - servicer.GetProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "UpdateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "DeleteProductSet": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateProduct": grpc.unary_unary_rpc_method_handler( - servicer.CreateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "ListProducts": grpc.unary_unary_rpc_method_handler( - servicer.ListProducts, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.SerializeToString, - ), - "GetProduct": grpc.unary_unary_rpc_method_handler( - servicer.GetProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "UpdateProduct": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "DeleteProduct": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.CreateReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "DeleteReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.DeleteReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListReferenceImages": grpc.unary_unary_rpc_method_handler( - servicer.ListReferenceImages, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.SerializeToString, - ), - "GetReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.GetReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "AddProductToProductSet": grpc.unary_unary_rpc_method_handler( - servicer.AddProductToProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "RemoveProductFromProductSet": grpc.unary_unary_rpc_method_handler( - servicer.RemoveProductFromProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListProductsInProductSet": grpc.unary_unary_rpc_method_handler( - servicer.ListProductsInProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.SerializeToString, - ), - "ImportProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ImportProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p3beta1.ProductSearch", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation.proto b/vision/google/cloud/vision_v1p3beta1/proto/text_annotation.proto deleted file mode 100644 index 3c256c5773c9..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation.proto +++ /dev/null @@ -1,259 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p3beta1/geometry.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "TextAnnotationProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// TextAnnotation contains a structured representation of OCR extracted text. -// The hierarchy of an OCR extracted text structure is like this: -// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol -// Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please refer -// to the -// [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] -// message definition below for more detail. -message TextAnnotation { - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // Detected start or end of a structural component. - message DetectedBreak { - // Enum to denote the type of break found. New line, space etc. - enum BreakType { - // Unknown break label type. - UNKNOWN = 0; - - // Regular space. - SPACE = 1; - - // Sure space (very wide). - SURE_SPACE = 2; - - // Line-wrapping break. - EOL_SURE_SPACE = 3; - - // End-line hyphen that is not present in text; does not co-occur with - // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4; - - // Line break that ends a paragraph. - LINE_BREAK = 5; - } - - // Detected break type. - BreakType type = 1; - - // True if break prepends the element. - bool is_prefix = 2; - } - - // Additional information detected on the structural component. - message TextProperty { - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 1; - - // Detected start or end of a text segment. - DetectedBreak detected_break = 2; - } - - // List of pages detected by OCR. - repeated Page pages = 1; - - // UTF-8 text detected on the pages. - string text = 2; -} - -// Detected page from OCR. -message Page { - // Additional information detected on the page. - TextAnnotation.TextProperty property = 1; - - // Page width. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 width = 2; - - // Page height. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 height = 3; - - // List of blocks of text, images etc on this page. - repeated Block blocks = 4; - - // Confidence of the OCR results on the page. Range [0, 1]. - float confidence = 5; -} - -// Logical element on the page. -message Block { - // Type of a block (text, image etc) as identified by OCR. - enum BlockType { - // Unknown block type. - UNKNOWN = 0; - - // Regular text block. - TEXT = 1; - - // Table block. - TABLE = 2; - - // Image block. - PICTURE = 3; - - // Horizontal/vertical line box. - RULER = 4; - - // Barcode block. - BARCODE = 5; - } - - // Additional information detected for the block. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the block. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // - // * when the text is horizontal it might look like: - // - // 0----1 - // | | - // 3----2 - // - // * when it's rotated 180 degrees around the top-left corner it becomes: - // - // 2----3 - // | | - // 1----0 - // - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of paragraphs in this block (if this blocks is of type text). - repeated Paragraph paragraphs = 3; - - // Detected block type (text, image etc) for this block. - BlockType block_type = 4; - - // Confidence of the OCR results on the block. Range [0, 1]. - float confidence = 5; -} - -// Structural unit of text representing a number of words in certain order. -message Paragraph { - // Additional information detected for the paragraph. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the paragraph. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of words in this paragraph. - repeated Word words = 3; - - // Confidence of the OCR results for the paragraph. Range [0, 1]. - float confidence = 4; -} - -// A word representation. -message Word { - // Additional information detected for the word. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the word. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of symbols in the word. - // The order of the symbols follows the natural reading order. - repeated Symbol symbols = 3; - - // Confidence of the OCR results for the word. Range [0, 1]. - float confidence = 4; -} - -// A single symbol representation. -message Symbol { - // Additional information detected for the symbol. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the symbol. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertice order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // The actual UTF-8 representation of the symbol. - string text = 3; - - // Confidence of the OCR results for the symbol. Range [0, 1]. - float confidence = 4; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py deleted file mode 100644 index 380b73186fad..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py +++ /dev/null @@ -1,1139 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/text_annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p3beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/text_annotation.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\023TextAnnotationProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p3beta1/proto/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p3beta1/proto/geometry.proto"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p3beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p3beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p3beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p3beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p3beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p3beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x82\x01\n!com.google.cloud.vision.v1p3beta1B\x13TextAnnotationProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - ], -) - - -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE = _descriptor.EnumDescriptor( - name="BreakType", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.BreakType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPACE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SURE_SPACE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EOL_SURE_SPACE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LINE_BREAK", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=444, - serialized_end=543, -) -_sym_db.RegisterEnumDescriptor(_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE) - -_BLOCK_BLOCKTYPE = _descriptor.EnumDescriptor( - name="BlockType", - full_name="google.cloud.vision.v1p3beta1.Block.BlockType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PICTURE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RULER", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BARCODE", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1236, - serialized_end=1318, -) -_sym_db.RegisterEnumDescriptor(_BLOCK_BLOCKTYPE) - - -_TEXTANNOTATION_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=259, - serialized_end=320, -) - -_TEXTANNOTATION_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_prefix", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak.is_prefix", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=323, - serialized_end=543, -) - -_TEXTANNOTATION_TEXTPROPERTY = _descriptor.Descriptor( - name="TextProperty", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.detected_languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=546, - serialized_end=737, -) - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.pages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p3beta1.TextAnnotation.text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _TEXTANNOTATION_DETECTEDLANGUAGE, - _TEXTANNOTATION_DETECTEDBREAK, - _TEXTANNOTATION_TEXTPROPERTY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=175, - serialized_end=737, -) - - -_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.vision.v1p3beta1.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p3beta1.Page.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.vision.v1p3beta1.Page.width", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.vision.v1p3beta1.Page.height", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.vision.v1p3beta1.Page.blocks", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.Page.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=740, - serialized_end=929, -) - - -_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.vision.v1p3beta1.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p3beta1.Block.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p3beta1.Block.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.vision.v1p3beta1.Block.paragraphs", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="block_type", - full_name="google.cloud.vision.v1p3beta1.Block.block_type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.Block.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BLOCK_BLOCKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=932, - serialized_end=1318, -) - - -_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.vision.v1p3beta1.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p3beta1.Paragraph.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p3beta1.Paragraph.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.vision.v1p3beta1.Paragraph.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.Paragraph.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1321, - serialized_end=1549, -) - - -_WORD = _descriptor.Descriptor( - name="Word", - full_name="google.cloud.vision.v1p3beta1.Word", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p3beta1.Word.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p3beta1.Word.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="symbols", - full_name="google.cloud.vision.v1p3beta1.Word.symbols", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.Word.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1552, - serialized_end=1779, -) - - -_SYMBOL = _descriptor.Descriptor( - name="Symbol", - full_name="google.cloud.vision.v1p3beta1.Symbol", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p3beta1.Symbol.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p3beta1.Symbol.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p3beta1.Symbol.text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p3beta1.Symbol.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1782, - serialized_end=1969, -) - -_TEXTANNOTATION_DETECTEDLANGUAGE.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE -_TEXTANNOTATION_DETECTEDBREAK.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE.containing_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_languages" -].message_type = _TEXTANNOTATION_DETECTEDLANGUAGE -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_break" -].message_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.containing_type = _TEXTANNOTATION -_TEXTANNOTATION.fields_by_name["pages"].message_type = _PAGE -_PAGE.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PAGE.fields_by_name["blocks"].message_type = _BLOCK -_BLOCK.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_BLOCK.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_BLOCK.fields_by_name["paragraphs"].message_type = _PARAGRAPH -_BLOCK.fields_by_name["block_type"].enum_type = _BLOCK_BLOCKTYPE -_BLOCK_BLOCKTYPE.containing_type = _BLOCK -_PARAGRAPH.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PARAGRAPH.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PARAGRAPH.fields_by_name["words"].message_type = _WORD -_WORD.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_WORD.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_WORD.fields_by_name["symbols"].message_type = _SYMBOL -_SYMBOL.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_SYMBOL.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p3beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["Page"] = _PAGE -DESCRIPTOR.message_types_by_name["Block"] = _BLOCK -DESCRIPTOR.message_types_by_name["Paragraph"] = _PARAGRAPH -DESCRIPTOR.message_types_by_name["Word"] = _WORD -DESCRIPTOR.message_types_by_name["Symbol"] = _SYMBOL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DetectedLanguage=_reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDLANGUAGE, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Detected language for a structural component. - - - Attributes: - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedLanguage) - ), - ), - DetectedBreak=_reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDBREAK, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Detected start or end of a structural component. - - - Attributes: - type: - Detected break type. - is_prefix: - True if break prepends the element. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.DetectedBreak) - ), - ), - TextProperty=_reflection.GeneratedProtocolMessageType( - "TextProperty", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_TEXTPROPERTY, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Additional information detected on the structural - component. - - - Attributes: - detected_languages: - A list of detected languages together with confidence. - detected_break: - Detected start or end of a text segment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty) - ), - ), - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have their - own properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p3beta1.TextAnnotation.TextProperty] - message definition below for more detail. - - - Attributes: - pages: - List of pages detected by OCR. - text: - UTF-8 text detected on the pages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) -_sym_db.RegisterMessage(TextAnnotation.DetectedLanguage) -_sym_db.RegisterMessage(TextAnnotation.DetectedBreak) -_sym_db.RegisterMessage(TextAnnotation.TextProperty) - -Page = _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - DESCRIPTOR=_PAGE, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Detected page from OCR. - - - Attributes: - property: - Additional information detected on the page. - width: - Page width. For PDFs the unit is points. For images (including - TIFFs) the unit is pixels. - height: - Page height. For PDFs the unit is points. For images - (including TIFFs) the unit is pixels. - blocks: - List of blocks of text, images etc on this page. - confidence: - Confidence of the OCR results on the page. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Page) - ), -) -_sym_db.RegisterMessage(Page) - -Block = _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_BLOCK, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Logical element on the page. - - - Attributes: - property: - Additional information detected for the block. - bounding_box: - The bounding box for the block. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: :: - 0----1 | | 3----2 - when it's rotated 180 - degrees around the top-left corner it becomes: :: - 2----3 | | 1----0 and the vertice order will - still be (0, 1, 2, 3). - paragraphs: - List of paragraphs in this block (if this blocks is of type - text). - block_type: - Detected block type (text, image etc) for this block. - confidence: - Confidence of the OCR results on the block. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Block) - ), -) -_sym_db.RegisterMessage(Block) - -Paragraph = _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_PARAGRAPH, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""Structural unit of text representing a number of words in - certain order. - - - Attributes: - property: - Additional information detected for the paragraph. - bounding_box: - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. When - a rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - words: - List of words in this paragraph. - confidence: - Confidence of the OCR results for the paragraph. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Paragraph) - ), -) -_sym_db.RegisterMessage(Paragraph) - -Word = _reflection.GeneratedProtocolMessageType( - "Word", - (_message.Message,), - dict( - DESCRIPTOR=_WORD, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""A word representation. - - - Attributes: - property: - Additional information detected for the word. - bounding_box: - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - symbols: - List of symbols in the word. The order of the symbols follows - the natural reading order. - confidence: - Confidence of the OCR results for the word. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Word) - ), -) -_sym_db.RegisterMessage(Word) - -Symbol = _reflection.GeneratedProtocolMessageType( - "Symbol", - (_message.Message,), - dict( - DESCRIPTOR=_SYMBOL, - __module__="google.cloud.vision_v1p3beta1.proto.text_annotation_pb2", - __doc__="""A single symbol representation. - - - Attributes: - property: - Additional information detected for the symbol. - bounding_box: - The bounding box for the symbol. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertice order - will still be (0, 1, 2, 3). - text: - The actual UTF-8 representation of the symbol. - confidence: - Confidence of the OCR results for the symbol. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.Symbol) - ), -) -_sym_db.RegisterMessage(Symbol) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p3beta1/proto/web_detection.proto b/vision/google/cloud/vision_v1p3beta1/proto/web_detection.proto deleted file mode 100644 index cf9a22612a74..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/web_detection.proto +++ /dev/null @@ -1,104 +0,0 @@ -// Copyright 2018 Google Inc. -// -// 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 -// -// http://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. - -syntax = "proto3"; - -package google.cloud.vision.v1p3beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "WebDetectionProto"; -option java_package = "com.google.cloud.vision.v1p3beta1"; - -// Relevant information for the image from the Internet. -message WebDetection { - // Entity deduced from similar images on the Internet. - message WebEntity { - // Opaque entity ID. - string entity_id = 1; - - // Overall relevancy score for the entity. - // Not normalized and not comparable across different image queries. - float score = 2; - - // Canonical description of the entity, in English. - string description = 3; - } - - // Metadata for online images. - message WebImage { - // The result image URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the image. - float score = 2; - } - - // Metadata for web pages. - message WebPage { - // The result web page URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the web page. - float score = 2; - - // Title for the web page, may contain HTML markups. - string page_title = 3; - - // Fully matching images on the page. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 4; - - // Partial matching images on the page. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its - // crops. - repeated WebImage partial_matching_images = 5; - } - - // Label to provide extra metadata for the web detection. - message WebLabel { - // Label for extra metadata. - string label = 1; - - // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - // For more information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - } - - // Deduced entities from similar images on the Internet. - repeated WebEntity web_entities = 1; - - // Fully matching images from the Internet. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 2; - - // Partial matching images from the Internet. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its crops. - repeated WebImage partial_matching_images = 3; - - // Web pages containing the matching images from the Internet. - repeated WebPage pages_with_matching_images = 4; - - // The visually similar image results. - repeated WebImage visually_similar_images = 6; - - // Best guess text labels for the request image. - repeated WebLabel best_guess_labels = 8; -} diff --git a/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py b/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py deleted file mode 100644 index b5d3fbac95fd..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py +++ /dev/null @@ -1,616 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p3beta1/proto/web_detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p3beta1/proto/web_detection.proto", - package="google.cloud.vision.v1p3beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p3beta1B\021WebDetectionProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\370\001\001" - ), - serialized_pb=_b( - '\n7google/cloud/vision_v1p3beta1/proto/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p3beta1\x1a\x1cgoogle/api/annotations.proto"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p3beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p3beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p3beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB\x80\x01\n!com.google.cloud.vision.v1p3beta1B\x11WebDetectionProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p3beta1;vision\xf8\x01\x01\x62\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_WEBDETECTION_WEBENTITY = _descriptor.Descriptor( - name="WebEntity", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebEntity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebEntity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebEntity.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebEntity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=642, - serialized_end=708, -) - -_WEBDETECTION_WEBIMAGE = _descriptor.Descriptor( - name="WebImage", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebImage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebImage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=710, - serialized_end=748, -) - -_WEBDETECTION_WEBPAGE = _descriptor.Descriptor( - name="WebPage", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_title", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage.page_title", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage.full_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebPage.partial_matching_images", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=751, - serialized_end=979, -) - -_WEBDETECTION_WEBLABEL = _descriptor.Descriptor( - name="WebLabel", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebLabel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebLabel.label", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p3beta1.WebDetection.WebLabel.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1029, -) - -_WEBDETECTION = _descriptor.Descriptor( - name="WebDetection", - full_name="google.cloud.vision.v1p3beta1.WebDetection", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="web_entities", - full_name="google.cloud.vision.v1p3beta1.WebDetection.web_entities", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.full_matching_images", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.partial_matching_images", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages_with_matching_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.pages_with_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visually_similar_images", - full_name="google.cloud.vision.v1p3beta1.WebDetection.visually_similar_images", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="best_guess_labels", - full_name="google.cloud.vision.v1p3beta1.WebDetection.best_guess_labels", - index=5, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _WEBDETECTION_WEBENTITY, - _WEBDETECTION_WEBIMAGE, - _WEBDETECTION_WEBPAGE, - _WEBDETECTION_WEBLABEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=121, - serialized_end=1029, -) - -_WEBDETECTION_WEBENTITY.containing_type = _WEBDETECTION -_WEBDETECTION_WEBIMAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBPAGE.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBLABEL.containing_type = _WEBDETECTION -_WEBDETECTION.fields_by_name["web_entities"].message_type = _WEBDETECTION_WEBENTITY -_WEBDETECTION.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "pages_with_matching_images" -].message_type = _WEBDETECTION_WEBPAGE -_WEBDETECTION.fields_by_name[ - "visually_similar_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name["best_guess_labels"].message_type = _WEBDETECTION_WEBLABEL -DESCRIPTOR.message_types_by_name["WebDetection"] = _WEBDETECTION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -WebDetection = _reflection.GeneratedProtocolMessageType( - "WebDetection", - (_message.Message,), - dict( - WebEntity=_reflection.GeneratedProtocolMessageType( - "WebEntity", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBENTITY, - __module__="google.cloud.vision_v1p3beta1.proto.web_detection_pb2", - __doc__="""Entity deduced from similar images on the Internet. - - - Attributes: - entity_id: - Opaque entity ID. - score: - Overall relevancy score for the entity. Not normalized and not - comparable across different image queries. - description: - Canonical description of the entity, in English. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebEntity) - ), - ), - WebImage=_reflection.GeneratedProtocolMessageType( - "WebImage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBIMAGE, - __module__="google.cloud.vision_v1p3beta1.proto.web_detection_pb2", - __doc__="""Metadata for online images. - - - Attributes: - url: - The result image URL. - score: - (Deprecated) Overall relevancy score for the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebImage) - ), - ), - WebPage=_reflection.GeneratedProtocolMessageType( - "WebPage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBPAGE, - __module__="google.cloud.vision_v1p3beta1.proto.web_detection_pb2", - __doc__="""Metadata for web pages. - - - Attributes: - url: - The result web page URL. - score: - (Deprecated) Overall relevancy score for the web page. - page_title: - Title for the web page, may contain HTML markups. - full_matching_images: - Fully matching images on the page. Can include resized copies - of the query image. - partial_matching_images: - Partial matching images on the page. Those images are similar - enough to share some key-point features. For example an - original image will likely have partial matching for its - crops. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebPage) - ), - ), - WebLabel=_reflection.GeneratedProtocolMessageType( - "WebLabel", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBLABEL, - __module__="google.cloud.vision_v1p3beta1.proto.web_detection_pb2", - __doc__="""Label to provide extra metadata for the web detection. - - - Attributes: - label: - Label for extra metadata. - language_code: - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see http://www.unicode.org/re - ports/tr35/#Unicode\_locale\_identifier. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection.WebLabel) - ), - ), - DESCRIPTOR=_WEBDETECTION, - __module__="google.cloud.vision_v1p3beta1.proto.web_detection_pb2", - __doc__="""Relevant information for the image from the Internet. - - - Attributes: - web_entities: - Deduced entities from similar images on the Internet. - full_matching_images: - Fully matching images from the Internet. Can include resized - copies of the query image. - partial_matching_images: - Partial matching images from the Internet. Those images are - similar enough to share some key-point features. For example - an original image will likely have partial matching for its - crops. - pages_with_matching_images: - Web pages containing the matching images from the Internet. - visually_similar_images: - The visually similar image results. - best_guess_labels: - Best guess text labels for the request image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p3beta1.WebDetection) - ), -) -_sym_db.RegisterMessage(WebDetection) -_sym_db.RegisterMessage(WebDetection.WebEntity) -_sym_db.RegisterMessage(WebDetection.WebImage) -_sym_db.RegisterMessage(WebDetection.WebPage) -_sym_db.RegisterMessage(WebDetection.WebLabel) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py b/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p3beta1/types.py b/vision/google/cloud/vision_v1p3beta1/types.py deleted file mode 100644 index 9d146598d74a..000000000000 --- a/vision/google/cloud/vision_v1p3beta1/types.py +++ /dev/null @@ -1,74 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.vision_v1p3beta1.proto import geometry_pb2 -from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p3beta1.proto import product_search_pb2 -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p3beta1.proto import text_annotation_pb2 -from google.cloud.vision_v1p3beta1.proto import web_detection_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 -from google.type import latlng_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - color_pb2, - latlng_pb2, -] - -_local_modules = [ - geometry_pb2, - image_annotator_pb2, - product_search_pb2, - product_search_service_pb2, - text_annotation_pb2, - web_detection_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.vision_v1p3beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/vision/google/cloud/vision_v1p4beta1/__init__.py b/vision/google/cloud/vision_v1p4beta1/__init__.py deleted file mode 100644 index cedf170e4600..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import - -from google.cloud.vision_helpers.decorators import add_single_feature_methods -from google.cloud.vision_helpers import VisionHelpers -import sys -import warnings - -from google.cloud.vision_v1p4beta1 import types -from google.cloud.vision_v1p4beta1.gapic import enums -from google.cloud.vision_v1p4beta1.gapic import image_annotator_client as iac -from google.cloud.vision_v1p4beta1.gapic import product_search_client - - -if sys.version_info[:2] == (2, 7): - message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" - "can be found at https://cloud.google.com/python/docs/python2-sunset/" - ) - warnings.warn(message, DeprecationWarning) - - -class ProductSearchClient(product_search_client.ProductSearchClient): - __doc__ = product_search_client.ProductSearchClient.__doc__ - enums = enums - - -@add_single_feature_methods -class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient): - __doc__ = iac.ImageAnnotatorClient.__doc__ - enums = enums - - -__all__ = ("enums", "types", "ProductSearchClient", "ImageAnnotatorClient") diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/__init__.py b/vision/google/cloud/vision_v1p4beta1/gapic/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/enums.py b/vision/google/cloud/vision_v1p4beta1/gapic/enums.py deleted file mode 100644 index 80aa4fcee5f4..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/enums.py +++ /dev/null @@ -1,255 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Wrappers for protocol buffer enum types.""" - -import enum - - -class Likelihood(enum.IntEnum): - """ - A bucketized representation of likelihood, which is intended to give clients - highly stable results across model upgrades. - - Attributes: - UNKNOWN (int): Unknown likelihood. - VERY_UNLIKELY (int): It is very unlikely. - UNLIKELY (int): It is unlikely. - POSSIBLE (int): It is possible. - LIKELY (int): It is likely. - VERY_LIKELY (int): It is very likely. - """ - - UNKNOWN = 0 - VERY_UNLIKELY = 1 - UNLIKELY = 2 - POSSIBLE = 3 - LIKELY = 4 - VERY_LIKELY = 5 - - -class BatchOperationMetadata(object): - class State(enum.IntEnum): - """ - Enumerates the possible states that the batch request can be in. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - PROCESSING (int): Request is actively being processed. - SUCCESSFUL (int): The request is done and at least one item has been successfully - processed. - FAILED (int): The request is done and no item has been successfully processed. - CANCELLED (int): The request is done after the longrunning.Operations.CancelOperation has - been called by the user. Any records that were processed before the - cancel command are output as specified in the request. - """ - - STATE_UNSPECIFIED = 0 - PROCESSING = 1 - SUCCESSFUL = 2 - FAILED = 3 - CANCELLED = 4 - - -class Block(object): - class BlockType(enum.IntEnum): - """ - Type of a block (text, image etc) as identified by OCR. - - Attributes: - UNKNOWN (int): Unknown block type. - TEXT (int): Regular text block. - TABLE (int): Table block. - PICTURE (int): Image block. - RULER (int): Horizontal/vertical line box. - BARCODE (int): Barcode block. - """ - - UNKNOWN = 0 - TEXT = 1 - TABLE = 2 - PICTURE = 3 - RULER = 4 - BARCODE = 5 - - -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. - - Attributes: - UNKNOWN_LANDMARK (int): Unknown face landmark detected. Should not be filled. - LEFT_EYE (int): Left eye. - RIGHT_EYE (int): Right eye. - LEFT_OF_LEFT_EYEBROW (int): Left of left eyebrow. - RIGHT_OF_LEFT_EYEBROW (int): Right of left eyebrow. - LEFT_OF_RIGHT_EYEBROW (int): Left of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW (int): Right of right eyebrow. - MIDPOINT_BETWEEN_EYES (int): Midpoint between eyes. - NOSE_TIP (int): Nose tip. - UPPER_LIP (int): Upper lip. - LOWER_LIP (int): Lower lip. - MOUTH_LEFT (int): Mouth left. - MOUTH_RIGHT (int): Mouth right. - MOUTH_CENTER (int): Mouth center. - NOSE_BOTTOM_RIGHT (int): Nose, bottom right. - NOSE_BOTTOM_LEFT (int): Nose, bottom left. - NOSE_BOTTOM_CENTER (int): Nose, bottom center. - LEFT_EYE_TOP_BOUNDARY (int): Left eye, top boundary. - LEFT_EYE_RIGHT_CORNER (int): Left eye, right corner. - LEFT_EYE_BOTTOM_BOUNDARY (int): Left eye, bottom boundary. - LEFT_EYE_LEFT_CORNER (int): Left eye, left corner. - RIGHT_EYE_TOP_BOUNDARY (int): Right eye, top boundary. - RIGHT_EYE_RIGHT_CORNER (int): Right eye, right corner. - RIGHT_EYE_BOTTOM_BOUNDARY (int): Right eye, bottom boundary. - RIGHT_EYE_LEFT_CORNER (int): Right eye, left corner. - LEFT_EYEBROW_UPPER_MIDPOINT (int): Left eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT (int): Right eyebrow, upper midpoint. - LEFT_EAR_TRAGION (int): Left ear tragion. - RIGHT_EAR_TRAGION (int): Right ear tragion. - LEFT_EYE_PUPIL (int): Left eye pupil. - RIGHT_EYE_PUPIL (int): Right eye pupil. - FOREHEAD_GLABELLA (int): Forehead glabella. - CHIN_GNATHION (int): Chin gnathion. - CHIN_LEFT_GONION (int): Chin left gonion. - CHIN_RIGHT_GONION (int): Chin right gonion. - """ - - UNKNOWN_LANDMARK = 0 - LEFT_EYE = 1 - RIGHT_EYE = 2 - LEFT_OF_LEFT_EYEBROW = 3 - RIGHT_OF_LEFT_EYEBROW = 4 - LEFT_OF_RIGHT_EYEBROW = 5 - RIGHT_OF_RIGHT_EYEBROW = 6 - MIDPOINT_BETWEEN_EYES = 7 - NOSE_TIP = 8 - UPPER_LIP = 9 - LOWER_LIP = 10 - MOUTH_LEFT = 11 - MOUTH_RIGHT = 12 - MOUTH_CENTER = 13 - NOSE_BOTTOM_RIGHT = 14 - NOSE_BOTTOM_LEFT = 15 - NOSE_BOTTOM_CENTER = 16 - LEFT_EYE_TOP_BOUNDARY = 17 - LEFT_EYE_RIGHT_CORNER = 18 - LEFT_EYE_BOTTOM_BOUNDARY = 19 - LEFT_EYE_LEFT_CORNER = 20 - RIGHT_EYE_TOP_BOUNDARY = 21 - RIGHT_EYE_RIGHT_CORNER = 22 - RIGHT_EYE_BOTTOM_BOUNDARY = 23 - RIGHT_EYE_LEFT_CORNER = 24 - LEFT_EYEBROW_UPPER_MIDPOINT = 25 - RIGHT_EYEBROW_UPPER_MIDPOINT = 26 - LEFT_EAR_TRAGION = 27 - RIGHT_EAR_TRAGION = 28 - LEFT_EYE_PUPIL = 29 - RIGHT_EYE_PUPIL = 30 - FOREHEAD_GLABELLA = 31 - CHIN_GNATHION = 32 - CHIN_LEFT_GONION = 33 - 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): - """ - Batch operation states. - - Attributes: - STATE_UNSPECIFIED (int): Invalid. - CREATED (int): Request is received. - RUNNING (int): Request is actively being processed. - DONE (int): The batch processing is done. - CANCELLED (int): The batch processing was cancelled. - """ - - STATE_UNSPECIFIED = 0 - CREATED = 1 - 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 diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py b/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py deleted file mode 100644 index fade57ad8956..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py +++ /dev/null @@ -1,497 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1p4beta1 ImageAnnotator API.""" - -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import grpc - -from google.cloud.vision_v1p4beta1.gapic import enums -from google.cloud.vision_v1p4beta1.gapic import image_annotator_client_config -from google.cloud.vision_v1p4beta1.gapic.transports import ( - image_annotator_grpc_transport, -) -from google.cloud.vision_v1p4beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p4beta1.proto import image_annotator_pb2_grpc -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ImageAnnotatorClient(object): - """ - 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. - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1p4beta1.ImageAnnotator" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ImageAnnotatorClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ImageAnnotatorGrpcTransport, - Callable[[~.Credentials, type], ~.ImageAnnotatorGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = image_annotator_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=image_annotator_grpc_transport.ImageAnnotatorGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = image_annotator_grpc_transport.ImageAnnotatorGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def batch_annotate_images( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Run image detection and annotation for a batch of images. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_images(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p4beta1.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_v1p4beta1.types.AnnotateImageRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.BatchAnnotateImagesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_images, - default_retry=self._method_configs["BatchAnnotateImages"].retry, - default_timeout=self._method_configs["BatchAnnotateImages"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateImagesRequest(requests=requests) - return self._inner_api_calls["batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def batch_annotate_files( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.batch_annotate_files(requests) - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p4beta1.types.AnnotateFileRequest]]): Required. The list of file annotation requests. Right now we support only - one AnnotateFileRequest in BatchAnnotateFilesRequest. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.AnnotateFileRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.BatchAnnotateFilesResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.batch_annotate_files, - default_retry=self._method_configs["BatchAnnotateFiles"].retry, - default_timeout=self._method_configs["BatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.BatchAnnotateFilesRequest(requests=requests) - return self._inner_api_calls["batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def async_batch_annotate_images( - self, - requests, - output_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> # TODO: Initialize `output_config`: - >>> output_config = {} - >>> - >>> response = client.async_batch_annotate_images(requests, output_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p4beta1.types.AnnotateImageRequest]]): Required. 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_v1p4beta1.types.AnnotateImageRequest` - output_config (Union[dict, ~google.cloud.vision_v1p4beta1.types.OutputConfig]): Required. The desired output location and metadata (e.g. format). - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.OutputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_images" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_images, - default_retry=self._method_configs["AsyncBatchAnnotateImages"].retry, - default_timeout=self._method_configs[ - "AsyncBatchAnnotateImages" - ].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateImagesRequest( - requests=requests, output_config=output_config - ) - operation = self._inner_api_calls["async_batch_annotate_images"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateImagesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) - - def async_batch_annotate_files( - self, - requests, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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). - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ImageAnnotatorClient() - >>> - >>> # TODO: Initialize `requests`: - >>> requests = [] - >>> - >>> response = client.async_batch_annotate_files(requests) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - requests (list[Union[dict, ~google.cloud.vision_v1p4beta1.types.AsyncAnnotateFileRequest]]): Required. 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_v1p4beta1.types.AsyncAnnotateFileRequest` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "async_batch_annotate_files" not in self._inner_api_calls: - self._inner_api_calls[ - "async_batch_annotate_files" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.async_batch_annotate_files, - default_retry=self._method_configs["AsyncBatchAnnotateFiles"].retry, - default_timeout=self._method_configs["AsyncBatchAnnotateFiles"].timeout, - client_info=self._client_info, - ) - - request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest(requests=requests) - operation = self._inner_api_calls["async_batch_annotate_files"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - image_annotator_pb2.AsyncBatchAnnotateFilesResponse, - metadata_type=image_annotator_pb2.OperationMetadata, - ) diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py b/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py deleted file mode 100644 index 18493e802ad2..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py +++ /dev/null @@ -1,43 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p4beta1.ImageAnnotator": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "BatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "BatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateImages": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "AsyncBatchAnnotateFiles": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client.py b/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client.py deleted file mode 100644 index 2c3dae60dd63..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client.py +++ /dev/null @@ -1,2026 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Accesses the google.cloud.vision.v1p4beta1 ProductSearch API.""" - -import functools -import pkg_resources -import warnings - -from google.oauth2 import service_account -import google.api_core.client_options -import google.api_core.gapic_v1.client_info -import google.api_core.gapic_v1.config -import google.api_core.gapic_v1.method -import google.api_core.gapic_v1.routing_header -import google.api_core.grpc_helpers -import google.api_core.operation -from google.api_core import operations_v1 -import google.api_core.page_iterator -import google.api_core.path_template -import google.api_core.protobuf_helpers -import grpc - -from google.cloud.vision_v1p4beta1.gapic import enums -from google.cloud.vision_v1p4beta1.gapic import product_search_client_config -from google.cloud.vision_v1p4beta1.gapic.transports import product_search_grpc_transport -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2_grpc -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-vision").version - - -class ProductSearchClient(object): - """ - 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`` 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`` resources, named - ``projects/*/locations/*/products/*`` - - - Each ``Product`` has a collection of ``ReferenceImage`` resources, - named ``projects/*/locations/*/products/*/referenceImages/*`` - """ - - SERVICE_ADDRESS = "vision.googleapis.com:443" - """The default address of the service.""" - - # The name of the interface for this client. This is the key used to - # find the method configuration in the client_config dictionary. - _INTERFACE_NAME = "google.cloud.vision.v1p4beta1.ProductSearch" - - @classmethod - def from_service_account_file(cls, filename, *args, **kwargs): - """Creates an instance of this client using the provided credentials - file. - - Args: - filename (str): The path to the service account private key json - file. - args: Additional arguments to pass to the constructor. - kwargs: Additional arguments to pass to the constructor. - - Returns: - ProductSearchClient: The constructed client. - """ - credentials = service_account.Credentials.from_service_account_file(filename) - kwargs["credentials"] = credentials - return cls(*args, **kwargs) - - from_service_account_json = from_service_account_file - - @classmethod - def location_path(cls, project, location): - """Return a fully-qualified location string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}", - project=project, - location=location, - ) - - @classmethod - def product_path(cls, project, location, product): - """Return a fully-qualified product string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}", - project=project, - location=location, - product=product, - ) - - @classmethod - def product_set_path(cls, project, location, product_set): - """Return a fully-qualified product_set string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/productSets/{product_set}", - project=project, - location=location, - product_set=product_set, - ) - - @classmethod - def reference_image_path(cls, project, location, product, reference_image): - """Return a fully-qualified reference_image string.""" - return google.api_core.path_template.expand( - "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}", - project=project, - location=location, - product=product, - reference_image=reference_image, - ) - - def __init__( - self, - transport=None, - channel=None, - credentials=None, - client_config=None, - client_info=None, - client_options=None, - ): - """Constructor. - - Args: - transport (Union[~.ProductSearchGrpcTransport, - Callable[[~.Credentials, type], ~.ProductSearchGrpcTransport]): A transport - instance, responsible for actually making the API calls. - The default transport uses the gRPC protocol. - This argument may also be a callable which returns a - transport instance. Callables will be sent the credentials - as the first argument and the default transport class as - the second argument. - channel (grpc.Channel): DEPRECATED. A ``Channel`` instance - through which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - This argument is mutually exclusive with providing a - transport instance to ``transport``; doing so will raise - an exception. - client_config (dict): DEPRECATED. A dictionary of call options for - each method. If not specified, the default configuration is used. - client_info (google.api_core.gapic_v1.client_info.ClientInfo): - The client info used to send a user-agent string along with - API requests. If ``None``, then default info will be used. - Generally, you only need to set this if you're developing - your own client library. - client_options (Union[dict, google.api_core.client_options.ClientOptions]): - Client options used to set user options on the client. API Endpoint - should be set through client_options. - """ - # Raise deprecation warnings for things we want to go away. - if client_config is not None: - warnings.warn( - "The `client_config` argument is deprecated.", - PendingDeprecationWarning, - stacklevel=2, - ) - else: - client_config = product_search_client_config.config - - if channel: - warnings.warn( - "The `channel` argument is deprecated; use " "`transport` instead.", - PendingDeprecationWarning, - stacklevel=2, - ) - - api_endpoint = self.SERVICE_ADDRESS - if client_options: - if type(client_options) == dict: - client_options = google.api_core.client_options.from_dict( - client_options - ) - if client_options.api_endpoint: - api_endpoint = client_options.api_endpoint - - # Instantiate the transport. - # The transport is responsible for handling serialization and - # deserialization and actually sending data to the service. - if transport: - if callable(transport): - self.transport = transport( - credentials=credentials, - default_class=product_search_grpc_transport.ProductSearchGrpcTransport, - address=api_endpoint, - ) - else: - if credentials: - raise ValueError( - "Received both a transport instance and " - "credentials; these are mutually exclusive." - ) - self.transport = transport - else: - self.transport = product_search_grpc_transport.ProductSearchGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials - ) - - if client_info is None: - 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 - # from the client configuration. - # (Ordinarily, these are the defaults specified in the `*_config.py` - # file next to this one.) - self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] - ) - - # Save a dictionary of cached API call functions. - # These are the actual callables which invoke the proper - # transport methods, wrapped with `wrap_method` to add retry, - # timeout, and the like. - self._inner_api_calls = {} - - # Service calls - def create_product_set( - self, - parent, - product_set, - product_set_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> # TODO: Initialize `product_set_id`: - >>> product_set_id = '' - >>> - >>> response = client.create_product_set(parent, product_set, product_set_id) - - Args: - parent (str): Required. The project in which the ProductSet should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set (Union[dict, ~google.cloud.vision_v1p4beta1.types.ProductSet]): Required. The ProductSet to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` - product_set_id (str): A user-supplied resource id for this ProductSet. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product_set, - default_retry=self._method_configs["CreateProductSet"].retry, - default_timeout=self._method_configs["CreateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_product_sets( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_product_sets(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_product_sets(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The project from which ProductSets should be listed. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "list_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_product_sets, - default_retry=self._method_configs["ListProductSets"].retry, - default_timeout=self._method_configs["ListProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductSetsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_product_sets"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="product_sets", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> response = client.get_product_set(name) - - Args: - name (str): Required. Resource name of the ProductSet to get. - - Format is: - ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product_set, - default_retry=self._method_configs["GetProductSet"].retry, - default_timeout=self._method_configs["GetProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product_set( - self, - product_set, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product_set`: - >>> product_set = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_product_set(product_set, update_mask) - - Args: - product_set (Union[dict, ~google.cloud.vision_v1p4beta1.types.ProductSet]): Required. The ProductSet resource which replaces the one on the server. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` - update_mask (Union[dict, ~google.cloud.vision_v1p4beta1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask path - is ``display_name``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.ProductSet` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product_set, - default_retry=self._method_configs["UpdateProductSet"].retry, - default_timeout=self._method_configs["UpdateProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product_set.name", product_set.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product_set( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> client.delete_product_set(name) - - Args: - name (str): Required. Resource name of the ProductSet to delete. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product_set, - default_retry=self._method_configs["DeleteProductSet"].retry, - default_timeout=self._method_configs["DeleteProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductSetRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_product( - self, - parent, - product, - product_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> # TODO: Initialize `product_id`: - >>> product_id = '' - >>> - >>> response = client.create_product(parent, product, product_id) - - Args: - parent (str): Required. The project in which the Product should be created. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product (Union[dict, ~google.cloud.vision_v1p4beta1.types.Product]): Required. The product to create. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.Product` - product_id (str): A user-supplied resource id for this Product. If set, the server will - attempt to use this value as the resource id. If it is already in use, - an error is returned with code ALREADY\_EXISTS. Must be at most 128 - characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_product" not in self._inner_api_calls: - self._inner_api_calls[ - "create_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_product, - default_retry=self._method_configs["CreateProduct"].retry, - default_timeout=self._method_configs["CreateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. The project OR ProductSet from which Products should be - listed. - - Format: ``projects/PROJECT_ID/locations/LOC_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p4beta1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products, - default_retry=self._method_configs["ListProducts"].retry, - default_timeout=self._method_configs["ListProducts"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> response = client.get_product(name) - - Args: - name (str): Required. Resource name of the Product to get. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_product" not in self._inner_api_calls: - self._inner_api_calls[ - "get_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_product, - default_retry=self._method_configs["GetProduct"].retry, - default_timeout=self._method_configs["GetProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def update_product( - self, - product, - update_mask, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> # TODO: Initialize `product`: - >>> product = {} - >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_product(product, update_mask) - - Args: - product (Union[dict, ~google.cloud.vision_v1p4beta1.types.Product]): Required. The Product resource which replaces the one on the server. - product.name is immutable. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.Product` - update_mask (Union[dict, ~google.cloud.vision_v1p4beta1.types.FieldMask]): The ``FieldMask`` that specifies which fields to update. If update\_mask - isn't specified, all mutable fields are to be updated. Valid mask paths - include ``product_labels``, ``display_name``, and ``description``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.FieldMask` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.Product` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "update_product" not in self._inner_api_calls: - self._inner_api_calls[ - "update_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_product, - default_retry=self._method_configs["UpdateProduct"].retry, - default_timeout=self._method_configs["UpdateProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("product.name", product.name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["update_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_product( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> client.delete_product(name) - - Args: - name (str): Required. Resource name of product to delete. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_product" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_product" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_product, - default_retry=self._method_configs["DeleteProduct"].retry, - default_timeout=self._method_configs["DeleteProduct"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteProductRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_product"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def create_reference_image( - self, - parent, - reference_image, - reference_image_id, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # TODO: Initialize `reference_image`: - >>> reference_image = {} - >>> - >>> # TODO: Initialize `reference_image_id`: - >>> reference_image_id = '' - >>> - >>> response = client.create_reference_image(parent, reference_image, reference_image_id) - - Args: - parent (str): Required. Resource name of the product in which to create the reference - image. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image (Union[dict, ~google.cloud.vision_v1p4beta1.types.ReferenceImage]): Required. The reference image to create. - If an image ID is specified, it is ignored. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.ReferenceImage` - reference_image_id (str): A user-supplied resource id for the ReferenceImage to be added. If set, - the server will attempt to use this value as the resource id. If it is - already in use, an error is returned with code ALREADY\_EXISTS. Must be - at most 128 characters long. It cannot contain the character ``/``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "create_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "create_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_reference_image, - default_retry=self._method_configs["CreateReferenceImage"].retry, - default_timeout=self._method_configs["CreateReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["create_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def delete_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> client.delete_reference_image(name) - - Args: - name (str): Required. The resource name of the reference image to delete. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_reference_image, - default_retry=self._method_configs["DeleteReferenceImage"].retry, - default_timeout=self._method_configs["DeleteReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.DeleteReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_reference_images( - self, - parent, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.product_path('[PROJECT]', '[LOCATION]', '[PRODUCT]') - >>> - >>> # Iterate over all results - >>> for element in client.list_reference_images(parent): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_reference_images(parent).pages: - ... for element in page: - ... # process element - ... pass - - Args: - parent (str): Required. Resource name of the product containing the reference images. - - Format is ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p4beta1.types.ReferenceImage` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_reference_images" not in self._inner_api_calls: - self._inner_api_calls[ - "list_reference_images" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_reference_images, - default_retry=self._method_configs["ListReferenceImages"].retry, - default_timeout=self._method_configs["ListReferenceImages"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_reference_images"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="reference_images", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def get_reference_image( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.reference_image_path('[PROJECT]', '[LOCATION]', '[PRODUCT]', '[REFERENCE_IMAGE]') - >>> - >>> response = client.get_reference_image(name) - - Args: - name (str): Required. The resource name of the ReferenceImage to get. - - Format is: - - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.ReferenceImage` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "get_reference_image" not in self._inner_api_calls: - self._inner_api_calls[ - "get_reference_image" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_reference_image, - default_retry=self._method_configs["GetReferenceImage"].retry, - default_timeout=self._method_configs["GetReferenceImage"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.GetReferenceImageRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["get_reference_image"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def add_product_to_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # TODO: Initialize `product`: - >>> product = '' - >>> - >>> client.add_product_to_product_set(name, product) - - Args: - name (str): Required. The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): Required. The resource name for the Product to be added to this - ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "add_product_to_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "add_product_to_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.add_product_to_product_set, - default_retry=self._method_configs["AddProductToProductSet"].retry, - default_timeout=self._method_configs["AddProductToProductSet"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["add_product_to_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def remove_product_from_product_set( - self, - name, - product, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Removes a Product from the specified ProductSet. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # TODO: Initialize `product`: - >>> product = '' - >>> - >>> client.remove_product_from_product_set(name, product) - - Args: - name (str): Required. The resource name for the ProductSet to modify. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - product (str): Required. The resource name for the Product to be removed from this - ProductSet. - - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "remove_product_from_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "remove_product_from_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.remove_product_from_product_set, - default_retry=self._method_configs["RemoveProductFromProductSet"].retry, - default_timeout=self._method_configs[ - "RemoveProductFromProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["remove_product_from_product_set"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - - def list_products_in_product_set( - self, - name, - page_size=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> name = client.product_set_path('[PROJECT]', '[LOCATION]', '[PRODUCT_SET]') - >>> - >>> # Iterate over all results - >>> for element in client.list_products_in_product_set(name): - ... # process element - ... pass - >>> - >>> - >>> # Alternatively: - >>> - >>> # Iterate over results one page at a time - >>> for page in client.list_products_in_product_set(name).pages: - ... for element in page: - ... # process element - ... pass - - Args: - name (str): Required. The ProductSet resource for which to retrieve Products. - - Format is: - ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`` - page_size (int): The maximum number of resources contained in the - underlying API response. If page streaming is performed per- - resource, this parameter does not affect the return value. If page - streaming is performed per-page, this determines the maximum number - of resources in a page. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.api_core.page_iterator.PageIterator` instance. - An iterable of :class:`~google.cloud.vision_v1p4beta1.types.Product` instances. - You can also iterate over the pages of the response - using its `pages` property. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "list_products_in_product_set" not in self._inner_api_calls: - self._inner_api_calls[ - "list_products_in_product_set" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.list_products_in_product_set, - default_retry=self._method_configs["ListProductsInProductSet"].retry, - default_timeout=self._method_configs[ - "ListProductsInProductSet" - ].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name, page_size=page_size - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - iterator = google.api_core.page_iterator.GRPCIterator( - client=None, - method=functools.partial( - self._inner_api_calls["list_products_in_product_set"], - retry=retry, - timeout=timeout, - metadata=metadata, - ), - request=request, - items_field="products", - request_token_field="page_token", - response_token_field="next_page_token", - ) - return iterator - - def import_product_sets( - self, - parent, - input_config, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Asynchronous API that imports a list of reference images to specified - product sets based on a list of image information. - - The ``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``. - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') - >>> - >>> # TODO: Initialize `input_config`: - >>> input_config = {} - >>> - >>> response = client.import_product_sets(parent, input_config) - >>> - >>> def callback(operation_future): - ... # Handle result. - ... result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - parent (str): Required. The project in which the ProductSets should be imported. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - input_config (Union[dict, ~google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig]): Required. The input content for the list of requests. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.ImportProductSetsInputConfig` - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types._OperationFuture` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "import_product_sets" not in self._inner_api_calls: - self._inner_api_calls[ - "import_product_sets" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.import_product_sets, - default_retry=self._method_configs["ImportProductSets"].retry, - default_timeout=self._method_configs["ImportProductSets"].timeout, - client_info=self._client_info, - ) - - request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - operation = self._inner_api_calls["import_product_sets"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - return google.api_core.operation.from_gapic( - operation, - self.transport._operations_client, - product_search_service_pb2.ImportProductSetsResponse, - metadata_type=product_search_service_pb2.BatchOperationMetadata, - ) - - def purge_products( - self, - product_set_purge_config=None, - delete_orphan_products=None, - parent=None, - force=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - 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`` API can be used to keep track of - the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - - Example: - >>> from google.cloud import vision_v1p4beta1 - >>> - >>> client = vision_v1p4beta1.ProductSearchClient() - >>> - >>> response = client.purge_products() - - Args: - product_set_purge_config (Union[dict, ~google.cloud.vision_v1p4beta1.types.ProductSetPurgeConfig]): Specify which ProductSet contains the Products to be deleted. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.vision_v1p4beta1.types.ProductSetPurgeConfig` - delete_orphan_products (bool): If delete\_orphan\_products is true, all Products that are not in any - ProductSet will be deleted. - parent (str): Required. The project and location in which the Products should be - deleted. - - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - force (bool): The default value is false. Override this value to true to actually perform - the purge. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.vision_v1p4beta1.types.Operation` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "purge_products" not in self._inner_api_calls: - self._inner_api_calls[ - "purge_products" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.purge_products, - default_retry=self._method_configs["PurgeProducts"].retry, - default_timeout=self._method_configs["PurgeProducts"].timeout, - client_info=self._client_info, - ) - - # Sanity check: We have some fields which are mutually exclusive; - # raise ValueError if more than one is sent. - google.api_core.protobuf_helpers.check_oneof( - product_set_purge_config=product_set_purge_config, - delete_orphan_products=delete_orphan_products, - ) - - request = product_search_service_pb2.PurgeProductsRequest( - product_set_purge_config=product_set_purge_config, - delete_orphan_products=delete_orphan_products, - parent=parent, - force=force, - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("parent", parent)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["purge_products"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py b/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py deleted file mode 100644 index 8b8f4f67c4f1..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py +++ /dev/null @@ -1,118 +0,0 @@ -config = { - "interfaces": { - "google.cloud.vision.v1p4beta1.ProductSearch": { - "retry_codes": { - "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], - "non_idempotent": [], - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 20000, - "rpc_timeout_multiplier": 1.0, - "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } - }, - "methods": { - "CreateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProducts": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "UpdateProduct": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteProduct": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "CreateReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "DeleteReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ListReferenceImages": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "GetReferenceImage": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "AddProductToProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "RemoveProductFromProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "ListProductsInProductSet": { - "timeout_millis": 60000, - "retry_codes_name": "idempotent", - "retry_params_name": "default", - }, - "ImportProductSets": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - "PurgeProducts": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, - }, - } - } -} diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/transports/__init__.py b/vision/google/cloud/vision_v1p4beta1/gapic/transports/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py b/vision/google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py deleted file mode 100644 index 35eea305f954..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py +++ /dev/null @@ -1,191 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1p4beta1.proto import image_annotator_pb2_grpc - - -class ImageAnnotatorGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p4beta1 ImageAnnotator API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "image_annotator_stub": image_annotator_pb2_grpc.ImageAnnotatorStub(channel) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_images`. - - Run image detection and annotation for a batch of images. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateImages - - @property - def batch_annotate_files(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.batch_annotate_files`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].BatchAnnotateFiles - - @property - def async_batch_annotate_images(self): - """Return the gRPC stub for :meth:`ImageAnnotatorClient.async_batch_annotate_images`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateImages - - @property - def async_batch_annotate_files(self): - """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 - 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). - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["image_annotator_stub"].AsyncBatchAnnotateFiles diff --git a/vision/google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py b/vision/google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py deleted file mode 100644 index 00bf1156b7a6..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py +++ /dev/null @@ -1,510 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -import google.api_core.grpc_helpers -from google.api_core import operations_v1 - -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2_grpc - - -class ProductSearchGrpcTransport(object): - """gRPC transport class providing stubs for - google.cloud.vision.v1p4beta1 ProductSearch API. - - The transport provides access to the raw gRPC stubs, - which can be used to take advantage of advanced - features of gRPC. - """ - - # The scopes needed to make gRPC calls to all of the methods defined - # in this service. - _OAUTH_SCOPES = ( - "https://www.googleapis.com/auth/cloud-platform", - "https://www.googleapis.com/auth/cloud-vision", - ) - - def __init__( - self, channel=None, credentials=None, address="vision.googleapis.com:443" - ): - """Instantiate the transport class. - - Args: - channel (grpc.Channel): A ``Channel`` instance through - which to make calls. This argument is mutually exclusive - with ``credentials``; providing both will raise an exception. - credentials (google.auth.credentials.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If none - are specified, the client will attempt to ascertain the - credentials from the environment. - address (str): The address where the service is hosted. - """ - # If both `channel` and `credentials` are specified, raise an - # exception (channels come with credentials baked in already). - if channel is not None and credentials is not None: - raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." - ) - - # Create the channel. - if channel is None: - channel = self.create_channel( - address=address, - credentials=credentials, - options={ - "grpc.max_send_message_length": -1, - "grpc.max_receive_message_length": -1, - }.items(), - ) - - self._channel = channel - - # gRPC uses objects called "stubs" that are bound to the - # channel and provide a basic method for each RPC. - self._stubs = { - "product_search_stub": product_search_service_pb2_grpc.ProductSearchStub( - channel - ) - } - - # Because this API includes a method that returns a - # long-running operation (proto: google.longrunning.Operation), - # instantiate an LRO client. - self._operations_client = google.api_core.operations_v1.OperationsClient( - channel - ) - - @classmethod - def create_channel( - cls, address="vision.googleapis.com:443", credentials=None, **kwargs - ): - """Create and return a gRPC channel object. - - Args: - address (str): The host for the channel to use. - credentials (~.Credentials): The - authorization credentials to attach to requests. These - credentials identify this application to the service. If - none are specified, the client will attempt to ascertain - the credentials from the environment. - kwargs (dict): Keyword arguments, which are passed to the - channel creation. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return google.api_core.grpc_helpers.create_channel( - address, credentials=credentials, scopes=cls._OAUTH_SCOPES, **kwargs - ) - - @property - def channel(self): - """The gRPC channel used by the transport. - - Returns: - grpc.Channel: A gRPC channel object. - """ - return self._channel - - @property - def create_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product_set`. - - Creates and returns a new ProductSet resource. - - Possible errors: - - - Returns INVALID\_ARGUMENT if display\_name is missing, or is longer - than 4096 characters. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProductSet - - @property - def list_product_sets(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_product_sets`. - - Lists ProductSets in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100, or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductSets - - @property - def get_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product_set`. - - Gets information associated with a ProductSet. - - Possible errors: - - - Returns NOT\_FOUND if the ProductSet does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProductSet - - @property - def update_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.update_product_set`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProductSet - - @property - def delete_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product_set`. - - Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProductSet - - @property - def create_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_product`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateProduct - - @property - def list_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_products`. - - Lists products in an unspecified order. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProducts - - @property - def get_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_product`. - - Gets information associated with a Product. - - Possible errors: - - - Returns NOT\_FOUND if the Product does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetProduct - - @property - def update_product(self): - """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. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].UpdateProduct - - @property - def delete_product(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_product`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteProduct - - @property - def create_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.create_reference_image`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].CreateReferenceImage - - @property - def delete_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.delete_reference_image`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].DeleteReferenceImage - - @property - def list_reference_images(self): - """Return the gRPC stub for :meth:`ProductSearchClient.list_reference_images`. - - 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. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListReferenceImages - - @property - def get_reference_image(self): - """Return the gRPC stub for :meth:`ProductSearchClient.get_reference_image`. - - Gets information associated with a ReferenceImage. - - Possible errors: - - - Returns NOT\_FOUND if the specified image does not exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].GetReferenceImage - - @property - def add_product_to_product_set(self): - """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. - - One Product can be added to at most 100 ProductSets. - - Possible errors: - - - Returns NOT\_FOUND if the Product or the ProductSet doesn't exist. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].AddProductToProductSet - - @property - def remove_product_from_product_set(self): - """Return the gRPC stub for :meth:`ProductSearchClient.remove_product_from_product_set`. - - Removes a Product from the specified ProductSet. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].RemoveProductFromProductSet - - @property - def list_products_in_product_set(self): - """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 - empty. - - Possible errors: - - - Returns INVALID\_ARGUMENT if page\_size is greater than 100 or less - than 1. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ListProductsInProductSet - - @property - def import_product_sets(self): - """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. - - The ``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``. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].ImportProductSets - - @property - def purge_products(self): - """Return the gRPC stub for :meth:`ProductSearchClient.purge_products`. - - 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`` API can be used to keep track of - the progress and results of the request. ``Operation.metadata`` contains - ``BatchOperationMetadata``. (progress) - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["product_search_stub"].PurgeProducts diff --git a/vision/google/cloud/vision_v1p4beta1/proto/__init__.py b/vision/google/cloud/vision_v1p4beta1/proto/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/google/cloud/vision_v1p4beta1/proto/face.proto b/vision/google/cloud/vision_v1p4beta1/proto/face.proto deleted file mode 100644 index 1786f26f0655..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/face.proto +++ /dev/null @@ -1,61 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p4beta1/geometry.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "CelebrityProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// Parameters for a celebrity recognition request. -message FaceRecognitionParams { - // The resource names for one or more - // [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. A celebrity - // set is preloaded and can be specified as "builtin/default". If this is - // specified, the algorithm will try to match the faces detected in the input - // image to the Celebrities in the CelebritySets. - repeated string celebrity_set = 1; -} - -// A Celebrity is a group of Faces with an identity. -message Celebrity { - // The resource name of the preloaded Celebrity. Has the format - // `builtin/{mid}`. - string name = 1; - - // The Celebrity's display name. - string display_name = 2; - - // The Celebrity's description. - string description = 3; -} - -// Information about a face's identity. -message FaceRecognitionResult { - // The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] that this face was - // matched to. - Celebrity celebrity = 1; - - // Recognition confidence. Range [0, 1]. - float confidence = 2; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/face_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/face_pb2.py deleted file mode 100644 index 8fd9712fda23..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/face_pb2.py +++ /dev/null @@ -1,286 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/face.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p4beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/face.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\016CelebrityProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n.google/cloud/vision_v1p4beta1/proto/face.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p4beta1/proto/geometry.proto".\n\x15\x46\x61\x63\x65RecognitionParams\x12\x15\n\rcelebrity_set\x18\x01 \x03(\t"D\n\tCelebrity\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t"h\n\x15\x46\x61\x63\x65RecognitionResult\x12;\n\tcelebrity\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.Celebrity\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x42\x84\x01\n!com.google.cloud.vision.v1p4beta1B\x0e\x43\x65lebrityProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - ], -) - - -_FACERECOGNITIONPARAMS = _descriptor.Descriptor( - name="FaceRecognitionParams", - full_name="google.cloud.vision.v1p4beta1.FaceRecognitionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="celebrity_set", - full_name="google.cloud.vision.v1p4beta1.FaceRecognitionParams.celebrity_set", - index=0, - number=1, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=163, - serialized_end=209, -) - - -_CELEBRITY = _descriptor.Descriptor( - name="Celebrity", - full_name="google.cloud.vision.v1p4beta1.Celebrity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.Celebrity.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.vision.v1p4beta1.Celebrity.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p4beta1.Celebrity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=211, - serialized_end=279, -) - - -_FACERECOGNITIONRESULT = _descriptor.Descriptor( - name="FaceRecognitionResult", - full_name="google.cloud.vision.v1p4beta1.FaceRecognitionResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="celebrity", - full_name="google.cloud.vision.v1p4beta1.FaceRecognitionResult.celebrity", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.FaceRecognitionResult.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=281, - serialized_end=385, -) - -_FACERECOGNITIONRESULT.fields_by_name["celebrity"].message_type = _CELEBRITY -DESCRIPTOR.message_types_by_name["FaceRecognitionParams"] = _FACERECOGNITIONPARAMS -DESCRIPTOR.message_types_by_name["Celebrity"] = _CELEBRITY -DESCRIPTOR.message_types_by_name["FaceRecognitionResult"] = _FACERECOGNITIONRESULT -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -FaceRecognitionParams = _reflection.GeneratedProtocolMessageType( - "FaceRecognitionParams", - (_message.Message,), - dict( - DESCRIPTOR=_FACERECOGNITIONPARAMS, - __module__="google.cloud.vision_v1p4beta1.proto.face_pb2", - __doc__="""Parameters for a celebrity recognition request. - - - Attributes: - celebrity_set: - The resource names for one or more - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]s. A - celebrity set is preloaded and can be specified as - "builtin/default". If this is specified, the algorithm will - try to match the faces detected in the input image to the - Celebrities in the CelebritySets. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceRecognitionParams) - ), -) -_sym_db.RegisterMessage(FaceRecognitionParams) - -Celebrity = _reflection.GeneratedProtocolMessageType( - "Celebrity", - (_message.Message,), - dict( - DESCRIPTOR=_CELEBRITY, - __module__="google.cloud.vision_v1p4beta1.proto.face_pb2", - __doc__="""A Celebrity is a group of Faces with an identity. - - - Attributes: - name: - The resource name of the preloaded Celebrity. Has the format - ``builtin/{mid}``. - display_name: - The Celebrity's display name. - description: - The Celebrity's description. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Celebrity) - ), -) -_sym_db.RegisterMessage(Celebrity) - -FaceRecognitionResult = _reflection.GeneratedProtocolMessageType( - "FaceRecognitionResult", - (_message.Message,), - dict( - DESCRIPTOR=_FACERECOGNITIONRESULT, - __module__="google.cloud.vision_v1p4beta1.proto.face_pb2", - __doc__="""Information about a face's identity. - - - Attributes: - celebrity: - The [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] that - this face was matched to. - confidence: - Recognition confidence. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceRecognitionResult) - ), -) -_sym_db.RegisterMessage(FaceRecognitionResult) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p4beta1/proto/geometry.proto b/vision/google/cloud/vision_v1p4beta1/proto/geometry.proto deleted file mode 100644 index 18877188faea..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/geometry.proto +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "GeometryProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// A vertex represents a 2D point in the image. -// NOTE: the vertex coordinates are in the same scale as the original image. -message Vertex { - // X coordinate. - int32 x = 1; - - // Y coordinate. - int32 y = 2; -} - -// A vertex represents a 2D point in the image. -// NOTE: the normalized vertex coordinates are relative to the original image -// and range from 0 to 1. -message NormalizedVertex { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; -} - -// A bounding polygon for the detected image annotation. -message BoundingPoly { - // The bounding polygon vertices. - repeated Vertex vertices = 1; - - // The bounding polygon normalized vertices. - repeated NormalizedVertex normalized_vertices = 2; -} - -// A 3D position in the image, used primarily for Face detection landmarks. -// A valid Position must have both x and y coordinates. -// The position coordinates are in the same scale as the original image. -message Position { - // X coordinate. - float x = 1; - - // Y coordinate. - float y = 2; - - // Z coordinate (or depth). - float z = 3; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2.py deleted file mode 100644 index d90740ef312a..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2.py +++ /dev/null @@ -1,371 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/geometry.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/geometry.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n2google/cloud/vision_v1p4beta1/proto/geometry.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto"\x1e\n\x06Vertex\x12\t\n\x01x\x18\x01 \x01(\x05\x12\t\n\x01y\x18\x02 \x01(\x05"(\n\x10NormalizedVertex\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02"\x95\x01\n\x0c\x42oundingPoly\x12\x37\n\x08vertices\x18\x01 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Vertex\x12L\n\x13normalized_vertices\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.NormalizedVertex"+\n\x08Position\x12\t\n\x01x\x18\x01 \x01(\x02\x12\t\n\x01y\x18\x02 \x01(\x02\x12\t\n\x01z\x18\x03 \x01(\x02\x42\x83\x01\n!com.google.cloud.vision.v1p4beta1B\rGeometryProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_VERTEX = _descriptor.Descriptor( - name="Vertex", - full_name="google.cloud.vision.v1p4beta1.Vertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p4beta1.Vertex.x", - index=0, - number=1, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p4beta1.Vertex.y", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=115, - serialized_end=145, -) - - -_NORMALIZEDVERTEX = _descriptor.Descriptor( - name="NormalizedVertex", - full_name="google.cloud.vision.v1p4beta1.NormalizedVertex", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p4beta1.NormalizedVertex.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p4beta1.NormalizedVertex.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=147, - serialized_end=187, -) - - -_BOUNDINGPOLY = _descriptor.Descriptor( - name="BoundingPoly", - full_name="google.cloud.vision.v1p4beta1.BoundingPoly", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="vertices", - full_name="google.cloud.vision.v1p4beta1.BoundingPoly.vertices", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="normalized_vertices", - full_name="google.cloud.vision.v1p4beta1.BoundingPoly.normalized_vertices", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=190, - serialized_end=339, -) - - -_POSITION = _descriptor.Descriptor( - name="Position", - full_name="google.cloud.vision.v1p4beta1.Position", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="x", - full_name="google.cloud.vision.v1p4beta1.Position.x", - index=0, - number=1, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="y", - full_name="google.cloud.vision.v1p4beta1.Position.y", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="z", - full_name="google.cloud.vision.v1p4beta1.Position.z", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=341, - serialized_end=384, -) - -_BOUNDINGPOLY.fields_by_name["vertices"].message_type = _VERTEX -_BOUNDINGPOLY.fields_by_name["normalized_vertices"].message_type = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["Vertex"] = _VERTEX -DESCRIPTOR.message_types_by_name["NormalizedVertex"] = _NORMALIZEDVERTEX -DESCRIPTOR.message_types_by_name["BoundingPoly"] = _BOUNDINGPOLY -DESCRIPTOR.message_types_by_name["Position"] = _POSITION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Vertex = _reflection.GeneratedProtocolMessageType( - "Vertex", - (_message.Message,), - dict( - DESCRIPTOR=_VERTEX, - __module__="google.cloud.vision_v1p4beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Vertex) - ), -) -_sym_db.RegisterMessage(Vertex) - -NormalizedVertex = _reflection.GeneratedProtocolMessageType( - "NormalizedVertex", - (_message.Message,), - dict( - DESCRIPTOR=_NORMALIZEDVERTEX, - __module__="google.cloud.vision_v1p4beta1.proto.geometry_pb2", - __doc__="""X coordinate. - - - Attributes: - y: - Y coordinate. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.NormalizedVertex) - ), -) -_sym_db.RegisterMessage(NormalizedVertex) - -BoundingPoly = _reflection.GeneratedProtocolMessageType( - "BoundingPoly", - (_message.Message,), - dict( - DESCRIPTOR=_BOUNDINGPOLY, - __module__="google.cloud.vision_v1p4beta1.proto.geometry_pb2", - __doc__="""A bounding polygon for the detected image annotation. - - - Attributes: - vertices: - The bounding polygon vertices. - normalized_vertices: - The bounding polygon normalized vertices. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BoundingPoly) - ), -) -_sym_db.RegisterMessage(BoundingPoly) - -Position = _reflection.GeneratedProtocolMessageType( - "Position", - (_message.Message,), - dict( - DESCRIPTOR=_POSITION, - __module__="google.cloud.vision_v1p4beta1.proto.geometry_pb2", - __doc__="""A 3D position in the image, used primarily for Face - detection landmarks. A valid Position must have both x and y - coordinates. The position coordinates are in the same scale as the - original image. - - - Attributes: - x: - X coordinate. - y: - Y coordinate. - z: - Z coordinate (or depth). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Position) - ), -) -_sym_db.RegisterMessage(Position) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator.proto b/vision/google/cloud/vision_v1p4beta1/proto/image_annotator.proto deleted file mode 100644 index e3553b0de02c..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator.proto +++ /dev/null @@ -1,951 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/cloud/vision/v1p4beta1/face.proto"; -import "google/cloud/vision/v1p4beta1/geometry.proto"; -import "google/cloud/vision/v1p4beta1/product_search.proto"; -import "google/cloud/vision/v1p4beta1/text_annotation.proto"; -import "google/cloud/vision/v1p4beta1/web_detection.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; -import "google/type/color.proto"; -import "google/type/latlng.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ImageAnnotatorProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// 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. -service ImageAnnotator { - option (google.api.default_host) = "vision.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-vision"; - - // Run image detection and annotation for a batch of images. - rpc BatchAnnotateImages(BatchAnnotateImagesRequest) - returns (BatchAnnotateImagesResponse) { - option (google.api.http) = { - post: "/v1p4beta1/images:annotate" - body: "*" - }; - option (google.api.method_signature) = "requests"; - } - - // 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. - rpc BatchAnnotateFiles(BatchAnnotateFilesRequest) - returns (BatchAnnotateFilesResponse) { - option (google.api.http) = { - post: "/v1p4beta1/files:annotate" - body: "*" - }; - option (google.api.method_signature) = "requests"; - } - - // 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. - rpc AsyncBatchAnnotateImages(AsyncBatchAnnotateImagesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p4beta1/images:asyncBatchAnnotate" - body: "*" - }; - option (google.api.method_signature) = "requests,output_config"; - option (google.longrunning.operation_info) = { - response_type: "AsyncBatchAnnotateImagesResponse" - metadata_type: "OperationMetadata" - }; - } - - // 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). - rpc AsyncBatchAnnotateFiles(AsyncBatchAnnotateFilesRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p4beta1/files:asyncBatchAnnotate" - body: "*" - }; - option (google.api.method_signature) = "requests"; - option (google.longrunning.operation_info) = { - response_type: "AsyncBatchAnnotateFilesResponse" - metadata_type: "OperationMetadata" - }; - } -} - -// The type of Google Cloud Vision API detection to perform, and the maximum -// number of results to return for that type. Multiple `Feature` objects can -// be specified in the `features` list. -message Feature { - // Type of Google Cloud Vision API feature to be extracted. - enum Type { - // Unspecified feature type. - TYPE_UNSPECIFIED = 0; - - // Run face detection. - FACE_DETECTION = 1; - - // Run landmark detection. - LANDMARK_DETECTION = 2; - - // Run logo detection. - LOGO_DETECTION = 3; - - // Run label detection. - LABEL_DETECTION = 4; - - // 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. - TEXT_DETECTION = 5; - - // Run dense text document OCR. Takes precedence when both - // `DOCUMENT_TEXT_DETECTION` and `TEXT_DETECTION` are present. - DOCUMENT_TEXT_DETECTION = 11; - - // Run Safe Search to detect potentially unsafe - // or undesirable content. - SAFE_SEARCH_DETECTION = 6; - - // Compute a set of image properties, such as the - // image's dominant colors. - IMAGE_PROPERTIES = 7; - - // Run crop hints. - CROP_HINTS = 9; - - // Run web detection. - WEB_DETECTION = 10; - - // Run Product Search. - PRODUCT_SEARCH = 12; - - // Run localizer for object detection. - OBJECT_LOCALIZATION = 19; - } - - // The feature type. - Type type = 1; - - // Maximum number of results of this type. Does not apply to - // `TEXT_DETECTION`, `DOCUMENT_TEXT_DETECTION`, or `CROP_HINTS`. - int32 max_results = 2; - - // Model to use for the feature. - // Supported values: "builtin/stable" (the default if unset) and - // "builtin/latest". - string model = 3; -} - -// External image source (Google Cloud Storage or web URL image location). -message ImageSource { - // **Use `image_uri` instead.** - // - // The Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more info. - string gcs_image_uri = 1; - - // The URI of the source image. Can be either: - // - // 1. A Google Cloud Storage URI of the form - // `gs://bucket_name/object_name`. Object versioning is not supported. See - // [Google Cloud Storage Request - // URIs](https://cloud.google.com/storage/docs/reference-uris) for more - // info. - // - // 2. A publicly-accessible image HTTP/HTTPS URL. When fetching images from - // HTTP/HTTPS URLs, Google cannot guarantee that the request will be - // completed. Your request may fail if the specified host denies the - // request (e.g. due to request throttling or DOS prevention), or if Google - // throttles requests to the site for abuse prevention. You should not - // depend on externally-hosted images for production applications. - // - // When both `gcs_image_uri` and `image_uri` are specified, `image_uri` takes - // precedence. - string image_uri = 2; -} - -// Client image to perform Google Cloud Vision API tasks over. -message Image { - // Image content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - bytes content = 1; - - // Google Cloud Storage image location, or publicly-accessible image - // URL. If both `content` and `source` are provided for an image, `content` - // takes precedence and is used to perform the image annotation request. - ImageSource source = 2; -} - -// A bucketized representation of likelihood, which is intended to give clients -// highly stable results across model upgrades. -enum Likelihood { - // Unknown likelihood. - UNKNOWN = 0; - - // It is very unlikely. - VERY_UNLIKELY = 1; - - // It is unlikely. - UNLIKELY = 2; - - // It is possible. - POSSIBLE = 3; - - // It is likely. - LIKELY = 4; - - // It is very likely. - VERY_LIKELY = 5; -} - -// A face annotation object contains the results of face detection. -message FaceAnnotation { - // A face-specific landmark (for example, a face feature). - message Landmark { - // 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. - enum Type { - // Unknown face landmark detected. Should not be filled. - UNKNOWN_LANDMARK = 0; - - // Left eye. - LEFT_EYE = 1; - - // Right eye. - RIGHT_EYE = 2; - - // Left of left eyebrow. - LEFT_OF_LEFT_EYEBROW = 3; - - // Right of left eyebrow. - RIGHT_OF_LEFT_EYEBROW = 4; - - // Left of right eyebrow. - LEFT_OF_RIGHT_EYEBROW = 5; - - // Right of right eyebrow. - RIGHT_OF_RIGHT_EYEBROW = 6; - - // Midpoint between eyes. - MIDPOINT_BETWEEN_EYES = 7; - - // Nose tip. - NOSE_TIP = 8; - - // Upper lip. - UPPER_LIP = 9; - - // Lower lip. - LOWER_LIP = 10; - - // Mouth left. - MOUTH_LEFT = 11; - - // Mouth right. - MOUTH_RIGHT = 12; - - // Mouth center. - MOUTH_CENTER = 13; - - // Nose, bottom right. - NOSE_BOTTOM_RIGHT = 14; - - // Nose, bottom left. - NOSE_BOTTOM_LEFT = 15; - - // Nose, bottom center. - NOSE_BOTTOM_CENTER = 16; - - // Left eye, top boundary. - LEFT_EYE_TOP_BOUNDARY = 17; - - // Left eye, right corner. - LEFT_EYE_RIGHT_CORNER = 18; - - // Left eye, bottom boundary. - LEFT_EYE_BOTTOM_BOUNDARY = 19; - - // Left eye, left corner. - LEFT_EYE_LEFT_CORNER = 20; - - // Right eye, top boundary. - RIGHT_EYE_TOP_BOUNDARY = 21; - - // Right eye, right corner. - RIGHT_EYE_RIGHT_CORNER = 22; - - // Right eye, bottom boundary. - RIGHT_EYE_BOTTOM_BOUNDARY = 23; - - // Right eye, left corner. - RIGHT_EYE_LEFT_CORNER = 24; - - // Left eyebrow, upper midpoint. - LEFT_EYEBROW_UPPER_MIDPOINT = 25; - - // Right eyebrow, upper midpoint. - RIGHT_EYEBROW_UPPER_MIDPOINT = 26; - - // Left ear tragion. - LEFT_EAR_TRAGION = 27; - - // Right ear tragion. - RIGHT_EAR_TRAGION = 28; - - // Left eye pupil. - LEFT_EYE_PUPIL = 29; - - // Right eye pupil. - RIGHT_EYE_PUPIL = 30; - - // Forehead glabella. - FOREHEAD_GLABELLA = 31; - - // Chin gnathion. - CHIN_GNATHION = 32; - - // Chin left gonion. - CHIN_LEFT_GONION = 33; - - // Chin right gonion. - CHIN_RIGHT_GONION = 34; - } - - // Face landmark type. - Type type = 3; - - // Face landmark position. - Position position = 4; - } - - // The bounding polygon around the face. The coordinates of the bounding box - // are in the original image's scale. - // The bounding box is computed to "frame" the face in accordance with human - // expectations. It is based on the landmarker results. - // Note that one or more x and/or y coordinates may not be generated in the - // `BoundingPoly` (the polygon will be unbounded) if only a partial face - // appears in the image to be annotated. - BoundingPoly bounding_poly = 1; - - // The `fd_bounding_poly` bounding polygon is tighter than the - // `boundingPoly`, and encloses only the skin part of the face. Typically, it - // is used to eliminate the face from any image analysis that detects the - // "amount of skin" visible in an image. It is not based on the - // landmarker results, only on the initial face detection, hence - // the fd (face detection) prefix. - BoundingPoly fd_bounding_poly = 2; - - // Detected face landmarks. - repeated Landmark landmarks = 3; - - // Roll angle, which indicates the amount of clockwise/anti-clockwise rotation - // of the face relative to the image vertical about the axis perpendicular to - // the face. Range [-180,180]. - float roll_angle = 4; - - // Yaw angle, which indicates the leftward/rightward angle that the face is - // pointing relative to the vertical plane perpendicular to the image. Range - // [-180,180]. - float pan_angle = 5; - - // Pitch angle, which indicates the upwards/downwards angle that the face is - // pointing relative to the image's horizontal plane. Range [-180,180]. - float tilt_angle = 6; - - // Detection confidence. Range [0, 1]. - float detection_confidence = 7; - - // Face landmarking confidence. Range [0, 1]. - float landmarking_confidence = 8; - - // Joy likelihood. - Likelihood joy_likelihood = 9; - - // Sorrow likelihood. - Likelihood sorrow_likelihood = 10; - - // Anger likelihood. - Likelihood anger_likelihood = 11; - - // Surprise likelihood. - Likelihood surprise_likelihood = 12; - - // Under-exposed likelihood. - Likelihood under_exposed_likelihood = 13; - - // Blurred likelihood. - Likelihood blurred_likelihood = 14; - - // Headwear likelihood. - Likelihood headwear_likelihood = 15; - - // Additional recognition information. Only computed if - // image_context.face_recognition_params is provided, **and** a match is found - // to a [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the input - // [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. This field is - // sorted in order of decreasing confidence values. - repeated FaceRecognitionResult recognition_result = 16; -} - -// Detected entity location information. -message LocationInfo { - // lat/long location coordinates. - google.type.LatLng lat_lng = 1; -} - -// A `Property` consists of a user-supplied name/value pair. -message Property { - // Name of the property. - string name = 1; - - // Value of the property. - string value = 2; - - // Value of numeric properties. - uint64 uint64_value = 3; -} - -// Set of detected entity features. -message EntityAnnotation { - // Opaque entity ID. Some IDs may be available in - // [Google Knowledge Graph Search - // API](https://developers.google.com/knowledge-graph/). - string mid = 1; - - // The language code for the locale in which the entity textual - // `description` is expressed. - string locale = 2; - - // Entity textual description, expressed in its `locale` language. - string description = 3; - - // Overall score of the result. Range [0, 1]. - float score = 4; - - // **Deprecated. Use `score` instead.** - // The accuracy of the entity detection in an image. - // For example, for an image in which the "Eiffel Tower" entity is detected, - // this field represents the confidence that there is a tower in the query - // image. Range [0, 1]. - float confidence = 5 [deprecated = true]; - - // The relevancy of the ICA (Image Content Annotation) label to the - // image. For example, the relevancy of "tower" is likely higher to an image - // containing the detected "Eiffel Tower" than to an image containing a - // detected distant towering building, even though the confidence that - // there is a tower in each image may be the same. Range [0, 1]. - float topicality = 6; - - // Image region to which this entity belongs. Not produced - // for `LABEL_DETECTION` features. - BoundingPoly bounding_poly = 7; - - // The location information for the detected entity. Multiple - // `LocationInfo` elements can be present because one location may - // indicate the location of the scene in the image, and another location - // may indicate the location of the place where the image was taken. - // Location information is usually present for landmarks. - repeated LocationInfo locations = 8; - - // Some entities may have optional user-supplied `Property` (name/value) - // fields, such a score or string that qualifies the entity. - repeated Property properties = 9; -} - -// Set of detected objects with bounding boxes. -message LocalizedObjectAnnotation { - // Object ID that should align with EntityAnnotation mid. - string mid = 1; - - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - - // Object name, expressed in its `language_code` language. - string name = 3; - - // Score of the result. Range [0, 1]. - float score = 4; - - // Image region to which this object belongs. This must be populated. - BoundingPoly bounding_poly = 5; -} - -// Set of features pertaining to the image, computed by computer vision -// methods over safe-search verticals (for example, adult, spoof, medical, -// violence). -message SafeSearchAnnotation { - // Represents the adult content likelihood for the image. Adult content may - // contain elements such as nudity, pornographic images or cartoons, or - // sexual activities. - Likelihood adult = 1; - - // Spoof likelihood. The likelihood that an modification - // was made to the image's canonical version to make it appear - // funny or offensive. - Likelihood spoof = 2; - - // Likelihood that this is a medical image. - Likelihood medical = 3; - - // Likelihood that this image contains violent content. - Likelihood violence = 4; - - // Likelihood that the request image contains racy content. Racy content may - // include (but is not limited to) skimpy or sheer clothing, strategically - // covered nudity, lewd or provocative poses, or close-ups of sensitive - // body areas. - Likelihood racy = 9; -} - -// Rectangle determined by min and max `LatLng` pairs. -message LatLongRect { - // Min lat/long pair. - google.type.LatLng min_lat_lng = 1; - - // Max lat/long pair. - google.type.LatLng max_lat_lng = 2; -} - -// Color information consists of RGB channels, score, and the fraction of -// the image that the color occupies in the image. -message ColorInfo { - // RGB components of the color. - google.type.Color color = 1; - - // Image-specific score for this color. Value in range [0, 1]. - float score = 2; - - // The fraction of pixels the color occupies in the image. - // Value in range [0, 1]. - float pixel_fraction = 3; -} - -// Set of dominant colors and their corresponding scores. -message DominantColorsAnnotation { - // RGB color values with their score and pixel fraction. - repeated ColorInfo colors = 1; -} - -// Stores image properties, such as dominant colors. -message ImageProperties { - // If present, dominant colors completed successfully. - DominantColorsAnnotation dominant_colors = 1; -} - -// Single crop hint that is used to generate a new crop when serving an image. -message CropHint { - // The bounding polygon for the crop region. The coordinates of the bounding - // box are in the original image's scale. - BoundingPoly bounding_poly = 1; - - // Confidence of this being a salient region. Range [0, 1]. - float confidence = 2; - - // Fraction of importance of this salient region with respect to the original - // image. - float importance_fraction = 3; -} - -// Set of crop hints that are used to generate new crops when serving images. -message CropHintsAnnotation { - // Crop hint results. - repeated CropHint crop_hints = 1; -} - -// Parameters for crop hints annotation request. -message CropHintsParams { - // Aspect ratios in floats, representing the ratio of the width to the height - // of the image. For example, if the desired aspect ratio is 4/3, the - // corresponding float value should be 1.33333. If not specified, the - // best possible crop is returned. The number of provided aspect ratios is - // limited to a maximum of 16; any aspect ratios provided after the 16th are - // ignored. - repeated float aspect_ratios = 1; -} - -// Parameters for web detection request. -message WebDetectionParams { - // Whether to include results derived from the geo information in the image. - bool include_geo_results = 2; -} - -// Image context and/or feature-specific parameters. -message ImageContext { - // Not used. - LatLongRect lat_long_rect = 1; - - // List of languages to use for TEXT_DETECTION. In most cases, an empty value - // yields the best results since it enables automatic language detection. For - // languages based on the Latin alphabet, setting `language_hints` is not - // needed. In rare cases, when the language of the text in the image is known, - // setting a hint will help get better results (although it will be a - // significant hindrance if the hint is wrong). Text detection returns an - // error if one or more of the specified languages is not one of the - // [supported languages](/vision/docs/languages). - repeated string language_hints = 2; - - // Parameters for crop hints annotation request. - CropHintsParams crop_hints_params = 4; - - // Parameters for face recognition. - FaceRecognitionParams face_recognition_params = 10; - - // Parameters for product search. - ProductSearchParams product_search_params = 5; - - // Parameters for web detection. - WebDetectionParams web_detection_params = 6; -} - -// Request for performing Google Cloud Vision API tasks over a user-provided -// image, with user-requested features, and with context information. -message AnnotateImageRequest { - // The image to be processed. - Image image = 1; - - // Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image. - ImageContext image_context = 3; -} - -// If an image was produced from a file (e.g. a PDF), this message gives -// information about the source of that image. -message ImageAnnotationContext { - // The URI of the file used to produce the image. - string uri = 1; - - // If the file was a PDF or TIFF, this field gives the page number within - // the file used to produce the image. - int32 page_number = 2; -} - -// Response to an image annotation request. -message AnnotateImageResponse { - // If present, face detection has completed successfully. - repeated FaceAnnotation face_annotations = 1; - - // If present, landmark detection has completed successfully. - repeated EntityAnnotation landmark_annotations = 2; - - // If present, logo detection has completed successfully. - repeated EntityAnnotation logo_annotations = 3; - - // If present, label detection has completed successfully. - repeated EntityAnnotation label_annotations = 4; - - // If present, localized object detection has completed successfully. - // This will be sorted descending by confidence score. - repeated LocalizedObjectAnnotation localized_object_annotations = 22; - - // If present, text (OCR) detection has completed successfully. - repeated EntityAnnotation text_annotations = 5; - - // If present, text (OCR) detection or document (OCR) text detection has - // completed successfully. - // This annotation provides the structural hierarchy for the OCR detected - // text. - TextAnnotation full_text_annotation = 12; - - // If present, safe-search annotation has completed successfully. - SafeSearchAnnotation safe_search_annotation = 6; - - // If present, image properties were extracted successfully. - ImageProperties image_properties_annotation = 8; - - // If present, crop hints have completed successfully. - CropHintsAnnotation crop_hints_annotation = 11; - - // If present, web detection has completed successfully. - WebDetection web_detection = 13; - - // If present, product search has completed successfully. - ProductSearchResults product_search_results = 14; - - // If set, represents the error message for the operation. - // Note that filled-in image annotations are guaranteed to be - // correct, even when `error` is set. - google.rpc.Status error = 9; - - // If present, contextual information is needed to understand where this image - // comes from. - ImageAnnotationContext context = 21; -} - -// Multiple image annotation requests are batched into a single service call. -message BatchAnnotateImagesRequest { - // Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1; -} - -// Response to a batch image annotation request. -message BatchAnnotateImagesResponse { - // Individual responses to image annotation requests within the batch. - repeated AnnotateImageResponse responses = 1; -} - -// A request to annotate one single file, e.g. a PDF, TIFF or GIF file. -message AnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Pages of the file to perform image annotation. - // - // Pages starts from 1, we assume the first page of the file is page 1. - // At most 5 pages are supported per request. Pages can be negative. - // - // Page 1 means the first page. - // Page 2 means the second page. - // Page -1 means the last page. - // Page -2 means the second to the last page. - // - // If the file is GIF instead of PDF or TIFF, page refers to GIF frames. - // - // If this field is empty, by default the service performs image annotation - // for the first 5 pages of the file. - repeated int32 pages = 4; -} - -// Response to a single file annotation request. A file may contain one or more -// images, which individually have their own responses. -message AnnotateFileResponse { - // Information about the file for which this response is generated. - InputConfig input_config = 1; - - // Individual responses to images found within the file. This field will be - // empty if the `error` field is set. - repeated AnnotateImageResponse responses = 2; - - // This field gives the total number of pages in the file. - int32 total_pages = 3; - - // If set, represents the error message for the failed request. The - // `responses` field will not be set in this case. - google.rpc.Status error = 4; -} - -// A list of requests to annotate files using the BatchAnnotateFiles API. -message BatchAnnotateFilesRequest { - // Required. The list of file annotation requests. Right now we support only - // one AnnotateFileRequest in BatchAnnotateFilesRequest. - repeated AnnotateFileRequest requests = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// A list of file annotation responses. -message BatchAnnotateFilesResponse { - // The list of file annotation responses, each response corresponding to each - // AnnotateFileRequest in BatchAnnotateFilesRequest. - repeated AnnotateFileResponse responses = 1; -} - -// An offline file annotation request. -message AsyncAnnotateFileRequest { - // Required. Information about the input file. - InputConfig input_config = 1; - - // Required. Requested features. - repeated Feature features = 2; - - // Additional context that may accompany the image(s) in the file. - ImageContext image_context = 3; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 4; -} - -// The response for a single offline file annotation request. -message AsyncAnnotateFileResponse { - // The output location and metadata from AsyncAnnotateFileRequest. - OutputConfig output_config = 1; -} - -// Request for async image annotation for a list of images. -message AsyncBatchAnnotateImagesRequest { - // Required. Individual image annotation requests for this batch. - repeated AnnotateImageRequest requests = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The desired output location and metadata (e.g. format). - OutputConfig output_config = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// Response to an async batch image annotation request. -message AsyncBatchAnnotateImagesResponse { - // The output location and metadata from AsyncBatchAnnotateImagesRequest. - OutputConfig output_config = 1; -} - -// Multiple async file annotation requests are batched into a single service -// call. -message AsyncBatchAnnotateFilesRequest { - // Required. Individual async file annotation requests for this batch. - repeated AsyncAnnotateFileRequest requests = 1 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response to an async batch file annotation request. -message AsyncBatchAnnotateFilesResponse { - // The list of file annotation responses, one for each request in - // AsyncBatchAnnotateFilesRequest. - repeated AsyncAnnotateFileResponse responses = 1; -} - -// The desired input location and metadata. -message InputConfig { - // The Google Cloud Storage location to read the input from. - GcsSource gcs_source = 1; - - // File content, represented as a stream of bytes. - // Note: As with all `bytes` fields, protobuffers use a pure binary - // representation, whereas JSON representations use base64. - // - // Currently, this field only works for BatchAnnotateFiles requests. It does - // not work for AsyncBatchAnnotateFiles requests. - bytes content = 3; - - // The type of the file. Currently only "application/pdf", "image/tiff" and - // "image/gif" are supported. Wildcards are not supported. - string mime_type = 2; -} - -// The desired output location and metadata. -message OutputConfig { - // The Google Cloud Storage location to write the output(s) to. - GcsDestination gcs_destination = 1; - - // The max number of response protos to put into each output JSON file on - // Google Cloud Storage. - // The valid range is [1, 100]. If not specified, the default value is 20. - // - // For example, for one pdf file with 100 pages, 100 response protos will - // be generated. If `batch_size` = 20, then 5 json files each - // containing 20 response protos will be written under the prefix - // `gcs_destination`.`uri`. - // - // Currently, batch_size only applies to GcsDestination, with potential future - // support for other output configurations. - int32 batch_size = 2; -} - -// The Google Cloud Storage location where the input will be read from. -message GcsSource { - // Google Cloud Storage URI for the input file. This must only be a - // Google Cloud Storage object. Wildcards are not currently supported. - string uri = 1; -} - -// The Google Cloud Storage location where the output will be written to. -message GcsDestination { - // Google Cloud Storage URI prefix where the results will be stored. Results - // will be in JSON format and preceded by its corresponding input URI prefix. - // This field can either represent a gcs file prefix or gcs directory. In - // either case, the uri should be unique because in order to get all of the - // output files, you will need to do a wildcard gcs search on the uri prefix - // you provide. - // - // Examples: - // - // * File Prefix: gs://bucket-name/here/filenameprefix The output files - // will be created in gs://bucket-name/here/ and the names of the - // output files will begin with "filenameprefix". - // - // * Directory Prefix: gs://bucket-name/some/location/ The output files - // will be created in gs://bucket-name/some/location/ and the names of the - // output files could be anything because there was no filename prefix - // specified. - // - // If multiple outputs, each response is still AnnotateFileResponse, each of - // which contains some subset of the full list of AnnotateImageResponse. - // Multiple outputs can happen if, for example, the output JSON is too large - // and overflows into multiple sharded files. - string uri = 1; -} - -// Contains metadata for the BatchAnnotateImages operation. -message OperationMetadata { - // Batch operation states. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is received. - CREATED = 1; - - // Request is actively being processed. - RUNNING = 2; - - // The batch processing is done. - DONE = 3; - - // The batch processing was cancelled. - CANCELLED = 4; - } - - // Current state of the batch operation. - State state = 1; - - // The time when the batch request was received. - google.protobuf.Timestamp create_time = 5; - - // The time when the operation result was last updated. - google.protobuf.Timestamp update_time = 6; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py deleted file mode 100644 index 7ad1b8e051ef..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py +++ /dev/null @@ -1,4764 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/image_annotator.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.cloud.vision_v1p4beta1.proto import ( - face_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_face__pb2, -) -from google.cloud.vision_v1p4beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p4beta1.proto import ( - product_search_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__pb2, -) -from google.cloud.vision_v1p4beta1.proto import ( - text_annotation_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_text__annotation__pb2, -) -from google.cloud.vision_v1p4beta1.proto import ( - web_detection_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_web__detection__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 -from google.type import color_pb2 as google_dot_type_dot_color__pb2 -from google.type import latlng_pb2 as google_dot_type_dot_latlng__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/image_annotator.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\023ImageAnnotatorProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p4beta1/proto/image_annotator.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a.google/cloud/vision_v1p4beta1/proto/face.proto\x1a\x32google/cloud/vision_v1p4beta1/proto/geometry.proto\x1a\x38google/cloud/vision_v1p4beta1/proto/product_search.proto\x1a\x39google/cloud/vision_v1p4beta1/proto/text_annotation.proto\x1a\x37google/cloud/vision_v1p4beta1/proto/web_detection.proto\x1a#google/longrunning/operations.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto\x1a\x17google/type/color.proto\x1a\x18google/type/latlng.proto"\x8e\x03\n\x07\x46\x65\x61ture\x12\x39\n\x04type\x18\x01 \x01(\x0e\x32+.google.cloud.vision.v1p4beta1.Feature.Type\x12\x13\n\x0bmax_results\x18\x02 \x01(\x05\x12\r\n\x05model\x18\x03 \x01(\t"\xa3\x02\n\x04Type\x12\x14\n\x10TYPE_UNSPECIFIED\x10\x00\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x01\x12\x16\n\x12LANDMARK_DETECTION\x10\x02\x12\x12\n\x0eLOGO_DETECTION\x10\x03\x12\x13\n\x0fLABEL_DETECTION\x10\x04\x12\x12\n\x0eTEXT_DETECTION\x10\x05\x12\x1b\n\x17\x44OCUMENT_TEXT_DETECTION\x10\x0b\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x06\x12\x14\n\x10IMAGE_PROPERTIES\x10\x07\x12\x0e\n\nCROP_HINTS\x10\t\x12\x11\n\rWEB_DETECTION\x10\n\x12\x12\n\x0ePRODUCT_SEARCH\x10\x0c\x12\x17\n\x13OBJECT_LOCALIZATION\x10\x13"7\n\x0bImageSource\x12\x15\n\rgcs_image_uri\x18\x01 \x01(\t\x12\x11\n\timage_uri\x18\x02 \x01(\t"T\n\x05Image\x12\x0f\n\x07\x63ontent\x18\x01 \x01(\x0c\x12:\n\x06source\x18\x02 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.ImageSource"\xed\x0e\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x45\n\x10\x66\x64_bounding_poly\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12I\n\tlandmarks\x18\x03 \x03(\x0b\x32\x36.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark\x12\x12\n\nroll_angle\x18\x04 \x01(\x02\x12\x11\n\tpan_angle\x18\x05 \x01(\x02\x12\x12\n\ntilt_angle\x18\x06 \x01(\x02\x12\x1c\n\x14\x64\x65tection_confidence\x18\x07 \x01(\x02\x12\x1e\n\x16landmarking_confidence\x18\x08 \x01(\x02\x12\x41\n\x0ejoy_likelihood\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x44\n\x11sorrow_likelihood\x18\n \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x43\n\x10\x61nger_likelihood\x18\x0b \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13surprise_likelihood\x18\x0c \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12K\n\x18under_exposed_likelihood\x18\r \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x45\n\x12\x62lurred_likelihood\x18\x0e \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x46\n\x13headwear_likelihood\x18\x0f \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12P\n\x12recognition_result\x18\x10 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionResult\x1a\xc7\x07\n\x08Landmark\x12I\n\x04type\x18\x03 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type\x12\x39\n\x08position\x18\x04 \x01(\x0b\x32\'.google.cloud.vision.v1p4beta1.Position"\xb4\x06\n\x04Type\x12\x14\n\x10UNKNOWN_LANDMARK\x10\x00\x12\x0c\n\x08LEFT_EYE\x10\x01\x12\r\n\tRIGHT_EYE\x10\x02\x12\x18\n\x14LEFT_OF_LEFT_EYEBROW\x10\x03\x12\x19\n\x15RIGHT_OF_LEFT_EYEBROW\x10\x04\x12\x19\n\x15LEFT_OF_RIGHT_EYEBROW\x10\x05\x12\x1a\n\x16RIGHT_OF_RIGHT_EYEBROW\x10\x06\x12\x19\n\x15MIDPOINT_BETWEEN_EYES\x10\x07\x12\x0c\n\x08NOSE_TIP\x10\x08\x12\r\n\tUPPER_LIP\x10\t\x12\r\n\tLOWER_LIP\x10\n\x12\x0e\n\nMOUTH_LEFT\x10\x0b\x12\x0f\n\x0bMOUTH_RIGHT\x10\x0c\x12\x10\n\x0cMOUTH_CENTER\x10\r\x12\x15\n\x11NOSE_BOTTOM_RIGHT\x10\x0e\x12\x14\n\x10NOSE_BOTTOM_LEFT\x10\x0f\x12\x16\n\x12NOSE_BOTTOM_CENTER\x10\x10\x12\x19\n\x15LEFT_EYE_TOP_BOUNDARY\x10\x11\x12\x19\n\x15LEFT_EYE_RIGHT_CORNER\x10\x12\x12\x1c\n\x18LEFT_EYE_BOTTOM_BOUNDARY\x10\x13\x12\x18\n\x14LEFT_EYE_LEFT_CORNER\x10\x14\x12\x1a\n\x16RIGHT_EYE_TOP_BOUNDARY\x10\x15\x12\x1a\n\x16RIGHT_EYE_RIGHT_CORNER\x10\x16\x12\x1d\n\x19RIGHT_EYE_BOTTOM_BOUNDARY\x10\x17\x12\x19\n\x15RIGHT_EYE_LEFT_CORNER\x10\x18\x12\x1f\n\x1bLEFT_EYEBROW_UPPER_MIDPOINT\x10\x19\x12 \n\x1cRIGHT_EYEBROW_UPPER_MIDPOINT\x10\x1a\x12\x14\n\x10LEFT_EAR_TRAGION\x10\x1b\x12\x15\n\x11RIGHT_EAR_TRAGION\x10\x1c\x12\x12\n\x0eLEFT_EYE_PUPIL\x10\x1d\x12\x13\n\x0fRIGHT_EYE_PUPIL\x10\x1e\x12\x15\n\x11\x46OREHEAD_GLABELLA\x10\x1f\x12\x11\n\rCHIN_GNATHION\x10 \x12\x14\n\x10\x43HIN_LEFT_GONION\x10!\x12\x15\n\x11\x43HIN_RIGHT_GONION\x10""4\n\x0cLocationInfo\x12$\n\x07lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng"=\n\x08Property\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t\x12\x14\n\x0cuint64_value\x18\x03 \x01(\x04"\xc0\x02\n\x10\x45ntityAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x0e\n\x06locale\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x16\n\nconfidence\x18\x05 \x01(\x02\x42\x02\x18\x01\x12\x12\n\ntopicality\x18\x06 \x01(\x02\x12\x42\n\rbounding_poly\x18\x07 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12>\n\tlocations\x18\x08 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.LocationInfo\x12;\n\nproperties\x18\t \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.Property"\xa0\x01\n\x19LocalizedObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x12\x42\n\rbounding_poly\x18\x05 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly"\xbc\x02\n\x14SafeSearchAnnotation\x12\x38\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x38\n\x05spoof\x18\x02 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12:\n\x07medical\x18\x03 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12;\n\x08violence\x18\x04 \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood\x12\x37\n\x04racy\x18\t \x01(\x0e\x32).google.cloud.vision.v1p4beta1.Likelihood"a\n\x0bLatLongRect\x12(\n\x0bmin_lat_lng\x18\x01 \x01(\x0b\x32\x13.google.type.LatLng\x12(\n\x0bmax_lat_lng\x18\x02 \x01(\x0b\x32\x13.google.type.LatLng"U\n\tColorInfo\x12!\n\x05\x63olor\x18\x01 \x01(\x0b\x32\x12.google.type.Color\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x16\n\x0epixel_fraction\x18\x03 \x01(\x02"T\n\x18\x44ominantColorsAnnotation\x12\x38\n\x06\x63olors\x18\x01 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.ColorInfo"c\n\x0fImageProperties\x12P\n\x0f\x64ominant_colors\x18\x01 \x01(\x0b\x32\x37.google.cloud.vision.v1p4beta1.DominantColorsAnnotation"\x7f\n\x08\x43ropHint\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x1b\n\x13importance_fraction\x18\x03 \x01(\x02"R\n\x13\x43ropHintsAnnotation\x12;\n\ncrop_hints\x18\x01 \x03(\x0b\x32\'.google.cloud.vision.v1p4beta1.CropHint"(\n\x0f\x43ropHintsParams\x12\x15\n\raspect_ratios\x18\x01 \x03(\x02"1\n\x12WebDetectionParams\x12\x1b\n\x13include_geo_results\x18\x02 \x01(\x08"\xaf\x03\n\x0cImageContext\x12\x41\n\rlat_long_rect\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.LatLongRect\x12\x16\n\x0elanguage_hints\x18\x02 \x03(\t\x12I\n\x11\x63rop_hints_params\x18\x04 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.CropHintsParams\x12U\n\x17\x66\x61\x63\x65_recognition_params\x18\n \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.FaceRecognitionParams\x12Q\n\x15product_search_params\x18\x05 \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.ProductSearchParams\x12O\n\x14web_detection_params\x18\x06 \x01(\x0b\x32\x31.google.cloud.vision.v1p4beta1.WebDetectionParams"\xc9\x01\n\x14\x41nnotateImageRequest\x12\x33\n\x05image\x18\x01 \x01(\x0b\x32$.google.cloud.vision.v1p4beta1.Image\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext":\n\x16ImageAnnotationContext\x12\x0b\n\x03uri\x18\x01 \x01(\t\x12\x13\n\x0bpage_number\x18\x02 \x01(\x05"\xbf\x08\n\x15\x41nnotateImageResponse\x12G\n\x10\x66\x61\x63\x65_annotations\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.FaceAnnotation\x12M\n\x14landmark_annotations\x18\x02 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12I\n\x10logo_annotations\x18\x03 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12J\n\x11label_annotations\x18\x04 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12^\n\x1clocalized_object_annotations\x18\x16 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation\x12I\n\x10text_annotations\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.EntityAnnotation\x12K\n\x14\x66ull_text_annotation\x18\x0c \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.TextAnnotation\x12S\n\x16safe_search_annotation\x18\x06 \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.SafeSearchAnnotation\x12S\n\x1bimage_properties_annotation\x18\x08 \x01(\x0b\x32..google.cloud.vision.v1p4beta1.ImageProperties\x12Q\n\x15\x63rop_hints_annotation\x18\x0b \x01(\x0b\x32\x32.google.cloud.vision.v1p4beta1.CropHintsAnnotation\x12\x42\n\rweb_detection\x18\r \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.WebDetection\x12S\n\x16product_search_results\x18\x0e \x01(\x0b\x32\x33.google.cloud.vision.v1p4beta1.ProductSearchResults\x12!\n\x05\x65rror\x18\t \x01(\x0b\x32\x12.google.rpc.Status\x12\x46\n\x07\x63ontext\x18\x15 \x01(\x0b\x32\x35.google.cloud.vision.v1p4beta1.ImageAnnotationContext"c\n\x1a\x42\x61tchAnnotateImagesRequest\x12\x45\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequest"f\n\x1b\x42\x61tchAnnotateImagesResponse\x12G\n\tresponses\x18\x01 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse"\xe4\x01\n\x13\x41nnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\r\n\x05pages\x18\x04 \x03(\x05"\xd9\x01\n\x14\x41nnotateFileResponse\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12G\n\tresponses\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.AnnotateImageResponse\x12\x13\n\x0btotal_pages\x18\x03 \x01(\x05\x12!\n\x05\x65rror\x18\x04 \x01(\x0b\x32\x12.google.rpc.Status"f\n\x19\x42\x61tchAnnotateFilesRequest\x12I\n\x08requests\x18\x01 \x03(\x0b\x32\x32.google.cloud.vision.v1p4beta1.AnnotateFileRequestB\x03\xe0\x41\x02"d\n\x1a\x42\x61tchAnnotateFilesResponse\x12\x46\n\tresponses\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateFileResponse"\x9e\x02\n\x18\x41syncAnnotateFileRequest\x12@\n\x0cinput_config\x18\x01 \x01(\x0b\x32*.google.cloud.vision.v1p4beta1.InputConfig\x12\x38\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Feature\x12\x42\n\rimage_context\x18\x03 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.ImageContext\x12\x42\n\routput_config\x18\x04 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig"_\n\x19\x41syncAnnotateFileResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig"\xb6\x01\n\x1f\x41syncBatchAnnotateImagesRequest\x12J\n\x08requests\x18\x01 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.AnnotateImageRequestB\x03\xe0\x41\x02\x12G\n\routput_config\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfigB\x03\xe0\x41\x02"f\n AsyncBatchAnnotateImagesResponse\x12\x42\n\routput_config\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.OutputConfig"p\n\x1e\x41syncBatchAnnotateFilesRequest\x12N\n\x08requests\x18\x01 \x03(\x0b\x32\x37.google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequestB\x03\xe0\x41\x02"n\n\x1f\x41syncBatchAnnotateFilesResponse\x12K\n\tresponses\x18\x01 \x03(\x0b\x32\x38.google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse"o\n\x0bInputConfig\x12<\n\ngcs_source\x18\x01 \x01(\x0b\x32(.google.cloud.vision.v1p4beta1.GcsSource\x12\x0f\n\x07\x63ontent\x18\x03 \x01(\x0c\x12\x11\n\tmime_type\x18\x02 \x01(\t"j\n\x0cOutputConfig\x12\x46\n\x0fgcs_destination\x18\x01 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.GcsDestination\x12\x12\n\nbatch_size\x18\x02 \x01(\x05"\x18\n\tGcsSource\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x1d\n\x0eGcsDestination\x12\x0b\n\x03uri\x18\x01 \x01(\t"\x8f\x02\n\x11OperationMetadata\x12\x45\n\x05state\x18\x01 \x01(\x0e\x32\x36.google.cloud.vision.v1p4beta1.OperationMetadata.State\x12/\n\x0b\x63reate_time\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Q\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0b\n\x07\x43REATED\x10\x01\x12\x0b\n\x07RUNNING\x10\x02\x12\x08\n\x04\x44ONE\x10\x03\x12\r\n\tCANCELLED\x10\x04*e\n\nLikelihood\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x11\n\rVERY_UNLIKELY\x10\x01\x12\x0c\n\x08UNLIKELY\x10\x02\x12\x0c\n\x08POSSIBLE\x10\x03\x12\n\n\x06LIKELY\x10\x04\x12\x0f\n\x0bVERY_LIKELY\x10\x05\x32\xf1\x07\n\x0eImageAnnotator\x12\xbe\x01\n\x13\x42\x61tchAnnotateImages\x12\x39.google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest\x1a:.google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse"0\x82\xd3\xe4\x93\x02\x1f"\x1a/v1p4beta1/images:annotate:\x01*\xda\x41\x08requests\x12\xba\x01\n\x12\x42\x61tchAnnotateFiles\x12\x38.google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest\x1a\x39.google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse"/\x82\xd3\xe4\x93\x02\x1e"\x19/v1p4beta1/files:annotate:\x01*\xda\x41\x08requests\x12\xfc\x01\n\x18\x41syncBatchAnnotateImages\x12>.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest\x1a\x1d.google.longrunning.Operation"\x80\x01\x82\xd3\xe4\x93\x02)"$/v1p4beta1/images:asyncBatchAnnotate:\x01*\xda\x41\x16requests,output_config\xca\x41\x35\n AsyncBatchAnnotateImagesResponse\x12\x11OperationMetadata\x12\xe9\x01\n\x17\x41syncBatchAnnotateFiles\x12=.google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest\x1a\x1d.google.longrunning.Operation"p\x82\xd3\xe4\x93\x02("#/v1p4beta1/files:asyncBatchAnnotate:\x01*\xda\x41\x08requests\xca\x41\x34\n\x1f\x41syncBatchAnnotateFilesResponse\x12\x11OperationMetadata\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x89\x01\n!com.google.cloud.vision.v1p4beta1B\x13ImageAnnotatorProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_face__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_text__annotation__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_web__detection__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - google_dot_type_dot_color__pb2.DESCRIPTOR, - google_dot_type_dot_latlng__pb2.DESCRIPTOR, - ], -) - -_LIKELIHOOD = _descriptor.EnumDescriptor( - name="Likelihood", - full_name="google.cloud.vision.v1p4beta1.Likelihood", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_UNLIKELY", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UNLIKELY", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="POSSIBLE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LIKELY", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="VERY_LIKELY", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=8786, - serialized_end=8887, -) -_sym_db.RegisterEnumDescriptor(_LIKELIHOOD) - -Likelihood = enum_type_wrapper.EnumTypeWrapper(_LIKELIHOOD) -UNKNOWN = 0 -VERY_UNLIKELY = 1 -UNLIKELY = 2 -POSSIBLE = 3 -LIKELY = 4 -VERY_LIKELY = 5 - - -_FEATURE_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p4beta1.Feature.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="TYPE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FACE_DETECTION", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LANDMARK_DETECTION", - index=2, - number=2, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LOGO_DETECTION", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LABEL_DETECTION", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="TEXT_DETECTION", index=5, number=5, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DOCUMENT_TEXT_DETECTION", - index=6, - number=11, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="SAFE_SEARCH_DETECTION", - index=7, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="IMAGE_PROPERTIES", - index=8, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CROP_HINTS", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="WEB_DETECTION", - index=10, - number=10, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PRODUCT_SEARCH", - index=11, - number=12, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="OBJECT_LOCALIZATION", - index=12, - number=19, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=742, - serialized_end=1033, -) -_sym_db.RegisterEnumDescriptor(_FEATURE_TYPE) - -_FACEANNOTATION_LANDMARK_TYPE = _descriptor.EnumDescriptor( - name="Type", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.Type", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN_LANDMARK", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_LEFT_EYEBROW", - index=3, - number=3, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_LEFT_EYEBROW", - index=4, - number=4, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_OF_RIGHT_EYEBROW", - index=5, - number=5, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_OF_RIGHT_EYEBROW", - index=6, - number=6, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="MIDPOINT_BETWEEN_EYES", - index=7, - number=7, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_TIP", index=8, number=8, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="UPPER_LIP", index=9, number=9, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LOWER_LIP", index=10, number=10, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_LEFT", index=11, number=11, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_RIGHT", index=12, number=12, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="MOUTH_CENTER", index=13, number=13, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_RIGHT", - index=14, - number=14, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_LEFT", - index=15, - number=15, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="NOSE_BOTTOM_CENTER", - index=16, - number=16, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_TOP_BOUNDARY", - index=17, - number=17, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_RIGHT_CORNER", - index=18, - number=18, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_BOTTOM_BOUNDARY", - index=19, - number=19, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_LEFT_CORNER", - index=20, - number=20, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_TOP_BOUNDARY", - index=21, - number=21, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_RIGHT_CORNER", - index=22, - number=22, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_BOTTOM_BOUNDARY", - index=23, - number=23, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_LEFT_CORNER", - index=24, - number=24, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYEBROW_UPPER_MIDPOINT", - index=25, - number=25, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYEBROW_UPPER_MIDPOINT", - index=26, - number=26, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EAR_TRAGION", - index=27, - number=27, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EAR_TRAGION", - index=28, - number=28, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="LEFT_EYE_PUPIL", - index=29, - number=29, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="RIGHT_EYE_PUPIL", - index=30, - number=30, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="FOREHEAD_GLABELLA", - index=31, - number=31, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_GNATHION", - index=32, - number=32, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_LEFT_GONION", - index=33, - number=33, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CHIN_RIGHT_GONION", - index=34, - number=34, - serialized_options=None, - type=None, - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=2260, - serialized_end=3080, -) -_sym_db.RegisterEnumDescriptor(_FACEANNOTATION_LANDMARK_TYPE) - -_OPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.vision.v1p4beta1.OperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="CREATED", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RUNNING", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="DONE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=8703, - serialized_end=8784, -) -_sym_db.RegisterEnumDescriptor(_OPERATIONMETADATA_STATE) - - -_FEATURE = _descriptor.Descriptor( - name="Feature", - full_name="google.cloud.vision.v1p4beta1.Feature", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p4beta1.Feature.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_results", - full_name="google.cloud.vision.v1p4beta1.Feature.max_results", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="model", - full_name="google.cloud.vision.v1p4beta1.Feature.model", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FEATURE_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=635, - serialized_end=1033, -) - - -_IMAGESOURCE = _descriptor.Descriptor( - name="ImageSource", - full_name="google.cloud.vision.v1p4beta1.ImageSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_image_uri", - full_name="google.cloud.vision.v1p4beta1.ImageSource.gcs_image_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_uri", - full_name="google.cloud.vision.v1p4beta1.ImageSource.image_uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1035, - serialized_end=1090, -) - - -_IMAGE = _descriptor.Descriptor( - name="Image", - full_name="google.cloud.vision.v1p4beta1.Image", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.vision.v1p4beta1.Image.content", - index=0, - number=1, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="source", - full_name="google.cloud.vision.v1p4beta1.Image.source", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1092, - serialized_end=1176, -) - - -_FACEANNOTATION_LANDMARK = _descriptor.Descriptor( - name="Landmark", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.type", - index=0, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="position", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark.position", - index=1, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_FACEANNOTATION_LANDMARK_TYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2113, - serialized_end=3080, -) - -_FACEANNOTATION = _descriptor.Descriptor( - name="FaceAnnotation", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="fd_bounding_poly", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.fd_bounding_poly", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarks", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.landmarks", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="roll_angle", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.roll_angle", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pan_angle", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.pan_angle", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="tilt_angle", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.tilt_angle", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detection_confidence", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.detection_confidence", - index=6, - number=7, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmarking_confidence", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.landmarking_confidence", - index=7, - number=8, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="joy_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.joy_likelihood", - index=8, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="sorrow_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.sorrow_likelihood", - index=9, - number=10, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="anger_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.anger_likelihood", - index=10, - number=11, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="surprise_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.surprise_likelihood", - index=11, - number=12, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="under_exposed_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.under_exposed_likelihood", - index=12, - number=13, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blurred_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.blurred_likelihood", - index=13, - number=14, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="headwear_likelihood", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.headwear_likelihood", - index=14, - number=15, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="recognition_result", - full_name="google.cloud.vision.v1p4beta1.FaceAnnotation.recognition_result", - index=15, - number=16, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_FACEANNOTATION_LANDMARK], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1179, - serialized_end=3080, -) - - -_LOCATIONINFO = _descriptor.Descriptor( - name="LocationInfo", - full_name="google.cloud.vision.v1p4beta1.LocationInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_lng", - full_name="google.cloud.vision.v1p4beta1.LocationInfo.lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3082, - serialized_end=3134, -) - - -_PROPERTY = _descriptor.Descriptor( - name="Property", - full_name="google.cloud.vision.v1p4beta1.Property", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.Property.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p4beta1.Property.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uint64_value", - full_name="google.cloud.vision.v1p4beta1.Property.uint64_value", - index=2, - number=3, - type=4, - cpp_type=4, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3136, - serialized_end=3197, -) - - -_ENTITYANNOTATION = _descriptor.Descriptor( - name="EntityAnnotation", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locale", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.locale", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\030\001"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="topicality", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.topicality", - index=5, - number=6, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.bounding_poly", - index=6, - number=7, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="locations", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.locations", - index=7, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="properties", - full_name="google.cloud.vision.v1p4beta1.EntityAnnotation.properties", - index=8, - number=9, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3200, - serialized_end=3520, -) - - -_LOCALIZEDOBJECTANNOTATION = _descriptor.Descriptor( - name="LocalizedObjectAnnotation", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation.bounding_poly", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3523, - serialized_end=3683, -) - - -_SAFESEARCHANNOTATION = _descriptor.Descriptor( - name="SafeSearchAnnotation", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="adult", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation.adult", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="spoof", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation.spoof", - index=1, - number=2, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="medical", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation.medical", - index=2, - number=3, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="violence", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation.violence", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="racy", - full_name="google.cloud.vision.v1p4beta1.SafeSearchAnnotation.racy", - index=4, - number=9, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3686, - serialized_end=4002, -) - - -_LATLONGRECT = _descriptor.Descriptor( - name="LatLongRect", - full_name="google.cloud.vision.v1p4beta1.LatLongRect", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="min_lat_lng", - full_name="google.cloud.vision.v1p4beta1.LatLongRect.min_lat_lng", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="max_lat_lng", - full_name="google.cloud.vision.v1p4beta1.LatLongRect.max_lat_lng", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4004, - serialized_end=4101, -) - - -_COLORINFO = _descriptor.Descriptor( - name="ColorInfo", - full_name="google.cloud.vision.v1p4beta1.ColorInfo", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="color", - full_name="google.cloud.vision.v1p4beta1.ColorInfo.color", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.ColorInfo.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pixel_fraction", - full_name="google.cloud.vision.v1p4beta1.ColorInfo.pixel_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4103, - serialized_end=4188, -) - - -_DOMINANTCOLORSANNOTATION = _descriptor.Descriptor( - name="DominantColorsAnnotation", - full_name="google.cloud.vision.v1p4beta1.DominantColorsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="colors", - full_name="google.cloud.vision.v1p4beta1.DominantColorsAnnotation.colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4190, - serialized_end=4274, -) - - -_IMAGEPROPERTIES = _descriptor.Descriptor( - name="ImageProperties", - full_name="google.cloud.vision.v1p4beta1.ImageProperties", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="dominant_colors", - full_name="google.cloud.vision.v1p4beta1.ImageProperties.dominant_colors", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4276, - serialized_end=4375, -) - - -_CROPHINT = _descriptor.Descriptor( - name="CropHint", - full_name="google.cloud.vision.v1p4beta1.CropHint", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.CropHint.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.CropHint.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="importance_fraction", - full_name="google.cloud.vision.v1p4beta1.CropHint.importance_fraction", - index=2, - number=3, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4377, - serialized_end=4504, -) - - -_CROPHINTSANNOTATION = _descriptor.Descriptor( - name="CropHintsAnnotation", - full_name="google.cloud.vision.v1p4beta1.CropHintsAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="crop_hints", - full_name="google.cloud.vision.v1p4beta1.CropHintsAnnotation.crop_hints", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4506, - serialized_end=4588, -) - - -_CROPHINTSPARAMS = _descriptor.Descriptor( - name="CropHintsParams", - full_name="google.cloud.vision.v1p4beta1.CropHintsParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="aspect_ratios", - full_name="google.cloud.vision.v1p4beta1.CropHintsParams.aspect_ratios", - index=0, - number=1, - type=2, - cpp_type=6, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4590, - serialized_end=4630, -) - - -_WEBDETECTIONPARAMS = _descriptor.Descriptor( - name="WebDetectionParams", - full_name="google.cloud.vision.v1p4beta1.WebDetectionParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="include_geo_results", - full_name="google.cloud.vision.v1p4beta1.WebDetectionParams.include_geo_results", - index=0, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4632, - serialized_end=4681, -) - - -_IMAGECONTEXT = _descriptor.Descriptor( - name="ImageContext", - full_name="google.cloud.vision.v1p4beta1.ImageContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="lat_long_rect", - full_name="google.cloud.vision.v1p4beta1.ImageContext.lat_long_rect", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_hints", - full_name="google.cloud.vision.v1p4beta1.ImageContext.language_hints", - index=1, - number=2, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_params", - full_name="google.cloud.vision.v1p4beta1.ImageContext.crop_hints_params", - index=2, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="face_recognition_params", - full_name="google.cloud.vision.v1p4beta1.ImageContext.face_recognition_params", - index=3, - number=10, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_search_params", - full_name="google.cloud.vision.v1p4beta1.ImageContext.product_search_params", - index=4, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection_params", - full_name="google.cloud.vision.v1p4beta1.ImageContext.web_detection_params", - index=5, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4684, - serialized_end=5115, -) - - -_ANNOTATEIMAGEREQUEST = _descriptor.Descriptor( - name="AnnotateImageRequest", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageRequest.image", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5118, - serialized_end=5319, -) - - -_IMAGEANNOTATIONCONTEXT = _descriptor.Descriptor( - name="ImageAnnotationContext", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotationContext", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotationContext.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_number", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotationContext.page_number", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5321, - serialized_end=5379, -) - - -_ANNOTATEIMAGERESPONSE = _descriptor.Descriptor( - name="AnnotateImageResponse", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="face_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.face_annotations", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="landmark_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.landmark_annotations", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="logo_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.logo_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="label_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.label_annotations", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="localized_object_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.localized_object_annotations", - index=4, - number=22, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text_annotations", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.text_annotations", - index=5, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_text_annotation", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.full_text_annotation", - index=6, - number=12, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="safe_search_annotation", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.safe_search_annotation", - index=7, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_properties_annotation", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.image_properties_annotation", - index=8, - number=8, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="crop_hints_annotation", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.crop_hints_annotation", - index=9, - number=11, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="web_detection", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.web_detection", - index=10, - number=13, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_search_results", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.product_search_results", - index=11, - number=14, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.error", - index=12, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="context", - full_name="google.cloud.vision.v1p4beta1.AnnotateImageResponse.context", - index=13, - number=21, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=5382, - serialized_end=6469, -) - - -_BATCHANNOTATEIMAGESREQUEST = _descriptor.Descriptor( - name="BatchAnnotateImagesRequest", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6471, - serialized_end=6570, -) - - -_BATCHANNOTATEIMAGESRESPONSE = _descriptor.Descriptor( - name="BatchAnnotateImagesResponse", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6572, - serialized_end=6674, -) - - -_ANNOTATEFILEREQUEST = _descriptor.Descriptor( - name="AnnotateFileRequest", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileRequest.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileRequest.pages", - index=3, - number=4, - type=5, - cpp_type=1, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6677, - serialized_end=6905, -) - - -_ANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AnnotateFileResponse", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileResponse.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileResponse.responses", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="total_pages", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileResponse.total_pages", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="error", - full_name="google.cloud.vision.v1p4beta1.AnnotateFileResponse.error", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=6908, - serialized_end=7125, -) - - -_BATCHANNOTATEFILESREQUEST = _descriptor.Descriptor( - name="BatchAnnotateFilesRequest", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7127, - serialized_end=7229, -) - - -_BATCHANNOTATEFILESRESPONSE = _descriptor.Descriptor( - name="BatchAnnotateFilesResponse", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7231, - serialized_end=7331, -) - - -_ASYNCANNOTATEFILEREQUEST = _descriptor.Descriptor( - name="AsyncAnnotateFileRequest", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.input_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="features", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.features", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image_context", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.image_context", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest.output_config", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7334, - serialized_end=7620, -) - - -_ASYNCANNOTATEFILERESPONSE = _descriptor.Descriptor( - name="AsyncAnnotateFileResponse", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse.output_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7622, - serialized_end=7717, -) - - -_ASYNCBATCHANNOTATEIMAGESREQUEST = _descriptor.Descriptor( - name="AsyncBatchAnnotateImagesRequest", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest.output_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7720, - serialized_end=7902, -) - - -_ASYNCBATCHANNOTATEIMAGESRESPONSE = _descriptor.Descriptor( - name="AsyncBatchAnnotateImagesResponse", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="output_config", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse.output_config", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=7904, - serialized_end=8006, -) - - -_ASYNCBATCHANNOTATEFILESREQUEST = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesRequest", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="requests", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest.requests", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8008, - serialized_end=8120, -) - - -_ASYNCBATCHANNOTATEFILESRESPONSE = _descriptor.Descriptor( - name="AsyncBatchAnnotateFilesResponse", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="responses", - full_name="google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse.responses", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8122, - serialized_end=8232, -) - - -_INPUTCONFIG = _descriptor.Descriptor( - name="InputConfig", - full_name="google.cloud.vision.v1p4beta1.InputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.vision.v1p4beta1.InputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="content", - full_name="google.cloud.vision.v1p4beta1.InputConfig.content", - index=1, - number=3, - type=12, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b(""), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="mime_type", - full_name="google.cloud.vision.v1p4beta1.InputConfig.mime_type", - index=2, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8234, - serialized_end=8345, -) - - -_OUTPUTCONFIG = _descriptor.Descriptor( - name="OutputConfig", - full_name="google.cloud.vision.v1p4beta1.OutputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_destination", - full_name="google.cloud.vision.v1p4beta1.OutputConfig.gcs_destination", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="batch_size", - full_name="google.cloud.vision.v1p4beta1.OutputConfig.batch_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8347, - serialized_end=8453, -) - - -_GCSSOURCE = _descriptor.Descriptor( - name="GcsSource", - full_name="google.cloud.vision.v1p4beta1.GcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p4beta1.GcsSource.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8455, - serialized_end=8479, -) - - -_GCSDESTINATION = _descriptor.Descriptor( - name="GcsDestination", - full_name="google.cloud.vision.v1p4beta1.GcsDestination", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p4beta1.GcsDestination.uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8481, - serialized_end=8510, -) - - -_OPERATIONMETADATA = _descriptor.Descriptor( - name="OperationMetadata", - full_name="google.cloud.vision.v1p4beta1.OperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.vision.v1p4beta1.OperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="create_time", - full_name="google.cloud.vision.v1p4beta1.OperationMetadata.create_time", - index=1, - number=5, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_time", - full_name="google.cloud.vision.v1p4beta1.OperationMetadata.update_time", - index=2, - number=6, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_OPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=8513, - serialized_end=8784, -) - -_FEATURE.fields_by_name["type"].enum_type = _FEATURE_TYPE -_FEATURE_TYPE.containing_type = _FEATURE -_IMAGE.fields_by_name["source"].message_type = _IMAGESOURCE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "type" -].enum_type = _FACEANNOTATION_LANDMARK_TYPE -_FACEANNOTATION_LANDMARK.fields_by_name[ - "position" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._POSITION -) -_FACEANNOTATION_LANDMARK.containing_type = _FACEANNOTATION -_FACEANNOTATION_LANDMARK_TYPE.containing_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name[ - "fd_bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_FACEANNOTATION.fields_by_name["landmarks"].message_type = _FACEANNOTATION_LANDMARK -_FACEANNOTATION.fields_by_name["joy_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["sorrow_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["anger_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["surprise_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["under_exposed_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["blurred_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name["headwear_likelihood"].enum_type = _LIKELIHOOD -_FACEANNOTATION.fields_by_name[ - "recognition_result" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_face__pb2._FACERECOGNITIONRESULT -) -_LOCATIONINFO.fields_by_name[ - "lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_ENTITYANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_ENTITYANNOTATION.fields_by_name["locations"].message_type = _LOCATIONINFO -_ENTITYANNOTATION.fields_by_name["properties"].message_type = _PROPERTY -_LOCALIZEDOBJECTANNOTATION.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_SAFESEARCHANNOTATION.fields_by_name["adult"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["spoof"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["medical"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["violence"].enum_type = _LIKELIHOOD -_SAFESEARCHANNOTATION.fields_by_name["racy"].enum_type = _LIKELIHOOD -_LATLONGRECT.fields_by_name[ - "min_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_LATLONGRECT.fields_by_name[ - "max_lat_lng" -].message_type = google_dot_type_dot_latlng__pb2._LATLNG -_COLORINFO.fields_by_name["color"].message_type = google_dot_type_dot_color__pb2._COLOR -_DOMINANTCOLORSANNOTATION.fields_by_name["colors"].message_type = _COLORINFO -_IMAGEPROPERTIES.fields_by_name[ - "dominant_colors" -].message_type = _DOMINANTCOLORSANNOTATION -_CROPHINT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CROPHINTSANNOTATION.fields_by_name["crop_hints"].message_type = _CROPHINT -_IMAGECONTEXT.fields_by_name["lat_long_rect"].message_type = _LATLONGRECT -_IMAGECONTEXT.fields_by_name["crop_hints_params"].message_type = _CROPHINTSPARAMS -_IMAGECONTEXT.fields_by_name[ - "face_recognition_params" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_face__pb2._FACERECOGNITIONPARAMS -) -_IMAGECONTEXT.fields_by_name[ - "product_search_params" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__pb2._PRODUCTSEARCHPARAMS -) -_IMAGECONTEXT.fields_by_name["web_detection_params"].message_type = _WEBDETECTIONPARAMS -_ANNOTATEIMAGEREQUEST.fields_by_name["image"].message_type = _IMAGE -_ANNOTATEIMAGEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ANNOTATEIMAGEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ANNOTATEIMAGERESPONSE.fields_by_name["face_annotations"].message_type = _FACEANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "landmark_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "logo_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "label_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "localized_object_annotations" -].message_type = _LOCALIZEDOBJECTANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "text_annotations" -].message_type = _ENTITYANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "full_text_annotation" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_text__annotation__pb2._TEXTANNOTATION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "safe_search_annotation" -].message_type = _SAFESEARCHANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "image_properties_annotation" -].message_type = _IMAGEPROPERTIES -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "crop_hints_annotation" -].message_type = _CROPHINTSANNOTATION -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "web_detection" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_web__detection__pb2._WEBDETECTION -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "product_search_results" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__pb2._PRODUCTSEARCHRESULTS -) -_ANNOTATEIMAGERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_ANNOTATEIMAGERESPONSE.fields_by_name["context"].message_type = _IMAGEANNOTATIONCONTEXT -_BATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEIMAGEREQUEST -_BATCHANNOTATEIMAGESRESPONSE.fields_by_name[ - "responses" -].message_type = _ANNOTATEIMAGERESPONSE -_ANNOTATEFILEREQUEST.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ANNOTATEFILEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ANNOTATEFILEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ANNOTATEFILERESPONSE.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ANNOTATEFILERESPONSE.fields_by_name["responses"].message_type = _ANNOTATEIMAGERESPONSE -_ANNOTATEFILERESPONSE.fields_by_name[ - "error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_BATCHANNOTATEFILESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEFILEREQUEST -_BATCHANNOTATEFILESRESPONSE.fields_by_name[ - "responses" -].message_type = _ANNOTATEFILERESPONSE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["input_config"].message_type = _INPUTCONFIG -_ASYNCANNOTATEFILEREQUEST.fields_by_name["features"].message_type = _FEATURE -_ASYNCANNOTATEFILEREQUEST.fields_by_name["image_context"].message_type = _IMAGECONTEXT -_ASYNCANNOTATEFILEREQUEST.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCANNOTATEFILERESPONSE.fields_by_name["output_config"].message_type = _OUTPUTCONFIG -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "requests" -].message_type = _ANNOTATEIMAGEREQUEST -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name[ - "output_config" -].message_type = _OUTPUTCONFIG -_ASYNCBATCHANNOTATEIMAGESRESPONSE.fields_by_name[ - "output_config" -].message_type = _OUTPUTCONFIG -_ASYNCBATCHANNOTATEFILESREQUEST.fields_by_name[ - "requests" -].message_type = _ASYNCANNOTATEFILEREQUEST -_ASYNCBATCHANNOTATEFILESRESPONSE.fields_by_name[ - "responses" -].message_type = _ASYNCANNOTATEFILERESPONSE -_INPUTCONFIG.fields_by_name["gcs_source"].message_type = _GCSSOURCE -_OUTPUTCONFIG.fields_by_name["gcs_destination"].message_type = _GCSDESTINATION -_OPERATIONMETADATA.fields_by_name["state"].enum_type = _OPERATIONMETADATA_STATE -_OPERATIONMETADATA.fields_by_name[ - "create_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA.fields_by_name[ - "update_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_OPERATIONMETADATA_STATE.containing_type = _OPERATIONMETADATA -DESCRIPTOR.message_types_by_name["Feature"] = _FEATURE -DESCRIPTOR.message_types_by_name["ImageSource"] = _IMAGESOURCE -DESCRIPTOR.message_types_by_name["Image"] = _IMAGE -DESCRIPTOR.message_types_by_name["FaceAnnotation"] = _FACEANNOTATION -DESCRIPTOR.message_types_by_name["LocationInfo"] = _LOCATIONINFO -DESCRIPTOR.message_types_by_name["Property"] = _PROPERTY -DESCRIPTOR.message_types_by_name["EntityAnnotation"] = _ENTITYANNOTATION -DESCRIPTOR.message_types_by_name[ - "LocalizedObjectAnnotation" -] = _LOCALIZEDOBJECTANNOTATION -DESCRIPTOR.message_types_by_name["SafeSearchAnnotation"] = _SAFESEARCHANNOTATION -DESCRIPTOR.message_types_by_name["LatLongRect"] = _LATLONGRECT -DESCRIPTOR.message_types_by_name["ColorInfo"] = _COLORINFO -DESCRIPTOR.message_types_by_name["DominantColorsAnnotation"] = _DOMINANTCOLORSANNOTATION -DESCRIPTOR.message_types_by_name["ImageProperties"] = _IMAGEPROPERTIES -DESCRIPTOR.message_types_by_name["CropHint"] = _CROPHINT -DESCRIPTOR.message_types_by_name["CropHintsAnnotation"] = _CROPHINTSANNOTATION -DESCRIPTOR.message_types_by_name["CropHintsParams"] = _CROPHINTSPARAMS -DESCRIPTOR.message_types_by_name["WebDetectionParams"] = _WEBDETECTIONPARAMS -DESCRIPTOR.message_types_by_name["ImageContext"] = _IMAGECONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageRequest"] = _ANNOTATEIMAGEREQUEST -DESCRIPTOR.message_types_by_name["ImageAnnotationContext"] = _IMAGEANNOTATIONCONTEXT -DESCRIPTOR.message_types_by_name["AnnotateImageResponse"] = _ANNOTATEIMAGERESPONSE -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesRequest" -] = _BATCHANNOTATEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateImagesResponse" -] = _BATCHANNOTATEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name["AnnotateFileRequest"] = _ANNOTATEFILEREQUEST -DESCRIPTOR.message_types_by_name["AnnotateFileResponse"] = _ANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateFilesRequest" -] = _BATCHANNOTATEFILESREQUEST -DESCRIPTOR.message_types_by_name[ - "BatchAnnotateFilesResponse" -] = _BATCHANNOTATEFILESRESPONSE -DESCRIPTOR.message_types_by_name["AsyncAnnotateFileRequest"] = _ASYNCANNOTATEFILEREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncAnnotateFileResponse" -] = _ASYNCANNOTATEFILERESPONSE -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateImagesRequest" -] = _ASYNCBATCHANNOTATEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateImagesResponse" -] = _ASYNCBATCHANNOTATEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesRequest" -] = _ASYNCBATCHANNOTATEFILESREQUEST -DESCRIPTOR.message_types_by_name[ - "AsyncBatchAnnotateFilesResponse" -] = _ASYNCBATCHANNOTATEFILESRESPONSE -DESCRIPTOR.message_types_by_name["InputConfig"] = _INPUTCONFIG -DESCRIPTOR.message_types_by_name["OutputConfig"] = _OUTPUTCONFIG -DESCRIPTOR.message_types_by_name["GcsSource"] = _GCSSOURCE -DESCRIPTOR.message_types_by_name["GcsDestination"] = _GCSDESTINATION -DESCRIPTOR.message_types_by_name["OperationMetadata"] = _OPERATIONMETADATA -DESCRIPTOR.enum_types_by_name["Likelihood"] = _LIKELIHOOD -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Feature = _reflection.GeneratedProtocolMessageType( - "Feature", - (_message.Message,), - dict( - DESCRIPTOR=_FEATURE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The type of Google Cloud Vision API detection to perform, - and the maximum number of results to return for that type. Multiple - ``Feature`` objects can be specified in the ``features`` list. - - - Attributes: - type: - The feature type. - max_results: - Maximum number of results of this type. Does not apply to - ``TEXT_DETECTION``, ``DOCUMENT_TEXT_DETECTION``, or - ``CROP_HINTS``. - model: - Model to use for the feature. Supported values: - "builtin/stable" (the default if unset) and "builtin/latest". - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Feature) - ), -) -_sym_db.RegisterMessage(Feature) - -ImageSource = _reflection.GeneratedProtocolMessageType( - "ImageSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGESOURCE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""External image source (Google Cloud Storage or web URL - image location). - - - Attributes: - gcs_image_uri: - \ **Use ``image_uri`` instead.** The Google Cloud Storage URI - of the form ``gs://bucket_name/object_name``. Object - versioning is not supported. See `Google Cloud Storage Request - URIs `__ - for more info. - image_uri: - The URI of the source image. Can be either: 1. A Google Cloud - Storage URI of the form ``gs://bucket_name/object_name``. - Object versioning is not supported. See `Google Cloud - Storage Request URIs - `__ for - more info. 2. A publicly-accessible image HTTP/HTTPS URL. - When fetching images from HTTP/HTTPS URLs, Google cannot - guarantee that the request will be completed. Your request - may fail if the specified host denies the request (e.g. due - to request throttling or DOS prevention), or if Google - throttles requests to the site for abuse prevention. You - should not depend on externally-hosted images for production - applications. When both ``gcs_image_uri`` and ``image_uri`` - are specified, ``image_uri`` takes precedence. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageSource) - ), -) -_sym_db.RegisterMessage(ImageSource) - -Image = _reflection.GeneratedProtocolMessageType( - "Image", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Client image to perform Google Cloud Vision API tasks - over. - - - Attributes: - content: - Image content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - source: - Google Cloud Storage image location, or publicly-accessible - image URL. If both ``content`` and ``source`` are provided for - an image, ``content`` takes precedence and is used to perform - the image annotation request. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Image) - ), -) -_sym_db.RegisterMessage(Image) - -FaceAnnotation = _reflection.GeneratedProtocolMessageType( - "FaceAnnotation", - (_message.Message,), - dict( - Landmark=_reflection.GeneratedProtocolMessageType( - "Landmark", - (_message.Message,), - dict( - DESCRIPTOR=_FACEANNOTATION_LANDMARK, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A face-specific landmark (for example, a face feature). - - - Attributes: - type: - Face landmark type. - position: - Face landmark position. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceAnnotation.Landmark) - ), - ), - DESCRIPTOR=_FACEANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A face annotation object contains the results of face - detection. - - - Attributes: - bounding_poly: - The bounding polygon around the face. The coordinates of the - bounding box are in the original image's scale. The bounding - box is computed to "frame" the face in accordance with human - expectations. It is based on the landmarker results. Note that - one or more x and/or y coordinates may not be generated in the - ``BoundingPoly`` (the polygon will be unbounded) if only a - partial face appears in the image to be annotated. - fd_bounding_poly: - The ``fd_bounding_poly`` bounding polygon is tighter than the - ``boundingPoly``, and encloses only the skin part of the face. - Typically, it is used to eliminate the face from any image - analysis that detects the "amount of skin" visible in an - image. It is not based on the landmarker results, only on the - initial face detection, hence the fd (face detection) prefix. - landmarks: - Detected face landmarks. - roll_angle: - Roll angle, which indicates the amount of clockwise/anti- - clockwise rotation of the face relative to the image vertical - about the axis perpendicular to the face. Range [-180,180]. - pan_angle: - Yaw angle, which indicates the leftward/rightward angle that - the face is pointing relative to the vertical plane - perpendicular to the image. Range [-180,180]. - tilt_angle: - Pitch angle, which indicates the upwards/downwards angle that - the face is pointing relative to the image's horizontal plane. - Range [-180,180]. - detection_confidence: - Detection confidence. Range [0, 1]. - landmarking_confidence: - Face landmarking confidence. Range [0, 1]. - joy_likelihood: - Joy likelihood. - sorrow_likelihood: - Sorrow likelihood. - anger_likelihood: - Anger likelihood. - surprise_likelihood: - Surprise likelihood. - under_exposed_likelihood: - Under-exposed likelihood. - blurred_likelihood: - Blurred likelihood. - headwear_likelihood: - Headwear likelihood. - recognition_result: - Additional recognition information. Only computed if - image\_context.face\_recognition\_params is provided, **and** - a match is found to a - [Celebrity][google.cloud.vision.v1p4beta1.Celebrity] in the - input - [CelebritySet][google.cloud.vision.v1p4beta1.CelebritySet]. - This field is sorted in order of decreasing confidence values. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.FaceAnnotation) - ), -) -_sym_db.RegisterMessage(FaceAnnotation) -_sym_db.RegisterMessage(FaceAnnotation.Landmark) - -LocationInfo = _reflection.GeneratedProtocolMessageType( - "LocationInfo", - (_message.Message,), - dict( - DESCRIPTOR=_LOCATIONINFO, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Detected entity location information. - - - Attributes: - lat_lng: - lat/long location coordinates. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LocationInfo) - ), -) -_sym_db.RegisterMessage(LocationInfo) - -Property = _reflection.GeneratedProtocolMessageType( - "Property", - (_message.Message,), - dict( - DESCRIPTOR=_PROPERTY, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A ``Property`` consists of a user-supplied name/value - pair. - - - Attributes: - name: - Name of the property. - value: - Value of the property. - uint64_value: - Value of numeric properties. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Property) - ), -) -_sym_db.RegisterMessage(Property) - -EntityAnnotation = _reflection.GeneratedProtocolMessageType( - "EntityAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_ENTITYANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Set of detected entity features. - - - Attributes: - mid: - Opaque entity ID. Some IDs may be available in `Google - Knowledge Graph Search API - `__. - locale: - The language code for the locale in which the entity textual - ``description`` is expressed. - description: - Entity textual description, expressed in its ``locale`` - language. - score: - Overall score of the result. Range [0, 1]. - confidence: - \ **Deprecated. Use ``score`` instead.** The accuracy of the - entity detection in an image. For example, for an image in - which the "Eiffel Tower" entity is detected, this field - represents the confidence that there is a tower in the query - image. Range [0, 1]. - topicality: - The relevancy of the ICA (Image Content Annotation) label to - the image. For example, the relevancy of "tower" is likely - higher to an image containing the detected "Eiffel Tower" than - to an image containing a detected distant towering building, - even though the confidence that there is a tower in each image - may be the same. Range [0, 1]. - bounding_poly: - Image region to which this entity belongs. Not produced for - ``LABEL_DETECTION`` features. - locations: - The location information for the detected entity. Multiple - ``LocationInfo`` elements can be present because one location - may indicate the location of the scene in the image, and - another location may indicate the location of the place where - the image was taken. Location information is usually present - for landmarks. - properties: - Some entities may have optional user-supplied ``Property`` - (name/value) fields, such a score or string that qualifies the - entity. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.EntityAnnotation) - ), -) -_sym_db.RegisterMessage(EntityAnnotation) - -LocalizedObjectAnnotation = _reflection.GeneratedProtocolMessageType( - "LocalizedObjectAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_LOCALIZEDOBJECTANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Set of detected objects with bounding boxes. - - - Attributes: - mid: - Object ID that should align with EntityAnnotation mid. - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - name: - Object name, expressed in its ``language_code`` language. - score: - Score of the result. Range [0, 1]. - bounding_poly: - Image region to which this object belongs. This must be - populated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LocalizedObjectAnnotation) - ), -) -_sym_db.RegisterMessage(LocalizedObjectAnnotation) - -SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType( - "SafeSearchAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_SAFESEARCHANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Set of features pertaining to the image, computed by - computer vision methods over safe-search verticals (for example, adult, - spoof, medical, violence). - - - Attributes: - adult: - Represents the adult content likelihood for the image. Adult - content may contain elements such as nudity, pornographic - images or cartoons, or sexual activities. - spoof: - Spoof likelihood. The likelihood that an modification was made - to the image's canonical version to make it appear funny or - offensive. - medical: - Likelihood that this is a medical image. - violence: - Likelihood that this image contains violent content. - racy: - Likelihood that the request image contains racy content. Racy - content may include (but is not limited to) skimpy or sheer - clothing, strategically covered nudity, lewd or provocative - poses, or close-ups of sensitive body areas. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.SafeSearchAnnotation) - ), -) -_sym_db.RegisterMessage(SafeSearchAnnotation) - -LatLongRect = _reflection.GeneratedProtocolMessageType( - "LatLongRect", - (_message.Message,), - dict( - DESCRIPTOR=_LATLONGRECT, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Rectangle determined by min and max ``LatLng`` pairs. - - - Attributes: - min_lat_lng: - Min lat/long pair. - max_lat_lng: - Max lat/long pair. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.LatLongRect) - ), -) -_sym_db.RegisterMessage(LatLongRect) - -ColorInfo = _reflection.GeneratedProtocolMessageType( - "ColorInfo", - (_message.Message,), - dict( - DESCRIPTOR=_COLORINFO, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Color information consists of RGB channels, score, and the - fraction of the image that the color occupies in the image. - - - Attributes: - color: - RGB components of the color. - score: - Image-specific score for this color. Value in range [0, 1]. - pixel_fraction: - The fraction of pixels the color occupies in the image. Value - in range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ColorInfo) - ), -) -_sym_db.RegisterMessage(ColorInfo) - -DominantColorsAnnotation = _reflection.GeneratedProtocolMessageType( - "DominantColorsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_DOMINANTCOLORSANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Set of dominant colors and their corresponding scores. - - - Attributes: - colors: - RGB color values with their score and pixel fraction. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DominantColorsAnnotation) - ), -) -_sym_db.RegisterMessage(DominantColorsAnnotation) - -ImageProperties = _reflection.GeneratedProtocolMessageType( - "ImageProperties", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEPROPERTIES, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Stores image properties, such as dominant colors. - - - Attributes: - dominant_colors: - If present, dominant colors completed successfully. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageProperties) - ), -) -_sym_db.RegisterMessage(ImageProperties) - -CropHint = _reflection.GeneratedProtocolMessageType( - "CropHint", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINT, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Single crop hint that is used to generate a new crop when - serving an image. - - - Attributes: - bounding_poly: - The bounding polygon for the crop region. The coordinates of - the bounding box are in the original image's scale. - confidence: - Confidence of this being a salient region. Range [0, 1]. - importance_fraction: - Fraction of importance of this salient region with respect to - the original image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHint) - ), -) -_sym_db.RegisterMessage(CropHint) - -CropHintsAnnotation = _reflection.GeneratedProtocolMessageType( - "CropHintsAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Set of crop hints that are used to generate new crops when - serving images. - - - Attributes: - crop_hints: - Crop hint results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHintsAnnotation) - ), -) -_sym_db.RegisterMessage(CropHintsAnnotation) - -CropHintsParams = _reflection.GeneratedProtocolMessageType( - "CropHintsParams", - (_message.Message,), - dict( - DESCRIPTOR=_CROPHINTSPARAMS, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Parameters for crop hints annotation request. - - - Attributes: - aspect_ratios: - Aspect ratios in floats, representing the ratio of the width - to the height of the image. For example, if the desired aspect - ratio is 4/3, the corresponding float value should be 1.33333. - If not specified, the best possible crop is returned. The - number of provided aspect ratios is limited to a maximum of - 16; any aspect ratios provided after the 16th are ignored. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CropHintsParams) - ), -) -_sym_db.RegisterMessage(CropHintsParams) - -WebDetectionParams = _reflection.GeneratedProtocolMessageType( - "WebDetectionParams", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTIONPARAMS, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Parameters for web detection request. - - - Attributes: - include_geo_results: - Whether to include results derived from the geo information in - the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetectionParams) - ), -) -_sym_db.RegisterMessage(WebDetectionParams) - -ImageContext = _reflection.GeneratedProtocolMessageType( - "ImageContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGECONTEXT, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Image context and/or feature-specific parameters. - - - Attributes: - lat_long_rect: - Not used. - language_hints: - List of languages to use for TEXT\_DETECTION. In most cases, - an empty value yields the best results since it enables - automatic language detection. For languages based on the Latin - alphabet, setting ``language_hints`` is not needed. In rare - cases, when the language of the text in the image is known, - setting a hint will help get better results (although it will - be a significant hindrance if the hint is wrong). Text - detection returns an error if one or more of the specified - languages is not one of the `supported languages - `__. - crop_hints_params: - Parameters for crop hints annotation request. - face_recognition_params: - Parameters for face recognition. - product_search_params: - Parameters for product search. - web_detection_params: - Parameters for web detection. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageContext) - ), -) -_sym_db.RegisterMessage(ImageContext) - -AnnotateImageRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Request for performing Google Cloud Vision API tasks over - a user-provided image, with user-requested features, and with context - information. - - - Attributes: - image: - The image to be processed. - features: - Requested features. - image_context: - Additional context that may accompany the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateImageRequest) - ), -) -_sym_db.RegisterMessage(AnnotateImageRequest) - -ImageAnnotationContext = _reflection.GeneratedProtocolMessageType( - "ImageAnnotationContext", - (_message.Message,), - dict( - DESCRIPTOR=_IMAGEANNOTATIONCONTEXT, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""If an image was produced from a file (e.g. a PDF), this - message gives information about the source of that image. - - - Attributes: - uri: - The URI of the file used to produce the image. - page_number: - If the file was a PDF or TIFF, this field gives the page - number within the file used to produce the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImageAnnotationContext) - ), -) -_sym_db.RegisterMessage(ImageAnnotationContext) - -AnnotateImageResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateImageResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEIMAGERESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Response to an image annotation request. - - - Attributes: - face_annotations: - If present, face detection has completed successfully. - landmark_annotations: - If present, landmark detection has completed successfully. - logo_annotations: - If present, logo detection has completed successfully. - label_annotations: - If present, label detection has completed successfully. - localized_object_annotations: - If present, localized object detection has completed - successfully. This will be sorted descending by confidence - score. - text_annotations: - If present, text (OCR) detection has completed successfully. - full_text_annotation: - If present, text (OCR) detection or document (OCR) text - detection has completed successfully. This annotation provides - the structural hierarchy for the OCR detected text. - safe_search_annotation: - If present, safe-search annotation has completed successfully. - image_properties_annotation: - If present, image properties were extracted successfully. - crop_hints_annotation: - If present, crop hints have completed successfully. - web_detection: - If present, web detection has completed successfully. - product_search_results: - If present, product search has completed successfully. - error: - If set, represents the error message for the operation. Note - that filled-in image annotations are guaranteed to be correct, - even when ``error`` is set. - context: - If present, contextual information is needed to understand - where this image comes from. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateImageResponse) - ), -) -_sym_db.RegisterMessage(AnnotateImageResponse) - -BatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Multiple image annotation requests are batched into a - single service call. - - - Attributes: - requests: - Individual image annotation requests for this batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesRequest) - -BatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Response to a batch image annotation request. - - - Attributes: - responses: - Individual responses to image annotation requests within the - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateImagesResponse) - -AnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A request to annotate one single file, e.g. a PDF, TIFF or - GIF file. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - pages: - Pages of the file to perform image annotation. Pages starts - from 1, we assume the first page of the file is page 1. At - most 5 pages are supported per request. Pages can be negative. - Page 1 means the first page. Page 2 means the second page. - Page -1 means the last page. Page -2 means the second to the - last page. If the file is GIF instead of PDF or TIFF, page - refers to GIF frames. If this field is empty, by default the - service performs image annotation for the first 5 pages of the - file. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AnnotateFileRequest) - -AnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Response to a single file annotation request. A file may - contain one or more images, which individually have their own responses. - - - Attributes: - input_config: - Information about the file for which this response is - generated. - responses: - Individual responses to images found within the file. This - field will be empty if the ``error`` field is set. - total_pages: - This field gives the total number of pages in the file. - error: - If set, represents the error message for the failed request. - The ``responses`` field will not be set in this case. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AnnotateFileResponse) - -BatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A list of requests to annotate files using the - BatchAnnotateFiles API. - - - Attributes: - requests: - Required. The list of file annotation requests. Right now we - support only one AnnotateFileRequest in - BatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(BatchAnnotateFilesRequest) - -BatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "BatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""A list of file annotation responses. - - - Attributes: - responses: - The list of file annotation responses, each response - corresponding to each AnnotateFileRequest in - BatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(BatchAnnotateFilesResponse) - -AsyncAnnotateFileRequest = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""An offline file annotation request. - - - Attributes: - input_config: - Required. Information about the input file. - features: - Required. Requested features. - image_context: - Additional context that may accompany the image(s) in the - file. - output_config: - Required. The desired output location and metadata (e.g. - format). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileRequest) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileRequest) - -AsyncAnnotateFileResponse = _reflection.GeneratedProtocolMessageType( - "AsyncAnnotateFileResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCANNOTATEFILERESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The response for a single offline file annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncAnnotateFileRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncAnnotateFileResponse) - ), -) -_sym_db.RegisterMessage(AsyncAnnotateFileResponse) - -AsyncBatchAnnotateImagesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEIMAGESREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Request for async image annotation for a list of images. - - - Attributes: - requests: - Required. Individual image annotation requests for this batch. - output_config: - Required. The desired output location and metadata (e.g. - format). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateImagesRequest) - -AsyncBatchAnnotateImagesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Response to an async batch image annotation request. - - - Attributes: - output_config: - The output location and metadata from - AsyncBatchAnnotateImagesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateImagesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateImagesResponse) - -AsyncBatchAnnotateFilesRequest = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Multiple async file annotation requests are batched into a - single service call. - - - Attributes: - requests: - Required. Individual async file annotation requests for this - batch. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesRequest) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesRequest) - -AsyncBatchAnnotateFilesResponse = _reflection.GeneratedProtocolMessageType( - "AsyncBatchAnnotateFilesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_ASYNCBATCHANNOTATEFILESRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Response to an async batch file annotation request. - - - Attributes: - responses: - The list of file annotation responses, one for each request in - AsyncBatchAnnotateFilesRequest. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AsyncBatchAnnotateFilesResponse) - ), -) -_sym_db.RegisterMessage(AsyncBatchAnnotateFilesResponse) - -InputConfig = _reflection.GeneratedProtocolMessageType( - "InputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_INPUTCONFIG, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The desired input location and metadata. - - - Attributes: - gcs_source: - The Google Cloud Storage location to read the input from. - content: - File content, represented as a stream of bytes. Note: As with - all ``bytes`` fields, protobuffers use a pure binary - representation, whereas JSON representations use base64. - Currently, this field only works for BatchAnnotateFiles - requests. It does not work for AsyncBatchAnnotateFiles - requests. - mime_type: - The type of the file. Currently only "application/pdf", - "image/tiff" and "image/gif" are supported. Wildcards are not - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.InputConfig) - ), -) -_sym_db.RegisterMessage(InputConfig) - -OutputConfig = _reflection.GeneratedProtocolMessageType( - "OutputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_OUTPUTCONFIG, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The desired output location and metadata. - - - Attributes: - gcs_destination: - The Google Cloud Storage location to write the output(s) to. - batch_size: - The max number of response protos to put into each output JSON - file on Google Cloud Storage. The valid range is [1, 100]. If - not specified, the default value is 20. For example, for one - pdf file with 100 pages, 100 response protos will be - generated. If ``batch_size`` = 20, then 5 json files each - containing 20 response protos will be written under the prefix - ``gcs_destination``.\ ``uri``. Currently, batch\_size only - applies to GcsDestination, with potential future support for - other output configurations. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.OutputConfig) - ), -) -_sym_db.RegisterMessage(OutputConfig) - -GcsSource = _reflection.GeneratedProtocolMessageType( - "GcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_GCSSOURCE, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the input will be - read from. - - - Attributes: - uri: - Google Cloud Storage URI for the input file. This must only be - a Google Cloud Storage object. Wildcards are not currently - supported. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GcsSource) - ), -) -_sym_db.RegisterMessage(GcsSource) - -GcsDestination = _reflection.GeneratedProtocolMessageType( - "GcsDestination", - (_message.Message,), - dict( - DESCRIPTOR=_GCSDESTINATION, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""The Google Cloud Storage location where the output will be - written to. - - - Attributes: - uri: - Google Cloud Storage URI prefix where the results will be - stored. Results will be in JSON format and preceded by its - corresponding input URI prefix. This field can either - represent a gcs file prefix or gcs directory. In either case, - the uri should be unique because in order to get all of the - output files, you will need to do a wildcard gcs search on the - uri prefix you provide. Examples: - File Prefix: - gs://bucket-name/here/filenameprefix The output files will - be created in gs://bucket-name/here/ and the names of the - output files will begin with "filenameprefix". - - Directory Prefix: gs://bucket-name/some/location/ The output - files will be created in gs://bucket-name/some/location/ - and the names of the output files could be anything because - there was no filename prefix specified. If multiple - outputs, each response is still AnnotateFileResponse, each of - which contains some subset of the full list of - AnnotateImageResponse. Multiple outputs can happen if, for - example, the output JSON is too large and overflows into - multiple sharded files. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GcsDestination) - ), -) -_sym_db.RegisterMessage(GcsDestination) - -OperationMetadata = _reflection.GeneratedProtocolMessageType( - "OperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_OPERATIONMETADATA, - __module__="google.cloud.vision_v1p4beta1.proto.image_annotator_pb2", - __doc__="""Contains metadata for the BatchAnnotateImages operation. - - - Attributes: - state: - Current state of the batch operation. - create_time: - The time when the batch request was received. - update_time: - The time when the operation result was last updated. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.OperationMetadata) - ), -) -_sym_db.RegisterMessage(OperationMetadata) - - -DESCRIPTOR._options = None -_ENTITYANNOTATION.fields_by_name["confidence"]._options = None -_BATCHANNOTATEFILESREQUEST.fields_by_name["requests"]._options = None -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name["requests"]._options = None -_ASYNCBATCHANNOTATEIMAGESREQUEST.fields_by_name["output_config"]._options = None -_ASYNCBATCHANNOTATEFILESREQUEST.fields_by_name["requests"]._options = None - -_IMAGEANNOTATOR = _descriptor.ServiceDescriptor( - name="ImageAnnotator", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotator", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025vision.googleapis.com\322A[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-vision" - ), - serialized_start=8890, - serialized_end=9899, - methods=[ - _descriptor.MethodDescriptor( - name="BatchAnnotateImages", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateImages", - index=0, - containing_service=None, - input_type=_BATCHANNOTATEIMAGESREQUEST, - output_type=_BATCHANNOTATEIMAGESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\037"\032/v1p4beta1/images:annotate:\001*\332A\010requests' - ), - ), - _descriptor.MethodDescriptor( - name="BatchAnnotateFiles", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotator.BatchAnnotateFiles", - index=1, - containing_service=None, - input_type=_BATCHANNOTATEFILESREQUEST, - output_type=_BATCHANNOTATEFILESRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\036"\031/v1p4beta1/files:annotate:\001*\332A\010requests' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateImages", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateImages", - index=2, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEIMAGESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002)"$/v1p4beta1/images:asyncBatchAnnotate:\001*\332A\026requests,output_config\312A5\n AsyncBatchAnnotateImagesResponse\022\021OperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="AsyncBatchAnnotateFiles", - full_name="google.cloud.vision.v1p4beta1.ImageAnnotator.AsyncBatchAnnotateFiles", - index=3, - containing_service=None, - input_type=_ASYNCBATCHANNOTATEFILESREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002("#/v1p4beta1/files:asyncBatchAnnotate:\001*\332A\010requests\312A4\n\037AsyncBatchAnnotateFilesResponse\022\021OperationMetadata' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_IMAGEANNOTATOR) - -DESCRIPTOR.services_by_name["ImageAnnotator"] = _IMAGEANNOTATOR - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py deleted file mode 100644 index 380e78b07975..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py +++ /dev/null @@ -1,126 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p4beta1.proto import ( - image_annotator_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) - - -class ImageAnnotatorStub(object): - """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. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.BatchAnnotateImages = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateImages", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.FromString, - ) - self.BatchAnnotateFiles = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ImageAnnotator/BatchAnnotateFiles", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateFilesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateFilesResponse.FromString, - ) - self.AsyncBatchAnnotateImages = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ImageAnnotator/AsyncBatchAnnotateImages", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateImagesRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.AsyncBatchAnnotateFiles = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ImageAnnotator/AsyncBatchAnnotateFiles", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ImageAnnotatorServicer(object): - """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. - """ - - def BatchAnnotateImages(self, request, context): - """Run image detection and annotation for a batch of images. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def BatchAnnotateFiles(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AsyncBatchAnnotateImages(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AsyncBatchAnnotateFiles(self, request, context): - """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). - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ImageAnnotatorServicer_to_server(servicer, server): - rpc_method_handlers = { - "BatchAnnotateImages": grpc.unary_unary_rpc_method_handler( - servicer.BatchAnnotateImages, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateImagesResponse.SerializeToString, - ), - "BatchAnnotateFiles": grpc.unary_unary_rpc_method_handler( - servicer.BatchAnnotateFiles, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateFilesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.BatchAnnotateFilesResponse.SerializeToString, - ), - "AsyncBatchAnnotateImages": grpc.unary_unary_rpc_method_handler( - servicer.AsyncBatchAnnotateImages, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateImagesRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "AsyncBatchAnnotateFiles": grpc.unary_unary_rpc_method_handler( - servicer.AsyncBatchAnnotateFiles, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_image__annotator__pb2.AsyncBatchAnnotateFilesRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p4beta1.ImageAnnotator", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search.proto b/vision/google/cloud/vision_v1p4beta1/proto/product_search.proto deleted file mode 100644 index 15baed1fd27c..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search.proto +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; -import "google/api/resource.proto"; -import "google/cloud/vision/v1p4beta1/geometry.proto"; -import "google/cloud/vision/v1p4beta1/product_search_service.proto"; -import "google/protobuf/timestamp.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// Parameters for a product search request. -message ProductSearchParams { - // The bounding polygon around the area of interest in the image. - // If it is not specified, system discretion will be applied. - BoundingPoly bounding_poly = 9; - - // The resource name of a - // [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be searched for - // similar images. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - string product_set = 6 [(google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - }]; - - // The list of product categories to search in. Currently, we only consider - // the first category, and either "homegoods-v2", "apparel-v2", "toys-v2", - // "packagedgoods-v1", or "general-v1" should be specified. The legacy - // categories "homegoods", "apparel", and "toys" are still supported but will - // be deprecated. For new products, please use "homegoods-v2", "apparel-v2", - // or "toys-v2" for better product search accuracy. It is recommended to - // migrate existing products to these categories as well. - repeated string product_categories = 7; - - // The filtering expression. This can be used to restrict search results based - // on Product labels. We currently support an AND of OR of key-value - // expressions, where each expression within an OR must have the same key. An - // '=' should be used to connect the key and value. - // - // For example, "(color = red OR color = blue) AND brand = Google" is - // acceptable, but "(color = red OR brand = Google)" is not acceptable. - // "color: red" is not acceptable because it uses a ':' instead of an '='. - string filter = 8; -} - -// Results for a product search request. -message ProductSearchResults { - // Information about a product. - message Result { - // The Product. - Product product = 1; - - // A confidence level on the match, ranging from 0 (no confidence) to - // 1 (full confidence). - float score = 2; - - // The resource name of the image from the product that is the closest match - // to the query. - string image = 3; - } - - // Prediction for what the object in the bounding box is. - message ObjectAnnotation { - // Object ID that should align with EntityAnnotation mid. - string mid = 1; - - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - - // Object name, expressed in its `language_code` language. - string name = 3; - - // Score of the result. Range [0, 1]. - float score = 4; - } - - // Information about the products similar to a single product in a query - // image. - message GroupedResult { - // The bounding polygon around the product detected in the query image. - BoundingPoly bounding_poly = 1; - - // List of results, one for each product match. - repeated Result results = 2; - - // List of generic predictions for the object in the bounding box. - repeated ObjectAnnotation object_annotations = 3; - } - - // Timestamp of the index which provided these results. Products added to the - // product set and products removed from the product set after this time are - // not reflected in the current results. - google.protobuf.Timestamp index_time = 2; - - // List of results, one for each product match. - repeated Result results = 5; - - // List of results grouped by products detected in the query image. Each entry - // corresponds to one bounding polygon in the query image, and contains the - // matching products specific to that region. There may be duplicate product - // matches in the union of all the per-product results. - repeated GroupedResult product_grouped_results = 6; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2.py deleted file mode 100644 index ccaec75e3337..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2.py +++ /dev/null @@ -1,643 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/product_search.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.vision_v1p4beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2, -) -from google.cloud.vision_v1p4beta1.proto import ( - product_search_service_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2, -) -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/product_search.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\022ProductSearchProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n8google/cloud/vision_v1p4beta1/proto/product_search.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/vision_v1p4beta1/proto/geometry.proto\x1a@google/cloud/vision_v1p4beta1/proto/product_search_service.proto\x1a\x1fgoogle/protobuf/timestamp.proto"\xc1\x01\n\x13ProductSearchParams\x12\x42\n\rbounding_poly\x18\t \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12:\n\x0bproduct_set\x18\x06 \x01(\tB%\xfa\x41"\n vision.googleapis.com/ProductSet\x12\x1a\n\x12product_categories\x18\x07 \x03(\t\x12\x0e\n\x06\x66ilter\x18\x08 \x01(\t"\xb2\x05\n\x14ProductSearchResults\x12.\n\nindex_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12K\n\x07results\x18\x05 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12\x62\n\x17product_grouped_results\x18\x06 \x03(\x0b\x32\x41.google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult\x1a_\n\x06Result\x12\x37\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\r\n\x05score\x18\x02 \x01(\x02\x12\r\n\x05image\x18\x03 \x01(\t\x1aS\n\x10ObjectAnnotation\x12\x0b\n\x03mid\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12\x0c\n\x04name\x18\x03 \x01(\t\x12\r\n\x05score\x18\x04 \x01(\x02\x1a\x82\x02\n\rGroupedResult\x12\x42\n\rbounding_poly\x18\x01 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12K\n\x07results\x18\x02 \x03(\x0b\x32:.google.cloud.vision.v1p4beta1.ProductSearchResults.Result\x12`\n\x12object_annotations\x18\x03 \x03(\x0b\x32\x44.google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotationB\x88\x01\n!com.google.cloud.vision.v1p4beta1B\x12ProductSearchProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - ], -) - - -_PRODUCTSEARCHPARAMS = _descriptor.Descriptor( - name="ProductSearchParams", - full_name="google.cloud.vision.v1p4beta1.ProductSearchParams", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.ProductSearchParams.bounding_poly", - index=0, - number=9, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p4beta1.ProductSearchParams.product_set", - index=1, - number=6, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_categories", - full_name="google.cloud.vision.v1p4beta1.ProductSearchParams.product_categories", - index=2, - number=7, - type=9, - cpp_type=9, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="filter", - full_name="google.cloud.vision.v1p4beta1.ProductSearchParams.filter", - index=3, - number=8, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=300, - serialized_end=493, -) - - -_PRODUCTSEARCHRESULTS_RESULT = _descriptor.Descriptor( - name="Result", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.Result", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.Result.product", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.Result.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="image", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.Result.image", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=745, - serialized_end=840, -) - -_PRODUCTSEARCHRESULTS_OBJECTANNOTATION = _descriptor.Descriptor( - name="ObjectAnnotation", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="mid", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation.mid", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation.name", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation.score", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=842, - serialized_end=925, -) - -_PRODUCTSEARCHRESULTS_GROUPEDRESULT = _descriptor.Descriptor( - name="GroupedResult", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="bounding_poly", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.bounding_poly", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.results", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="object_annotations", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult.object_annotations", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=928, - serialized_end=1186, -) - -_PRODUCTSEARCHRESULTS = _descriptor.Descriptor( - name="ProductSearchResults", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="index_time", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.index_time", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="results", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.results", - index=1, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_grouped_results", - full_name="google.cloud.vision.v1p4beta1.ProductSearchResults.product_grouped_results", - index=2, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _PRODUCTSEARCHRESULTS_RESULT, - _PRODUCTSEARCHRESULTS_OBJECTANNOTATION, - _PRODUCTSEARCHRESULTS_GROUPEDRESULT, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=496, - serialized_end=1186, -) - -_PRODUCTSEARCHPARAMS.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PRODUCTSEARCHRESULTS_RESULT.fields_by_name[ - "product" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2._PRODUCT -) -_PRODUCTSEARCHRESULTS_RESULT.containing_type = _PRODUCTSEARCHRESULTS -_PRODUCTSEARCHRESULTS_OBJECTANNOTATION.containing_type = _PRODUCTSEARCHRESULTS -_PRODUCTSEARCHRESULTS_GROUPEDRESULT.fields_by_name[ - "bounding_poly" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PRODUCTSEARCHRESULTS_GROUPEDRESULT.fields_by_name[ - "results" -].message_type = _PRODUCTSEARCHRESULTS_RESULT -_PRODUCTSEARCHRESULTS_GROUPEDRESULT.fields_by_name[ - "object_annotations" -].message_type = _PRODUCTSEARCHRESULTS_OBJECTANNOTATION -_PRODUCTSEARCHRESULTS_GROUPEDRESULT.containing_type = _PRODUCTSEARCHRESULTS -_PRODUCTSEARCHRESULTS.fields_by_name[ - "index_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PRODUCTSEARCHRESULTS.fields_by_name[ - "results" -].message_type = _PRODUCTSEARCHRESULTS_RESULT -_PRODUCTSEARCHRESULTS.fields_by_name[ - "product_grouped_results" -].message_type = _PRODUCTSEARCHRESULTS_GROUPEDRESULT -DESCRIPTOR.message_types_by_name["ProductSearchParams"] = _PRODUCTSEARCHPARAMS -DESCRIPTOR.message_types_by_name["ProductSearchResults"] = _PRODUCTSEARCHRESULTS -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -ProductSearchParams = _reflection.GeneratedProtocolMessageType( - "ProductSearchParams", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHPARAMS, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_pb2", - __doc__="""Parameters for a product search request. - - - Attributes: - bounding_poly: - The bounding polygon around the area of interest in the image. - If it is not specified, system discretion will be applied. - product_set: - The resource name of a - [ProductSet][google.cloud.vision.v1p4beta1.ProductSet] to be - searched for similar images. Format is: ``projects/PROJECT_ID - /locations/LOC_ID/productSets/PRODUCT_SET_ID``. - product_categories: - The list of product categories to search in. Currently, we - only consider the first category, and either "homegoods-v2", - "apparel-v2", "toys-v2", "packagedgoods-v1", or "general-v1" - should be specified. The legacy categories "homegoods", - "apparel", and "toys" are still supported but will be - deprecated. For new products, please use "homegoods-v2", - "apparel-v2", or "toys-v2" for better product search accuracy. - It is recommended to migrate existing products to these - categories as well. - filter: - The filtering expression. This can be used to restrict search - results based on Product labels. We currently support an AND - of OR of key-value expressions, where each expression within - an OR must have the same key. An '=' should be used to connect - the key and value. For example, "(color = red OR color = - blue) AND brand = Google" is acceptable, but "(color = red OR - brand = Google)" is not acceptable. "color: red" is not - acceptable because it uses a ':' instead of an '='. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchParams) - ), -) -_sym_db.RegisterMessage(ProductSearchParams) - -ProductSearchResults = _reflection.GeneratedProtocolMessageType( - "ProductSearchResults", - (_message.Message,), - dict( - Result=_reflection.GeneratedProtocolMessageType( - "Result", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHRESULTS_RESULT, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_pb2", - __doc__="""Information about a product. - - - Attributes: - product: - The Product. - score: - A confidence level on the match, ranging from 0 (no - confidence) to 1 (full confidence). - image: - The resource name of the image from the product that is the - closest match to the query. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.Result) - ), - ), - ObjectAnnotation=_reflection.GeneratedProtocolMessageType( - "ObjectAnnotation", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHRESULTS_OBJECTANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_pb2", - __doc__="""Prediction for what the object in the bounding box is. - - - Attributes: - mid: - Object ID that should align with EntityAnnotation mid. - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - name: - Object name, expressed in its ``language_code`` language. - score: - Score of the result. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.ObjectAnnotation) - ), - ), - GroupedResult=_reflection.GeneratedProtocolMessageType( - "GroupedResult", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSEARCHRESULTS_GROUPEDRESULT, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_pb2", - __doc__="""Information about the products similar to a single product - in a query image. - - - Attributes: - bounding_poly: - The bounding polygon around the product detected in the query - image. - results: - List of results, one for each product match. - object_annotations: - List of generic predictions for the object in the bounding - box. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults.GroupedResult) - ), - ), - DESCRIPTOR=_PRODUCTSEARCHRESULTS, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_pb2", - __doc__="""Results for a product search request. - - - Attributes: - index_time: - Timestamp of the index which provided these results. Products - added to the product set and products removed from the product - set after this time are not reflected in the current results. - results: - List of results, one for each product match. - product_grouped_results: - List of results grouped by products detected in the query - image. Each entry corresponds to one bounding polygon in the - query image, and contains the matching products specific to - that region. There may be duplicate product matches in the - union of all the per-product results. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSearchResults) - ), -) -_sym_db.RegisterMessage(ProductSearchResults) -_sym_db.RegisterMessage(ProductSearchResults.Result) -_sym_db.RegisterMessage(ProductSearchResults.ObjectAnnotation) -_sym_db.RegisterMessage(ProductSearchResults.GroupedResult) - - -DESCRIPTOR._options = None -_PRODUCTSEARCHPARAMS.fields_by_name["product_set"]._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service.proto b/vision/google/cloud/vision_v1p4beta1/proto/product_search_service.proto deleted file mode 100644 index 1a165c708831..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service.proto +++ /dev/null @@ -1,1039 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/vision/v1p4beta1/geometry.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "ProductSearchServiceProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// 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.v1p4beta1.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.v1p4beta1.Product] resources, named -// `projects/*/locations/*/products/*` -// -// - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of -// [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, -// named -// `projects/*/locations/*/products/*/referenceImages/*` -service ProductSearch { - option (google.api.default_host) = "vision.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform," - "https://www.googleapis.com/auth/cloud-vision"; - - // Creates and returns a new ProductSet resource. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - // 4096 characters. - rpc CreateProductSet(CreateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - post: "/v1p4beta1/{parent=projects/*/locations/*}/productSets" - body: "product_set" - }; - option (google.api.method_signature) = "parent,product_set,product_set_id"; - } - - // Lists ProductSets in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - // than 1. - rpc ListProductSets(ListProductSetsRequest) - returns (ListProductSetsResponse) { - option (google.api.http) = { - get: "/v1p4beta1/{parent=projects/*/locations/*}/productSets" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information associated with a ProductSet. - // - // Possible errors: - // - // * Returns NOT_FOUND if the ProductSet does not exist. - rpc GetProductSet(GetProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - get: "/v1p4beta1/{name=projects/*/locations/*/productSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc UpdateProductSet(UpdateProductSetRequest) returns (ProductSet) { - option (google.api.http) = { - patch: "/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}" - body: "product_set" - }; - option (google.api.method_signature) = "product_set,update_mask"; - } - - // Permanently deletes a ProductSet. Products and ReferenceImages in the - // ProductSet are not deleted. - // - // The actual image files are not deleted from Google Cloud Storage. - rpc DeleteProductSet(DeleteProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p4beta1/{name=projects/*/locations/*/productSets/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc CreateProduct(CreateProductRequest) returns (Product) { - option (google.api.http) = { - post: "/v1p4beta1/{parent=projects/*/locations/*}/products" - body: "product" - }; - option (google.api.method_signature) = "parent,product,product_id"; - } - - // Lists products in an unspecified order. - // - // Possible errors: - // - // * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - rpc ListProducts(ListProductsRequest) returns (ListProductsResponse) { - option (google.api.http) = { - get: "/v1p4beta1/{parent=projects/*/locations/*}/products" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information associated with a Product. - // - // Possible errors: - // - // * Returns NOT_FOUND if the Product does not exist. - rpc GetProduct(GetProductRequest) returns (Product) { - option (google.api.http) = { - get: "/v1p4beta1/{name=projects/*/locations/*/products/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc UpdateProduct(UpdateProductRequest) returns (Product) { - option (google.api.http) = { - patch: "/v1p4beta1/{product.name=projects/*/locations/*/products/*}" - body: "product" - }; - option (google.api.method_signature) = "product,update_mask"; - } - - // 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. - rpc DeleteProduct(DeleteProductRequest) returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p4beta1/{name=projects/*/locations/*/products/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc CreateReferenceImage(CreateReferenceImageRequest) - returns (ReferenceImage) { - option (google.api.http) = { - post: "/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - body: "reference_image" - }; - option (google.api.method_signature) = - "parent,reference_image,reference_image_id"; - } - - // 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. - rpc DeleteReferenceImage(DeleteReferenceImageRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - delete: "/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc ListReferenceImages(ListReferenceImagesRequest) - returns (ListReferenceImagesResponse) { - option (google.api.http) = { - get: "/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets information associated with a ReferenceImage. - // - // Possible errors: - // - // * Returns NOT_FOUND if the specified image does not exist. - rpc GetReferenceImage(GetReferenceImageRequest) returns (ReferenceImage) { - option (google.api.http) = { - get: "/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}" - }; - option (google.api.method_signature) = "name"; - } - - // 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. - rpc AddProductToProductSet(AddProductToProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct" - body: "*" - }; - option (google.api.method_signature) = "name,product"; - } - - // Removes a Product from the specified ProductSet. - rpc RemoveProductFromProductSet(RemoveProductFromProductSetRequest) - returns (google.protobuf.Empty) { - option (google.api.http) = { - post: "/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct" - body: "*" - }; - option (google.api.method_signature) = "name,product"; - } - - // 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. - rpc ListProductsInProductSet(ListProductsInProductSetRequest) - returns (ListProductsInProductSetResponse) { - option (google.api.http) = { - get: "/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products" - }; - option (google.api.method_signature) = "name"; - } - - // 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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. - rpc ImportProductSets(ImportProductSetsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p4beta1/{parent=projects/*/locations/*}/productSets:import" - body: "*" - }; - option (google.api.method_signature) = "parent,input_config"; - option (google.longrunning.operation_info) = { - response_type: "ImportProductSetsResponse" - metadata_type: "BatchOperationMetadata" - }; - } - - // 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) - rpc PurgeProducts(PurgeProductsRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1p4beta1/{parent=projects/*/locations/*}/products:purge" - body: "*" - }; - option (google.api.method_signature) = "parent"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "BatchOperationMetadata" - }; - } -} - -// A Product contains ReferenceImages. -message Product { - option (google.api.resource) = { - type: "vision.googleapis.com/Product" - pattern: "projects/{project}/locations/{location}/products/{product}" - }; - - // A product label represented as a key-value pair. - message KeyValue { - // The key of the label attached to the product. Cannot be empty and cannot - // exceed 128 bytes. - string key = 1; - - // The value of the label attached to the product. Cannot be empty and - // cannot exceed 128 bytes. - string value = 2; - } - - // The resource name of the product. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - // - // This field is ignored when creating a product. - string name = 1; - - // The user-provided name for this Product. Must not be empty. Must be at most - // 4096 characters long. - string display_name = 2; - - // User-provided metadata to be stored with this product. Must be at most 4096 - // characters long. - string description = 3; - - // Immutable. The category for the product identified by the reference image. - // This should be either "homegoods-v2", "apparel-v2", or "toys-v2". The - // legacy categories "homegoods", "apparel", and "toys" are still supported, - // but these should not be used for new products. - string product_category = 4 [(google.api.field_behavior) = IMMUTABLE]; - - // Key-value pairs that can be attached to a product. At query time, - // constraints can be specified based on the product_labels. - // - // Note that integer values can be provided as strings, e.g. "1199". Only - // strings with integer values can match a range-based restriction which is - // to be supported soon. - // - // Multiple values can be assigned to the same key. One product may have up to - // 500 product_labels. - // - // Notice that the total number of distinct product_labels over all products - // in one ProductSet cannot exceed 1M, otherwise the product search pipeline - // will refuse to work for that ProductSet. - repeated KeyValue product_labels = 5; -} - -// A ProductSet contains Products. A ProductSet can contain a maximum of 1 -// million reference images. If the limit is exceeded, periodic indexing will -// fail. -message ProductSet { - option (google.api.resource) = { - type: "vision.googleapis.com/ProductSet" - pattern: "projects/{project}/locations/{location}/productSets/{product_set}" - }; - - // The resource name of the ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID`. - // - // This field is ignored when creating a ProductSet. - string name = 1; - - // The user-provided name for this ProductSet. Must not be empty. Must be at - // most 4096 characters long. - string display_name = 2; - - // Output only. The time at which this ProductSet was last indexed. Query - // results will reflect all updates before this time. If this ProductSet has - // never been indexed, this timestamp is the default value - // "1970-01-01T00:00:00Z". - // - // This field is ignored when creating a ProductSet. - google.protobuf.Timestamp index_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If there was an error with indexing the product set, the field - // is populated. - // - // This field is ignored when creating a ProductSet. - google.rpc.Status index_error = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// A `ReferenceImage` represents a product image and its associated metadata, -// such as bounding boxes. -message ReferenceImage { - option (google.api.resource) = { - type: "vision.googleapis.com/ReferenceImage" - pattern: "projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}" - }; - - // The resource name of the reference image. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - // - // This field is ignored when creating a reference image. - string name = 1; - - // Required. The Google Cloud Storage URI of the reference image. - // - // The URI must start with `gs://`. - string uri = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Bounding polygons around the areas of interest in the reference - // image. If this field is empty, the system will try to detect regions of - // interest. At most 10 bounding polygons will be used. - // - // The provided shape is converted into a non-rotated rectangle. Once - // converted, the small edge of the rectangle must be greater than or equal - // to 300 pixels. The aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 - // is not). - repeated BoundingPoly bounding_polys = 3 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for the `CreateProduct` method. -message CreateProductRequest { - // Required. The project in which the Product should be created. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The product to create. - Product product = 2 [(google.api.field_behavior) = REQUIRED]; - - // A user-supplied resource id for this Product. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_id = 3; -} - -// Request message for the `ListProducts` method. -message ListProductsRequest { - // Required. The project OR ProductSet from which Products should be listed. - // - // Format: - // `projects/PROJECT_ID/locations/LOC_ID` - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProducts` method. -message ListProductsResponse { - // List of products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProduct` method. -message GetProductRequest { - // Required. Resource name of the Product to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; -} - -// Request message for the `UpdateProduct` method. -message UpdateProductRequest { - // Required. The Product resource which replaces the one on the server. - // product.name is immutable. - Product product = 1 [(google.api.field_behavior) = REQUIRED]; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields - // to update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask paths include `product_labels`, `display_name`, and - // `description`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProduct` method. -message DeleteProductRequest { - // Required. Resource name of product to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; -} - -// Request message for the `CreateProductSet` method. -message CreateProductSetRequest { - // Required. The project in which the ProductSet should be created. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The ProductSet to create. - ProductSet product_set = 2 [(google.api.field_behavior) = REQUIRED]; - - // A user-supplied resource id for this ProductSet. If set, the server will - // attempt to use this value as the resource id. If it is already in use, an - // error is returned with code ALREADY_EXISTS. Must be at most 128 characters - // long. It cannot contain the character `/`. - string product_set_id = 3; -} - -// Request message for the `ListProductSets` method. -message ListProductSetsRequest { - // Required. The project from which ProductSets should be listed. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductSets` method. -message ListProductSetsResponse { - // List of ProductSets. - repeated ProductSet product_sets = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// Request message for the `GetProductSet` method. -message GetProductSetRequest { - // Required. Resource name of the ProductSet to get. - // - // Format is: - // `projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - } - ]; -} - -// Request message for the `UpdateProductSet` method. -message UpdateProductSetRequest { - // Required. The ProductSet resource which replaces the one on the server. - ProductSet product_set = 1 [(google.api.field_behavior) = REQUIRED]; - - // The [FieldMask][google.protobuf.FieldMask] that specifies which fields to - // update. - // If update_mask isn't specified, all mutable fields are to be updated. - // Valid mask path is `display_name`. - google.protobuf.FieldMask update_mask = 2; -} - -// Request message for the `DeleteProductSet` method. -message DeleteProductSetRequest { - // Required. Resource name of the ProductSet to delete. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - } - ]; -} - -// Request message for the `CreateReferenceImage` method. -message CreateReferenceImageRequest { - // Required. Resource name of the product in which to create the reference - // image. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; - - // Required. The reference image to create. - // If an image ID is specified, it is ignored. - ReferenceImage reference_image = 2 [(google.api.field_behavior) = REQUIRED]; - - // A user-supplied resource id for the ReferenceImage to be added. If set, - // the server will attempt to use this value as the resource id. If it is - // already in use, an error is returned with code ALREADY_EXISTS. Must be at - // most 128 characters long. It cannot contain the character `/`. - string reference_image_id = 3; -} - -// Request message for the `ListReferenceImages` method. -message ListReferenceImagesRequest { - // Required. Resource name of the product containing the reference images. - // - // Format is - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // A token identifying a page of results to be returned. This is the value - // of `nextPageToken` returned in a previous reference image list request. - // - // Defaults to the first page if not specified. - string page_token = 3; -} - -// Response message for the `ListReferenceImages` method. -message ListReferenceImagesResponse { - // The list of reference images. - repeated ReferenceImage reference_images = 1; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string next_page_token = 3; -} - -// Request message for the `GetReferenceImage` method. -message GetReferenceImageRequest { - // Required. The resource name of the ReferenceImage to get. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID`. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ReferenceImage" - } - ]; -} - -// Request message for the `DeleteReferenceImage` method. -message DeleteReferenceImageRequest { - // Required. The resource name of the reference image to delete. - // - // Format is: - // - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceImages/IMAGE_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ReferenceImage" - } - ]; -} - -// Request message for the `AddProductToProductSet` method. -message AddProductToProductSetRequest { - // Required. The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - } - ]; - - // Required. The resource name for the Product to be added to this ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; -} - -// Request message for the `RemoveProductFromProductSet` method. -message RemoveProductFromProductSetRequest { - // Required. The resource name for the ProductSet to modify. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - } - ]; - - // Required. The resource name for the Product to be removed from this - // ProductSet. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID` - string product = 2 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "vision.googleapis.com/Product" } - ]; -} - -// Request message for the `ListProductsInProductSet` method. -message ListProductsInProductSetRequest { - // Required. The ProductSet resource for which to retrieve Products. - // - // Format is: - // `projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "vision.googleapis.com/ProductSet" - } - ]; - - // The maximum number of items to return. Default 10, maximum 100. - int32 page_size = 2; - - // The next_page_token returned from a previous List request, if any. - string page_token = 3; -} - -// Response message for the `ListProductsInProductSet` method. -message ListProductsInProductSetResponse { - // The list of Products. - repeated Product products = 1; - - // Token to retrieve the next page of results, or empty if there are no more - // results in the list. - string next_page_token = 2; -} - -// The Google Cloud Storage location for a csv file which preserves a list of -// ImportProductSetRequests in each line. -message ImportProductSetsGcsSource { - // The Google Cloud Storage URI of the input csv file. - // - // The URI must start with `gs://`. - // - // The format of the input csv file should be one image per line. - // In each line, there are 8 columns. - // - // 1. image-uri - // 2. image-id - // 3. product-set-id - // 4. product-id - // 5. product-category - // 6. product-display-name - // 7. labels - // 8. bounding-poly - // - // The `image-uri`, `product-set-id`, `product-id`, and `product-category` - // columns are required. All other columns are optional. - // - // If the `ProductSet` or `Product` specified by the `product-set-id` and - // `product-id` values does not exist, then the system will create a new - // `ProductSet` or `Product` for the image. In this case, the - // `product-display-name` column refers to - // [display_name][google.cloud.vision.v1p4beta1.Product.display_name], the - // `product-category` column refers to - // [product_category][google.cloud.vision.v1p4beta1.Product.product_category], - // and the `labels` column refers to - // [product_labels][google.cloud.vision.v1p4beta1.Product.product_labels]. - // - // The `image-id` column is optional but must be unique if provided. If it is - // empty, the system will automatically assign a unique id to the image. - // - // The `product-display-name` column is optional. If it is empty, the system - // sets the [display_name][google.cloud.vision.v1p4beta1.Product.display_name] - // field for the product to a space (" "). You can update the `display_name` - // later by using the API. - // - // If a `Product` with the specified `product-id` already exists, then the - // system ignores the `product-display-name`, `product-category`, and `labels` - // columns. - // - // The `labels` column (optional) is a line containing a list of - // comma-separated key-value pairs, in the following format: - // - // "key_1=value_1,key_2=value_2,...,key_n=value_n" - // - // The `bounding-poly` column (optional) identifies one region of - // interest from the image in the same manner as `CreateReferenceImage`. If - // you do not specify the `bounding-poly` column, then the system will try to - // detect regions of interest automatically. - // - // At most one `bounding-poly` column is allowed per line. If the image - // contains multiple regions of interest, add a line to the CSV file that - // includes the same product information, and the `bounding-poly` values for - // each region of interest. - // - // The `bounding-poly` column must contain an even number of comma-separated - // numbers, in the format "p1_x,p1_y,p2_x,p2_y,...,pn_x,pn_y". Use - // non-negative integers for absolute bounding polygons, and float values - // in [0, 1] for normalized bounding polygons. - // - // The system will resize the image if the image resolution is too - // large to process (larger than 20MP). - string csv_file_uri = 1; -} - -// The input content for the `ImportProductSets` method. -message ImportProductSetsInputConfig { - // The source of the input. - oneof source { - // The Google Cloud Storage location for a csv file which preserves a list - // of ImportProductSetRequests in each line. - ImportProductSetsGcsSource gcs_source = 1; - } -} - -// Request message for the `ImportProductSets` method. -message ImportProductSetsRequest { - // Required. The project in which the ProductSets should be imported. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // Required. The input content for the list of requests. - ImportProductSetsInputConfig input_config = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// Response message for the `ImportProductSets` method. -// -// This message is returned by the -// [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] -// method in the returned -// [google.longrunning.Operation.response][google.longrunning.Operation.response] -// field. -message ImportProductSetsResponse { - // The list of reference_images that are imported successfully. - repeated ReferenceImage reference_images = 1; - - // The rpc status for each ImportProductSet request, including both successes - // and errors. - // - // The number of statuses here matches the number of lines in the csv file, - // and statuses[i] stores the success or failure status of processing the i-th - // line of the csv, starting from line 0. - repeated google.rpc.Status statuses = 2; -} - -// Metadata for the batch operations such as the current state. -// -// This is included in the `metadata` field of the `Operation` returned by the -// `GetOperation` call of the `google::longrunning::Operations` service. -message BatchOperationMetadata { - // Enumerates the possible states that the batch request can be in. - enum State { - // Invalid. - STATE_UNSPECIFIED = 0; - - // Request is actively being processed. - PROCESSING = 1; - - // The request is done and at least one item has been successfully - // processed. - SUCCESSFUL = 2; - - // The request is done and no item has been successfully processed. - FAILED = 3; - - // The request is done after the longrunning.Operations.CancelOperation has - // been called by the user. Any records that were processed before the - // cancel command are output as specified in the request. - CANCELLED = 4; - } - - // The current state of the batch operation. - State state = 1; - - // The time when the batch request was submitted to the server. - google.protobuf.Timestamp submit_time = 2; - - // The time when the batch request is finished and - // [google.longrunning.Operation.done][google.longrunning.Operation.done] is - // set to true. - google.protobuf.Timestamp end_time = 3; -} - -// Config to control which ProductSet contains the Products to be deleted. -message ProductSetPurgeConfig { - // The ProductSet that contains the Products to delete. If a Product is a - // member of product_set_id in addition to other ProductSets, the Product will - // still be deleted. - string product_set_id = 1; -} - -// Request message for the `PurgeProducts` method. -message PurgeProductsRequest { - // The Products to delete. - oneof target { - // Specify which ProductSet contains the Products to be deleted. - ProductSetPurgeConfig product_set_purge_config = 2; - - // If delete_orphan_products is true, all Products that are not in any - // ProductSet will be deleted. - bool delete_orphan_products = 3; - } - - // Required. The project and location in which the Products should be deleted. - // - // Format is `projects/PROJECT_ID/locations/LOC_ID`. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "locations.googleapis.com/Location" - } - ]; - - // The default value is false. Override this value to true to actually perform - // the purge. - bool force = 4; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py deleted file mode 100644 index 6fce495edff3..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py +++ /dev/null @@ -1,3339 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/product_search_service.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.api import client_pb2 as google_dot_api_dot_client__pb2 -from google.api import field_behavior_pb2 as google_dot_api_dot_field__behavior__pb2 -from google.api import resource_pb2 as google_dot_api_dot_resource__pb2 -from google.cloud.vision_v1p4beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 -from google.protobuf import field_mask_pb2 as google_dot_protobuf_dot_field__mask__pb2 -from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 -from google.rpc import status_pb2 as google_dot_rpc_dot_status__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/product_search_service.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\031ProductSearchServiceProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n@google/cloud/vision_v1p4beta1/proto/product_search_service.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a\x32google/cloud/vision_v1p4beta1/proto/geometry.proto\x1a#google/longrunning/operations.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xb2\x02\n\x07Product\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x12\x1d\n\x10product_category\x18\x04 \x01(\tB\x03\xe0\x41\x05\x12G\n\x0eproduct_labels\x18\x05 \x03(\x0b\x32/.google.cloud.vision.v1p4beta1.Product.KeyValue\x1a&\n\x08KeyValue\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:^\xea\x41[\n\x1dvision.googleapis.com/Product\x12:projects/{project}/locations/{location}/products/{product}"\xfd\x01\n\nProductSet\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x14\n\x0c\x64isplay_name\x18\x02 \x01(\t\x12\x33\n\nindex_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12,\n\x0bindex_error\x18\x04 \x01(\x0b\x32\x12.google.rpc.StatusB\x03\xe0\x41\x03:h\xea\x41\x65\n vision.googleapis.com/ProductSet\x12\x41projects/{project}/locations/{location}/productSets/{product_set}"\x85\x02\n\x0eReferenceImage\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x10\n\x03uri\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12H\n\x0e\x62ounding_polys\x18\x03 \x03(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPolyB\x03\xe0\x41\x01:\x88\x01\xea\x41\x84\x01\n$vision.googleapis.com/ReferenceImage\x12\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}"\xa3\x01\n\x14\x43reateProductRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12<\n\x07product\x18\x02 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12\x12\n\nproduct_id\x18\x03 \x01(\t"w\n\x13ListProductsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"i\n\x14ListProductsResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"H\n\x11GetProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product"\x85\x01\n\x14UpdateProductRequest\x12<\n\x07product\x18\x01 \x01(\x0b\x32&.google.cloud.vision.v1p4beta1.ProductB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"K\n\x14\x44\x65leteProductRequest\x12\x33\n\x04name\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product"\xb1\x01\n\x17\x43reateProductSetRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x43\n\x0bproduct_set\x18\x02 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12\x16\n\x0eproduct_set_id\x18\x03 \x01(\t"z\n\x16ListProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"s\n\x17ListProductSetsResponse\x12?\n\x0cproduct_sets\x18\x01 \x03(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSet\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"N\n\x14GetProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n vision.googleapis.com/ProductSet"\x8f\x01\n\x17UpdateProductSetRequest\x12\x43\n\x0bproduct_set\x18\x01 \x01(\x0b\x32).google.cloud.vision.v1p4beta1.ProductSetB\x03\xe0\x41\x02\x12/\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"Q\n\x17\x44\x65leteProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n vision.googleapis.com/ProductSet"\xbd\x01\n\x1b\x43reateReferenceImageRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12K\n\x0freference_image\x18\x02 \x01(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImageB\x03\xe0\x41\x02\x12\x1a\n\x12reference_image_id\x18\x03 \x01(\t"z\n\x1aListReferenceImagesRequest\x12\x35\n\x06parent\x18\x01 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"\x92\x01\n\x1bListReferenceImagesResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x17\n\x0fnext_page_token\x18\x03 \x01(\t"V\n\x18GetReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage"Y\n\x1b\x44\x65leteReferenceImageRequest\x12:\n\x04name\x18\x01 \x01(\tB,\xe0\x41\x02\xfa\x41&\n$vision.googleapis.com/ReferenceImage"\x8f\x01\n\x1d\x41\x64\x64ProductToProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product"\x94\x01\n"RemoveProductFromProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n vision.googleapis.com/ProductSet\x12\x36\n\x07product\x18\x02 \x01(\tB%\xe0\x41\x02\xfa\x41\x1f\n\x1dvision.googleapis.com/Product"\x80\x01\n\x1fListProductsInProductSetRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n vision.googleapis.com/ProductSet\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"u\n ListProductsInProductSetResponse\x12\x38\n\x08products\x18\x01 \x03(\x0b\x32&.google.cloud.vision.v1p4beta1.Product\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"2\n\x1aImportProductSetsGcsSource\x12\x14\n\x0c\x63sv_file_uri\x18\x01 \x01(\t"y\n\x1cImportProductSetsInputConfig\x12O\n\ngcs_source\x18\x01 \x01(\x0b\x32\x39.google.cloud.vision.v1p4beta1.ImportProductSetsGcsSourceH\x00\x42\x08\n\x06source"\xad\x01\n\x18ImportProductSetsRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12V\n\x0cinput_config\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.ImportProductSetsInputConfigB\x03\xe0\x41\x02"\x8a\x01\n\x19ImportProductSetsResponse\x12G\n\x10reference_images\x18\x01 \x03(\x0b\x32-.google.cloud.vision.v1p4beta1.ReferenceImage\x12$\n\x08statuses\x18\x02 \x03(\x0b\x32\x12.google.rpc.Status"\x9e\x02\n\x16\x42\x61tchOperationMetadata\x12J\n\x05state\x18\x01 \x01(\x0e\x32;.google.cloud.vision.v1p4beta1.BatchOperationMetadata.State\x12/\n\x0bsubmit_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12,\n\x08\x65nd_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"Y\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x0e\n\nPROCESSING\x10\x01\x12\x0e\n\nSUCCESSFUL\x10\x02\x12\n\n\x06\x46\x41ILED\x10\x03\x12\r\n\tCANCELLED\x10\x04"/\n\x15ProductSetPurgeConfig\x12\x16\n\x0eproduct_set_id\x18\x01 \x01(\t"\xe6\x01\n\x14PurgeProductsRequest\x12X\n\x18product_set_purge_config\x18\x02 \x01(\x0b\x32\x34.google.cloud.vision.v1p4beta1.ProductSetPurgeConfigH\x00\x12 \n\x16\x64\x65lete_orphan_products\x18\x03 \x01(\x08H\x00\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\r\n\x05\x66orce\x18\x04 \x01(\x08\x42\x08\n\x06target2\xd2 \n\rProductSearch\x12\xe6\x01\n\x10\x43reateProductSet\x12\x36.google.cloud.vision.v1p4beta1.CreateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet"o\x82\xd3\xe4\x93\x02\x45"6/v1p4beta1/{parent=projects/*/locations/*}/productSets:\x0bproduct_set\xda\x41!parent,product_set,product_set_id\x12\xc9\x01\n\x0fListProductSets\x12\x35.google.cloud.vision.v1p4beta1.ListProductSetsRequest\x1a\x36.google.cloud.vision.v1p4beta1.ListProductSetsResponse"G\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{parent=projects/*/locations/*}/productSets\xda\x41\x06parent\x12\xb6\x01\n\rGetProductSet\x12\x33.google.cloud.vision.v1p4beta1.GetProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet"E\x82\xd3\xe4\x93\x02\x38\x12\x36/v1p4beta1/{name=projects/*/locations/*/productSets/*}\xda\x41\x04name\x12\xe8\x01\n\x10UpdateProductSet\x12\x36.google.cloud.vision.v1p4beta1.UpdateProductSetRequest\x1a).google.cloud.vision.v1p4beta1.ProductSet"q\x82\xd3\xe4\x93\x02Q2B/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}:\x0bproduct_set\xda\x41\x17product_set,update_mask\x12\xa9\x01\n\x10\x44\x65leteProductSet\x12\x36.google.cloud.vision.v1p4beta1.DeleteProductSetRequest\x1a\x16.google.protobuf.Empty"E\x82\xd3\xe4\x93\x02\x38*6/v1p4beta1/{name=projects/*/locations/*/productSets/*}\xda\x41\x04name\x12\xce\x01\n\rCreateProduct\x12\x33.google.cloud.vision.v1p4beta1.CreateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product"`\x82\xd3\xe4\x93\x02>"3/v1p4beta1/{parent=projects/*/locations/*}/products:\x07product\xda\x41\x19parent,product,product_id\x12\xbd\x01\n\x0cListProducts\x12\x32.google.cloud.vision.v1p4beta1.ListProductsRequest\x1a\x33.google.cloud.vision.v1p4beta1.ListProductsResponse"D\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{parent=projects/*/locations/*}/products\xda\x41\x06parent\x12\xaa\x01\n\nGetProduct\x12\x30.google.cloud.vision.v1p4beta1.GetProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product"B\x82\xd3\xe4\x93\x02\x35\x12\x33/v1p4beta1/{name=projects/*/locations/*/products/*}\xda\x41\x04name\x12\xd0\x01\n\rUpdateProduct\x12\x33.google.cloud.vision.v1p4beta1.UpdateProductRequest\x1a&.google.cloud.vision.v1p4beta1.Product"b\x82\xd3\xe4\x93\x02\x46\x32;/v1p4beta1/{product.name=projects/*/locations/*/products/*}:\x07product\xda\x41\x13product,update_mask\x12\xa0\x01\n\rDeleteProduct\x12\x33.google.cloud.vision.v1p4beta1.DeleteProductRequest\x1a\x16.google.protobuf.Empty"B\x82\xd3\xe4\x93\x02\x35*3/v1p4beta1/{name=projects/*/locations/*/products/*}\xda\x41\x04name\x12\x8e\x02\n\x14\x43reateReferenceImage\x12:.google.cloud.vision.v1p4beta1.CreateReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage"\x8a\x01\x82\xd3\xe4\x93\x02X"E/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\x0freference_image\xda\x41)parent,reference_image,reference_image_id\x12\xc0\x01\n\x14\x44\x65leteReferenceImage\x12:.google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest\x1a\x16.google.protobuf.Empty"T\x82\xd3\xe4\x93\x02G*E/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\xda\x41\x04name\x12\xe4\x01\n\x13ListReferenceImages\x12\x39.google.cloud.vision.v1p4beta1.ListReferenceImagesRequest\x1a:.google.cloud.vision.v1p4beta1.ListReferenceImagesResponse"V\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages\xda\x41\x06parent\x12\xd1\x01\n\x11GetReferenceImage\x12\x37.google.cloud.vision.v1p4beta1.GetReferenceImageRequest\x1a-.google.cloud.vision.v1p4beta1.ReferenceImage"T\x82\xd3\xe4\x93\x02G\x12\x45/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\xda\x41\x04name\x12\xcb\x01\n\x16\x41\x64\x64ProductToProductSet\x12<.google.cloud.vision.v1p4beta1.AddProductToProductSetRequest\x1a\x16.google.protobuf.Empty"[\x82\xd3\xe4\x93\x02\x46"A/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\x01*\xda\x41\x0cname,product\x12\xd8\x01\n\x1bRemoveProductFromProductSet\x12\x41.google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest\x1a\x16.google.protobuf.Empty"^\x82\xd3\xe4\x93\x02I"D/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\x01*\xda\x41\x0cname,product\x12\xeb\x01\n\x18ListProductsInProductSet\x12>.google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest\x1a?.google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse"N\x82\xd3\xe4\x93\x02\x41\x12?/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products\xda\x41\x04name\x12\x82\x02\n\x11ImportProductSets\x12\x37.google.cloud.vision.v1p4beta1.ImportProductSetsRequest\x1a\x1d.google.longrunning.Operation"\x94\x01\x82\xd3\xe4\x93\x02\x42"=/v1p4beta1/{parent=projects/*/locations/*}/productSets:import:\x01*\xda\x41\x13parent,input_config\xca\x41\x33\n\x19ImportProductSetsResponse\x12\x16\x42\x61tchOperationMetadata\x12\xe4\x01\n\rPurgeProducts\x12\x33.google.cloud.vision.v1p4beta1.PurgeProductsRequest\x1a\x1d.google.longrunning.Operation"\x7f\x82\xd3\xe4\x93\x02>"9/v1p4beta1/{parent=projects/*/locations/*}/products:purge:\x01*\xda\x41\x06parent\xca\x41/\n\x15google.protobuf.Empty\x12\x16\x42\x61tchOperationMetadata\x1av\xca\x41\x15vision.googleapis.com\xd2\x41[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-visionB\x8f\x01\n!com.google.cloud.vision.v1p4beta1B\x19ProductSearchServiceProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_api_dot_client__pb2.DESCRIPTOR, - google_dot_api_dot_field__behavior__pb2.DESCRIPTOR, - google_dot_api_dot_resource__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - google_dot_longrunning_dot_operations__pb2.DESCRIPTOR, - google_dot_protobuf_dot_empty__pb2.DESCRIPTOR, - google_dot_protobuf_dot_field__mask__pb2.DESCRIPTOR, - google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, - google_dot_rpc_dot_status__pb2.DESCRIPTOR, - ], -) - - -_BATCHOPERATIONMETADATA_STATE = _descriptor.EnumDescriptor( - name="State", - full_name="google.cloud.vision.v1p4beta1.BatchOperationMetadata.State", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="STATE_UNSPECIFIED", - index=0, - number=0, - serialized_options=None, - type=None, - ), - _descriptor.EnumValueDescriptor( - name="PROCESSING", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SUCCESSFUL", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="FAILED", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="CANCELLED", index=4, number=4, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=4545, - serialized_end=4634, -) -_sym_db.RegisterEnumDescriptor(_BATCHOPERATIONMETADATA_STATE) - - -_PRODUCT_KEYVALUE = _descriptor.Descriptor( - name="KeyValue", - full_name="google.cloud.vision.v1p4beta1.Product.KeyValue", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="key", - full_name="google.cloud.vision.v1p4beta1.Product.KeyValue.key", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="value", - full_name="google.cloud.vision.v1p4beta1.Product.KeyValue.value", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=597, - serialized_end=635, -) - -_PRODUCT = _descriptor.Descriptor( - name="Product", - full_name="google.cloud.vision.v1p4beta1.Product", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.Product.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.vision.v1p4beta1.Product.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p4beta1.Product.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_category", - full_name="google.cloud.vision.v1p4beta1.Product.product_category", - index=3, - number=4, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\005"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_labels", - full_name="google.cloud.vision.v1p4beta1.Product.product_labels", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[_PRODUCT_KEYVALUE], - enum_types=[], - serialized_options=_b( - "\352A[\n\035vision.googleapis.com/Product\022:projects/{project}/locations/{location}/products/{product}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=425, - serialized_end=731, -) - - -_PRODUCTSET = _descriptor.Descriptor( - name="ProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSet", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.ProductSet.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="display_name", - full_name="google.cloud.vision.v1p4beta1.ProductSet.display_name", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="index_time", - full_name="google.cloud.vision.v1p4beta1.ProductSet.index_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="index_error", - full_name="google.cloud.vision.v1p4beta1.ProductSet.index_error", - index=3, - number=4, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\003"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352Ae\n vision.googleapis.com/ProductSet\022Aprojects/{project}/locations/{location}/productSets/{product_set}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=734, - serialized_end=987, -) - - -_REFERENCEIMAGE = _descriptor.Descriptor( - name="ReferenceImage", - full_name="google.cloud.vision.v1p4beta1.ReferenceImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.ReferenceImage.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="uri", - full_name="google.cloud.vision.v1p4beta1.ReferenceImage.uri", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_polys", - full_name="google.cloud.vision.v1p4beta1.ReferenceImage.bounding_polys", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\001"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=_b( - "\352A\204\001\n$vision.googleapis.com/ReferenceImage\022\\projects/{project}/locations/{location}/products/{product}/referenceImages/{reference_image}" - ), - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=990, - serialized_end=1251, -) - - -_CREATEPRODUCTREQUEST = _descriptor.Descriptor( - name="CreateProductRequest", - full_name="google.cloud.vision.v1p4beta1.CreateProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.CreateProductRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p4beta1.CreateProductRequest.product", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_id", - full_name="google.cloud.vision.v1p4beta1.CreateProductRequest.product_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1254, - serialized_end=1417, -) - - -_LISTPRODUCTSREQUEST = _descriptor.Descriptor( - name="ListProductsRequest", - full_name="google.cloud.vision.v1p4beta1.ListProductsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.ListProductsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p4beta1.ListProductsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1419, - serialized_end=1538, -) - - -_LISTPRODUCTSRESPONSE = _descriptor.Descriptor( - name="ListProductsResponse", - full_name="google.cloud.vision.v1p4beta1.ListProductsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="products", - full_name="google.cloud.vision.v1p4beta1.ListProductsResponse.products", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1540, - serialized_end=1645, -) - - -_GETPRODUCTREQUEST = _descriptor.Descriptor( - name="GetProductRequest", - full_name="google.cloud.vision.v1p4beta1.GetProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.GetProductRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1647, - serialized_end=1719, -) - - -_UPDATEPRODUCTREQUEST = _descriptor.Descriptor( - name="UpdateProductRequest", - full_name="google.cloud.vision.v1p4beta1.UpdateProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p4beta1.UpdateProductRequest.product", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.vision.v1p4beta1.UpdateProductRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1722, - serialized_end=1855, -) - - -_DELETEPRODUCTREQUEST = _descriptor.Descriptor( - name="DeleteProductRequest", - full_name="google.cloud.vision.v1p4beta1.DeleteProductRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.DeleteProductRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1857, - serialized_end=1932, -) - - -_CREATEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="CreateProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.CreateProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.CreateProductSetRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p4beta1.CreateProductSetRequest.product_set", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product_set_id", - full_name="google.cloud.vision.v1p4beta1.CreateProductSetRequest.product_set_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1935, - serialized_end=2112, -) - - -_LISTPRODUCTSETSREQUEST = _descriptor.Descriptor( - name="ListProductSetsRequest", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2114, - serialized_end=2236, -) - - -_LISTPRODUCTSETSRESPONSE = _descriptor.Descriptor( - name="ListProductSetsResponse", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_sets", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsResponse.product_sets", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductSetsResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2238, - serialized_end=2353, -) - - -_GETPRODUCTSETREQUEST = _descriptor.Descriptor( - name="GetProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.GetProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.GetProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2355, - serialized_end=2433, -) - - -_UPDATEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="UpdateProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.UpdateProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_set", - full_name="google.cloud.vision.v1p4beta1.UpdateProductSetRequest.product_set", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="update_mask", - full_name="google.cloud.vision.v1p4beta1.UpdateProductSetRequest.update_mask", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2436, - serialized_end=2579, -) - - -_DELETEPRODUCTSETREQUEST = _descriptor.Descriptor( - name="DeleteProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.DeleteProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.DeleteProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2581, - serialized_end=2662, -) - - -_CREATEREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="CreateReferenceImageRequest", - full_name="google.cloud.vision.v1p4beta1.CreateReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reference_image", - full_name="google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.reference_image", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="reference_image_id", - full_name="google.cloud.vision.v1p4beta1.CreateReferenceImageRequest.reference_image_id", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2665, - serialized_end=2854, -) - - -_LISTREFERENCEIMAGESREQUEST = _descriptor.Descriptor( - name="ListReferenceImagesRequest", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2856, - serialized_end=2978, -) - - -_LISTREFERENCEIMAGESRESPONSE = _descriptor.Descriptor( - name="ListReferenceImagesResponse", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="reference_images", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.reference_images", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p4beta1.ListReferenceImagesResponse.next_page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=2981, - serialized_end=3127, -) - - -_GETREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="GetReferenceImageRequest", - full_name="google.cloud.vision.v1p4beta1.GetReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.GetReferenceImageRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$vision.googleapis.com/ReferenceImage" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3129, - serialized_end=3215, -) - - -_DELETEREFERENCEIMAGEREQUEST = _descriptor.Descriptor( - name="DeleteReferenceImageRequest", - full_name="google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A&\n$vision.googleapis.com/ReferenceImage" - ), - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3217, - serialized_end=3306, -) - - -_ADDPRODUCTTOPRODUCTSETREQUEST = _descriptor.Descriptor( - name="AddProductToProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.AddProductToProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p4beta1.AddProductToProductSetRequest.product", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3309, - serialized_end=3452, -) - - -_REMOVEPRODUCTFROMPRODUCTSETREQUEST = _descriptor.Descriptor( - name="RemoveProductFromProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="product", - full_name="google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest.product", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A\037\n\035vision.googleapis.com/Product" - ), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3455, - serialized_end=3603, -) - - -_LISTPRODUCTSINPRODUCTSETREQUEST = _descriptor.Descriptor( - name="ListProductsInProductSetRequest", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="name", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.name", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b('\340A\002\372A"\n vision.googleapis.com/ProductSet'), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_size", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.page_size", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest.page_token", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3606, - serialized_end=3734, -) - - -_LISTPRODUCTSINPRODUCTSETRESPONSE = _descriptor.Descriptor( - name="ListProductsInProductSetResponse", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="products", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.products", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="next_page_token", - full_name="google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse.next_page_token", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3736, - serialized_end=3853, -) - - -_IMPORTPRODUCTSETSGCSSOURCE = _descriptor.Descriptor( - name="ImportProductSetsGcsSource", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="csv_file_uri", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=3855, - serialized_end=3905, -) - - -_IMPORTPRODUCTSETSINPUTCONFIG = _descriptor.Descriptor( - name="ImportProductSetsInputConfig", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="gcs_source", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.gcs_source", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="source", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig.source", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=3907, - serialized_end=4028, -) - - -_IMPORTPRODUCTSETSREQUEST = _descriptor.Descriptor( - name="ImportProductSetsRequest", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsRequest.parent", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="input_config", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsRequest.input_config", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b("\340A\002"), - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4031, - serialized_end=4204, -) - - -_IMPORTPRODUCTSETSRESPONSE = _descriptor.Descriptor( - name="ImportProductSetsResponse", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsResponse", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="reference_images", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsResponse.reference_images", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="statuses", - full_name="google.cloud.vision.v1p4beta1.ImportProductSetsResponse.statuses", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4207, - serialized_end=4345, -) - - -_BATCHOPERATIONMETADATA = _descriptor.Descriptor( - name="BatchOperationMetadata", - full_name="google.cloud.vision.v1p4beta1.BatchOperationMetadata", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="state", - full_name="google.cloud.vision.v1p4beta1.BatchOperationMetadata.state", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="submit_time", - full_name="google.cloud.vision.v1p4beta1.BatchOperationMetadata.submit_time", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="end_time", - full_name="google.cloud.vision.v1p4beta1.BatchOperationMetadata.end_time", - index=2, - number=3, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BATCHOPERATIONMETADATA_STATE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4348, - serialized_end=4634, -) - - -_PRODUCTSETPURGECONFIG = _descriptor.Descriptor( - name="ProductSetPurgeConfig", - full_name="google.cloud.vision.v1p4beta1.ProductSetPurgeConfig", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_set_id", - full_name="google.cloud.vision.v1p4beta1.ProductSetPurgeConfig.product_set_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ) - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=4636, - serialized_end=4683, -) - - -_PURGEPRODUCTSREQUEST = _descriptor.Descriptor( - name="PurgeProductsRequest", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="product_set_purge_config", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest.product_set_purge_config", - index=0, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="delete_orphan_products", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest.delete_orphan_products", - index=1, - number=3, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="parent", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest.parent", - index=2, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="force", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest.force", - index=3, - number=4, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[ - _descriptor.OneofDescriptor( - name="target", - full_name="google.cloud.vision.v1p4beta1.PurgeProductsRequest.target", - index=0, - containing_type=None, - fields=[], - ) - ], - serialized_start=4686, - serialized_end=4916, -) - -_PRODUCT_KEYVALUE.containing_type = _PRODUCT -_PRODUCT.fields_by_name["product_labels"].message_type = _PRODUCT_KEYVALUE -_PRODUCTSET.fields_by_name[ - "index_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_PRODUCTSET.fields_by_name[ - "index_error" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_REFERENCEIMAGE.fields_by_name[ - "bounding_polys" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_CREATEPRODUCTREQUEST.fields_by_name["product"].message_type = _PRODUCT -_LISTPRODUCTSRESPONSE.fields_by_name["products"].message_type = _PRODUCT -_UPDATEPRODUCTREQUEST.fields_by_name["product"].message_type = _PRODUCT -_UPDATEPRODUCTREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEPRODUCTSETREQUEST.fields_by_name["product_set"].message_type = _PRODUCTSET -_LISTPRODUCTSETSRESPONSE.fields_by_name["product_sets"].message_type = _PRODUCTSET -_UPDATEPRODUCTSETREQUEST.fields_by_name["product_set"].message_type = _PRODUCTSET -_UPDATEPRODUCTSETREQUEST.fields_by_name[ - "update_mask" -].message_type = google_dot_protobuf_dot_field__mask__pb2._FIELDMASK -_CREATEREFERENCEIMAGEREQUEST.fields_by_name[ - "reference_image" -].message_type = _REFERENCEIMAGE -_LISTREFERENCEIMAGESRESPONSE.fields_by_name[ - "reference_images" -].message_type = _REFERENCEIMAGE -_LISTPRODUCTSINPRODUCTSETRESPONSE.fields_by_name["products"].message_type = _PRODUCT -_IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name[ - "gcs_source" -].message_type = _IMPORTPRODUCTSETSGCSSOURCE -_IMPORTPRODUCTSETSINPUTCONFIG.oneofs_by_name["source"].fields.append( - _IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name["gcs_source"] -) -_IMPORTPRODUCTSETSINPUTCONFIG.fields_by_name[ - "gcs_source" -].containing_oneof = _IMPORTPRODUCTSETSINPUTCONFIG.oneofs_by_name["source"] -_IMPORTPRODUCTSETSREQUEST.fields_by_name[ - "input_config" -].message_type = _IMPORTPRODUCTSETSINPUTCONFIG -_IMPORTPRODUCTSETSRESPONSE.fields_by_name[ - "reference_images" -].message_type = _REFERENCEIMAGE -_IMPORTPRODUCTSETSRESPONSE.fields_by_name[ - "statuses" -].message_type = google_dot_rpc_dot_status__pb2._STATUS -_BATCHOPERATIONMETADATA.fields_by_name[ - "state" -].enum_type = _BATCHOPERATIONMETADATA_STATE -_BATCHOPERATIONMETADATA.fields_by_name[ - "submit_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA.fields_by_name[ - "end_time" -].message_type = google_dot_protobuf_dot_timestamp__pb2._TIMESTAMP -_BATCHOPERATIONMETADATA_STATE.containing_type = _BATCHOPERATIONMETADATA -_PURGEPRODUCTSREQUEST.fields_by_name[ - "product_set_purge_config" -].message_type = _PRODUCTSETPURGECONFIG -_PURGEPRODUCTSREQUEST.oneofs_by_name["target"].fields.append( - _PURGEPRODUCTSREQUEST.fields_by_name["product_set_purge_config"] -) -_PURGEPRODUCTSREQUEST.fields_by_name[ - "product_set_purge_config" -].containing_oneof = _PURGEPRODUCTSREQUEST.oneofs_by_name["target"] -_PURGEPRODUCTSREQUEST.oneofs_by_name["target"].fields.append( - _PURGEPRODUCTSREQUEST.fields_by_name["delete_orphan_products"] -) -_PURGEPRODUCTSREQUEST.fields_by_name[ - "delete_orphan_products" -].containing_oneof = _PURGEPRODUCTSREQUEST.oneofs_by_name["target"] -DESCRIPTOR.message_types_by_name["Product"] = _PRODUCT -DESCRIPTOR.message_types_by_name["ProductSet"] = _PRODUCTSET -DESCRIPTOR.message_types_by_name["ReferenceImage"] = _REFERENCEIMAGE -DESCRIPTOR.message_types_by_name["CreateProductRequest"] = _CREATEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["ListProductsRequest"] = _LISTPRODUCTSREQUEST -DESCRIPTOR.message_types_by_name["ListProductsResponse"] = _LISTPRODUCTSRESPONSE -DESCRIPTOR.message_types_by_name["GetProductRequest"] = _GETPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["UpdateProductRequest"] = _UPDATEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["DeleteProductRequest"] = _DELETEPRODUCTREQUEST -DESCRIPTOR.message_types_by_name["CreateProductSetRequest"] = _CREATEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["ListProductSetsRequest"] = _LISTPRODUCTSETSREQUEST -DESCRIPTOR.message_types_by_name["ListProductSetsResponse"] = _LISTPRODUCTSETSRESPONSE -DESCRIPTOR.message_types_by_name["GetProductSetRequest"] = _GETPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["UpdateProductSetRequest"] = _UPDATEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name["DeleteProductSetRequest"] = _DELETEPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "CreateReferenceImageRequest" -] = _CREATEREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "ListReferenceImagesRequest" -] = _LISTREFERENCEIMAGESREQUEST -DESCRIPTOR.message_types_by_name[ - "ListReferenceImagesResponse" -] = _LISTREFERENCEIMAGESRESPONSE -DESCRIPTOR.message_types_by_name["GetReferenceImageRequest"] = _GETREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "DeleteReferenceImageRequest" -] = _DELETEREFERENCEIMAGEREQUEST -DESCRIPTOR.message_types_by_name[ - "AddProductToProductSetRequest" -] = _ADDPRODUCTTOPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "RemoveProductFromProductSetRequest" -] = _REMOVEPRODUCTFROMPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListProductsInProductSetRequest" -] = _LISTPRODUCTSINPRODUCTSETREQUEST -DESCRIPTOR.message_types_by_name[ - "ListProductsInProductSetResponse" -] = _LISTPRODUCTSINPRODUCTSETRESPONSE -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsGcsSource" -] = _IMPORTPRODUCTSETSGCSSOURCE -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsInputConfig" -] = _IMPORTPRODUCTSETSINPUTCONFIG -DESCRIPTOR.message_types_by_name["ImportProductSetsRequest"] = _IMPORTPRODUCTSETSREQUEST -DESCRIPTOR.message_types_by_name[ - "ImportProductSetsResponse" -] = _IMPORTPRODUCTSETSRESPONSE -DESCRIPTOR.message_types_by_name["BatchOperationMetadata"] = _BATCHOPERATIONMETADATA -DESCRIPTOR.message_types_by_name["ProductSetPurgeConfig"] = _PRODUCTSETPURGECONFIG -DESCRIPTOR.message_types_by_name["PurgeProductsRequest"] = _PURGEPRODUCTSREQUEST -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -Product = _reflection.GeneratedProtocolMessageType( - "Product", - (_message.Message,), - dict( - KeyValue=_reflection.GeneratedProtocolMessageType( - "KeyValue", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCT_KEYVALUE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""A product label represented as a key-value pair. - - - Attributes: - key: - The key of the label attached to the product. Cannot be empty - and cannot exceed 128 bytes. - value: - The value of the label attached to the product. Cannot be - empty and cannot exceed 128 bytes. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product.KeyValue) - ), - ), - DESCRIPTOR=_PRODUCT, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""A Product contains ReferenceImages. - - - Attributes: - name: - The resource name of the product. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - This field is ignored when creating a product. - display_name: - The user-provided name for this Product. Must not be empty. - Must be at most 4096 characters long. - description: - User-provided metadata to be stored with this product. Must be - at most 4096 characters long. - product_category: - Immutable. The category for the product identified by the - reference image. This should be either "homegoods-v2", - "apparel-v2", or "toys-v2". The legacy categories "homegoods", - "apparel", and "toys" are still supported, but these should - not be used for new products. - product_labels: - Key-value pairs that can be attached to a product. At query - time, constraints can be specified based on the - product\_labels. Note that integer values can be provided as - strings, e.g. "1199". Only strings with integer values can - match a range-based restriction which is to be supported soon. - Multiple values can be assigned to the same key. One product - may have up to 500 product\_labels. Notice that the total - number of distinct product\_labels over all products in one - ProductSet cannot exceed 1M, otherwise the product search - pipeline will refuse to work for that ProductSet. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Product) - ), -) -_sym_db.RegisterMessage(Product) -_sym_db.RegisterMessage(Product.KeyValue) - -ProductSet = _reflection.GeneratedProtocolMessageType( - "ProductSet", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSET, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""A ProductSet contains Products. A ProductSet can contain a - maximum of 1 million reference images. If the limit is exceeded, - periodic indexing will fail. - - - Attributes: - name: - The resource name of the ProductSet. Format is: ``projects/PR - OJECT_ID/locations/LOC_ID/productSets/PRODUCT_SET_ID``. This - field is ignored when creating a ProductSet. - display_name: - The user-provided name for this ProductSet. Must not be empty. - Must be at most 4096 characters long. - index_time: - Output only. The time at which this ProductSet was last - indexed. Query results will reflect all updates before this - time. If this ProductSet has never been indexed, this - timestamp is the default value "1970-01-01T00:00:00Z". This - field is ignored when creating a ProductSet. - index_error: - Output only. If there was an error with indexing the product - set, the field is populated. This field is ignored when - creating a ProductSet. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSet) - ), -) -_sym_db.RegisterMessage(ProductSet) - -ReferenceImage = _reflection.GeneratedProtocolMessageType( - "ReferenceImage", - (_message.Message,), - dict( - DESCRIPTOR=_REFERENCEIMAGE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""A ``ReferenceImage`` represents a product image and its - associated metadata, such as bounding boxes. - - - Attributes: - name: - The resource name of the reference image. Format is: ``proje - cts/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID/referenceI - mages/IMAGE_ID``. This field is ignored when creating a - reference image. - uri: - Required. The Google Cloud Storage URI of the reference image. - The URI must start with ``gs://``. - bounding_polys: - Optional. Bounding polygons around the areas of interest in - the reference image. If this field is empty, the system will - try to detect regions of interest. At most 10 bounding - polygons will be used. The provided shape is converted into a - non-rotated rectangle. Once converted, the small edge of the - rectangle must be greater than or equal to 300 pixels. The - aspect ratio must be 1:4 or less (i.e. 1:3 is ok; 1:5 is not). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ReferenceImage) - ), -) -_sym_db.RegisterMessage(ReferenceImage) - -CreateProductRequest = _reflection.GeneratedProtocolMessageType( - "CreateProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateProduct`` method. - - - Attributes: - parent: - Required. The project in which the Product should be created. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product: - Required. The product to create. - product_id: - A user-supplied resource id for this Product. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY\_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateProductRequest) - ), -) -_sym_db.RegisterMessage(CreateProductRequest) - -ListProductsRequest = _reflection.GeneratedProtocolMessageType( - "ListProductsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProducts`` method. - - - Attributes: - parent: - Required. The project OR ProductSet from which Products should - be listed. Format: ``projects/PROJECT_ID/locations/LOC_ID`` - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsRequest) - ), -) -_sym_db.RegisterMessage(ListProductsRequest) - -ListProductsResponse = _reflection.GeneratedProtocolMessageType( - "ListProductsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProducts`` method. - - - Attributes: - products: - List of products. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsResponse) - ), -) -_sym_db.RegisterMessage(ListProductsResponse) - -GetProductRequest = _reflection.GeneratedProtocolMessageType( - "GetProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETPRODUCTREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetProduct`` method. - - - Attributes: - name: - Required. Resource name of the Product to get. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetProductRequest) - ), -) -_sym_db.RegisterMessage(GetProductRequest) - -UpdateProductRequest = _reflection.GeneratedProtocolMessageType( - "UpdateProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``UpdateProduct`` method. - - - Attributes: - product: - Required. The Product resource which replaces the one on the - server. product.name is immutable. - update_mask: - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update\_mask isn't specified, all - mutable fields are to be updated. Valid mask paths include - ``product_labels``, ``display_name``, and ``description``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.UpdateProductRequest) - ), -) -_sym_db.RegisterMessage(UpdateProductRequest) - -DeleteProductRequest = _reflection.GeneratedProtocolMessageType( - "DeleteProductRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPRODUCTREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteProduct`` method. - - - Attributes: - name: - Required. Resource name of product to delete. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteProductRequest) - ), -) -_sym_db.RegisterMessage(DeleteProductRequest) - -CreateProductSetRequest = _reflection.GeneratedProtocolMessageType( - "CreateProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateProductSet`` method. - - - Attributes: - parent: - Required. The project in which the ProductSet should be - created. Format is ``projects/PROJECT_ID/locations/LOC_ID``. - product_set: - Required. The ProductSet to create. - product_set_id: - A user-supplied resource id for this ProductSet. If set, the - server will attempt to use this value as the resource id. If - it is already in use, an error is returned with code - ALREADY\_EXISTS. Must be at most 128 characters long. It - cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateProductSetRequest) - ), -) -_sym_db.RegisterMessage(CreateProductSetRequest) - -ListProductSetsRequest = _reflection.GeneratedProtocolMessageType( - "ListProductSetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSETSREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProductSets`` method. - - - Attributes: - parent: - Required. The project from which ProductSets should be listed. - Format is ``projects/PROJECT_ID/locations/LOC_ID``. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductSetsRequest) - ), -) -_sym_db.RegisterMessage(ListProductSetsRequest) - -ListProductSetsResponse = _reflection.GeneratedProtocolMessageType( - "ListProductSetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSETSRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProductSets`` method. - - - Attributes: - product_sets: - List of ProductSets. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductSetsResponse) - ), -) -_sym_db.RegisterMessage(ListProductSetsResponse) - -GetProductSetRequest = _reflection.GeneratedProtocolMessageType( - "GetProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetProductSet`` method. - - - Attributes: - name: - Required. Resource name of the ProductSet to get. Format is: - ``projects/PROJECT_ID/locations/LOG_ID/productSets/PRODUCT_SET - _ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetProductSetRequest) - ), -) -_sym_db.RegisterMessage(GetProductSetRequest) - -UpdateProductSetRequest = _reflection.GeneratedProtocolMessageType( - "UpdateProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_UPDATEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``UpdateProductSet`` method. - - - Attributes: - product_set: - Required. The ProductSet resource which replaces the one on - the server. - update_mask: - The [FieldMask][google.protobuf.FieldMask] that specifies - which fields to update. If update\_mask isn't specified, all - mutable fields are to be updated. Valid mask path is - ``display_name``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.UpdateProductSetRequest) - ), -) -_sym_db.RegisterMessage(UpdateProductSetRequest) - -DeleteProductSetRequest = _reflection.GeneratedProtocolMessageType( - "DeleteProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteProductSet`` method. - - - Attributes: - name: - Required. Resource name of the ProductSet to delete. Format - is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/PRODUCT - _SET_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteProductSetRequest) - ), -) -_sym_db.RegisterMessage(DeleteProductSetRequest) - -CreateReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "CreateReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_CREATEREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``CreateReferenceImage`` method. - - - Attributes: - parent: - Required. Resource name of the product in which to create the - reference image. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - reference_image: - Required. The reference image to create. If an image ID is - specified, it is ignored. - reference_image_id: - A user-supplied resource id for the ReferenceImage to be - added. If set, the server will attempt to use this value as - the resource id. If it is already in use, an error is returned - with code ALREADY\_EXISTS. Must be at most 128 characters - long. It cannot contain the character ``/``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.CreateReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(CreateReferenceImageRequest) - -ListReferenceImagesRequest = _reflection.GeneratedProtocolMessageType( - "ListReferenceImagesRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTREFERENCEIMAGESREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListReferenceImages`` method. - - - Attributes: - parent: - Required. Resource name of the product containing the - reference images. Format is - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID``. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - A token identifying a page of results to be returned. This is - the value of ``nextPageToken`` returned in a previous - reference image list request. Defaults to the first page if - not specified. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesRequest) - ), -) -_sym_db.RegisterMessage(ListReferenceImagesRequest) - -ListReferenceImagesResponse = _reflection.GeneratedProtocolMessageType( - "ListReferenceImagesResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTREFERENCEIMAGESRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListReferenceImages`` method. - - - Attributes: - reference_images: - The list of reference images. - page_size: - The maximum number of items to return. Default 10, maximum - 100. - next_page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListReferenceImagesResponse) - ), -) -_sym_db.RegisterMessage(ListReferenceImagesResponse) - -GetReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "GetReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_GETREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``GetReferenceImage`` method. - - - Attributes: - name: - Required. The resource name of the ReferenceImage to get. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PR - ODUCT_ID/referenceImages/IMAGE_ID``. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.GetReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(GetReferenceImageRequest) - -DeleteReferenceImageRequest = _reflection.GeneratedProtocolMessageType( - "DeleteReferenceImageRequest", - (_message.Message,), - dict( - DESCRIPTOR=_DELETEREFERENCEIMAGEREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``DeleteReferenceImage`` method. - - - Attributes: - name: - Required. The resource name of the reference image to delete. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/products/PR - ODUCT_ID/referenceImages/IMAGE_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.DeleteReferenceImageRequest) - ), -) -_sym_db.RegisterMessage(DeleteReferenceImageRequest) - -AddProductToProductSetRequest = _reflection.GeneratedProtocolMessageType( - "AddProductToProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_ADDPRODUCTTOPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``AddProductToProductSet`` method. - - - Attributes: - name: - Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/ - PRODUCT_SET_ID`` - product: - Required. The resource name for the Product to be added to - this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.AddProductToProductSetRequest) - ), -) -_sym_db.RegisterMessage(AddProductToProductSetRequest) - -RemoveProductFromProductSetRequest = _reflection.GeneratedProtocolMessageType( - "RemoveProductFromProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_REMOVEPRODUCTFROMPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``RemoveProductFromProductSet`` - method. - - - Attributes: - name: - Required. The resource name for the ProductSet to modify. - Format is: ``projects/PROJECT_ID/locations/LOC_ID/productSets/ - PRODUCT_SET_ID`` - product: - Required. The resource name for the Product to be removed from - this ProductSet. Format is: - ``projects/PROJECT_ID/locations/LOC_ID/products/PRODUCT_ID`` - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.RemoveProductFromProductSetRequest) - ), -) -_sym_db.RegisterMessage(RemoveProductFromProductSetRequest) - -ListProductsInProductSetRequest = _reflection.GeneratedProtocolMessageType( - "ListProductsInProductSetRequest", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSINPRODUCTSETREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ListProductsInProductSet`` - method. - - - Attributes: - name: - Required. The ProductSet resource for which to retrieve - Products. Format is: ``projects/PROJECT_ID/locations/LOC_ID/p - roductSets/PRODUCT_SET_ID`` - page_size: - The maximum number of items to return. Default 10, maximum - 100. - page_token: - The next\_page\_token returned from a previous List request, - if any. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetRequest) - ), -) -_sym_db.RegisterMessage(ListProductsInProductSetRequest) - -ListProductsInProductSetResponse = _reflection.GeneratedProtocolMessageType( - "ListProductsInProductSetResponse", - (_message.Message,), - dict( - DESCRIPTOR=_LISTPRODUCTSINPRODUCTSETRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ListProductsInProductSet`` - method. - - - Attributes: - products: - The list of Products. - next_page_token: - Token to retrieve the next page of results, or empty if there - are no more results in the list. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ListProductsInProductSetResponse) - ), -) -_sym_db.RegisterMessage(ListProductsInProductSetResponse) - -ImportProductSetsGcsSource = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsGcsSource", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSGCSSOURCE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""The Google Cloud Storage location for a csv file which - preserves a list of ImportProductSetRequests in each line. - - - Attributes: - csv_file_uri: - The Google Cloud Storage URI of the input csv file. The URI - must start with ``gs://``. The format of the input csv file - should be one image per line. In each line, there are 8 - columns. 1. image-uri 2. image-id 3. product-set-id 4. - product-id 5. product-category 6. product-display-name 7. - labels 8. bounding-poly The ``image-uri``, ``product-set- - id``, ``product-id``, and ``product-category`` columns are - required. All other columns are optional. If the - ``ProductSet`` or ``Product`` specified by the ``product-set- - id`` and ``product-id`` values does not exist, then the system - will create a new ``ProductSet`` or ``Product`` for the image. - In this case, the ``product-display-name`` column refers to [d - isplay\_name][google.cloud.vision.v1p4beta1.Product.display\_n - ame], the ``product-category`` column refers to [product\_cate - gory][google.cloud.vision.v1p4beta1.Product.product\_category] - , and the ``labels`` column refers to [product\_labels][google - .cloud.vision.v1p4beta1.Product.product\_labels]. The - ``image-id`` column is optional but must be unique if - provided. If it is empty, the system will automatically assign - a unique id to the image. The ``product-display-name`` column - is optional. If it is empty, the system sets the [display\_nam - e][google.cloud.vision.v1p4beta1.Product.display\_name] field - for the product to a space (" "). You can update the - ``display_name`` later by using the API. If a ``Product`` - with the specified ``product-id`` already exists, then the - system ignores the ``product-display-name``, ``product- - category``, and ``labels`` columns. The ``labels`` column - (optional) is a line containing a list of comma-separated key- - value pairs, in the following format: :: - "key_1=value_1,key_2=value_2,...,key_n=value_n" The - ``bounding-poly`` column (optional) identifies one region of - interest from the image in the same manner as - ``CreateReferenceImage``. If you do not specify the - ``bounding-poly`` column, then the system will try to detect - regions of interest automatically. At most one ``bounding- - poly`` column is allowed per line. If the image contains - multiple regions of interest, add a line to the CSV file that - includes the same product information, and the ``bounding- - poly`` values for each region of interest. The ``bounding- - poly`` column must contain an even number of comma-separated - numbers, in the format - "p1\_x,p1\_y,p2\_x,p2\_y,...,pn\_x,pn\_y". Use non-negative - integers for absolute bounding polygons, and float values in - [0, 1] for normalized bounding polygons. The system will - resize the image if the image resolution is too large to - process (larger than 20MP). - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsGcsSource) - ), -) -_sym_db.RegisterMessage(ImportProductSetsGcsSource) - -ImportProductSetsInputConfig = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsInputConfig", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSINPUTCONFIG, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""The input content for the ``ImportProductSets`` method. - - - Attributes: - source: - The source of the input. - gcs_source: - The Google Cloud Storage location for a csv file which - preserves a list of ImportProductSetRequests in each line. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsInputConfig) - ), -) -_sym_db.RegisterMessage(ImportProductSetsInputConfig) - -ImportProductSetsRequest = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``ImportProductSets`` method. - - - Attributes: - parent: - Required. The project in which the ProductSets should be - imported. Format is ``projects/PROJECT_ID/locations/LOC_ID``. - input_config: - Required. The input content for the list of requests. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsRequest) - ), -) -_sym_db.RegisterMessage(ImportProductSetsRequest) - -ImportProductSetsResponse = _reflection.GeneratedProtocolMessageType( - "ImportProductSetsResponse", - (_message.Message,), - dict( - DESCRIPTOR=_IMPORTPRODUCTSETSRESPONSE, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Response message for the ``ImportProductSets`` method. - - This message is returned by the - [google.longrunning.Operations.GetOperation][google.longrunning.Operations.GetOperation] - method in the returned - [google.longrunning.Operation.response][google.longrunning.Operation.response] - field. - - - Attributes: - reference_images: - The list of reference\_images that are imported successfully. - statuses: - The rpc status for each ImportProductSet request, including - both successes and errors. The number of statuses here - matches the number of lines in the csv file, and statuses[i] - stores the success or failure status of processing the i-th - line of the csv, starting from line 0. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ImportProductSetsResponse) - ), -) -_sym_db.RegisterMessage(ImportProductSetsResponse) - -BatchOperationMetadata = _reflection.GeneratedProtocolMessageType( - "BatchOperationMetadata", - (_message.Message,), - dict( - DESCRIPTOR=_BATCHOPERATIONMETADATA, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Metadata for the batch operations such as the current - state. - - This is included in the ``metadata`` field of the ``Operation`` returned - by the ``GetOperation`` call of the ``google::longrunning::Operations`` - service. - - - Attributes: - state: - The current state of the batch operation. - submit_time: - The time when the batch request was submitted to the server. - end_time: - The time when the batch request is finished and [google.longru - nning.Operation.done][google.longrunning.Operation.done] is - set to true. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.BatchOperationMetadata) - ), -) -_sym_db.RegisterMessage(BatchOperationMetadata) - -ProductSetPurgeConfig = _reflection.GeneratedProtocolMessageType( - "ProductSetPurgeConfig", - (_message.Message,), - dict( - DESCRIPTOR=_PRODUCTSETPURGECONFIG, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Config to control which ProductSet contains the Products to be deleted. - - - Attributes: - product_set_id: - The ProductSet that contains the Products to delete. If a - Product is a member of product\_set\_id in addition to other - ProductSets, the Product will still be deleted. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.ProductSetPurgeConfig) - ), -) -_sym_db.RegisterMessage(ProductSetPurgeConfig) - -PurgeProductsRequest = _reflection.GeneratedProtocolMessageType( - "PurgeProductsRequest", - (_message.Message,), - dict( - DESCRIPTOR=_PURGEPRODUCTSREQUEST, - __module__="google.cloud.vision_v1p4beta1.proto.product_search_service_pb2", - __doc__="""Request message for the ``PurgeProducts`` method. - - - Attributes: - target: - The Products to delete. - product_set_purge_config: - Specify which ProductSet contains the Products to be deleted. - delete_orphan_products: - If delete\_orphan\_products is true, all Products that are not - in any ProductSet will be deleted. - parent: - Required. The project and location in which the Products - should be deleted. Format is - ``projects/PROJECT_ID/locations/LOC_ID``. - force: - The default value is false. Override this value to true to - actually perform the purge. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.PurgeProductsRequest) - ), -) -_sym_db.RegisterMessage(PurgeProductsRequest) - - -DESCRIPTOR._options = None -_PRODUCT.fields_by_name["product_category"]._options = None -_PRODUCT._options = None -_PRODUCTSET.fields_by_name["index_time"]._options = None -_PRODUCTSET.fields_by_name["index_error"]._options = None -_PRODUCTSET._options = None -_REFERENCEIMAGE.fields_by_name["uri"]._options = None -_REFERENCEIMAGE.fields_by_name["bounding_polys"]._options = None -_REFERENCEIMAGE._options = None -_CREATEPRODUCTREQUEST.fields_by_name["parent"]._options = None -_CREATEPRODUCTREQUEST.fields_by_name["product"]._options = None -_LISTPRODUCTSREQUEST.fields_by_name["parent"]._options = None -_GETPRODUCTREQUEST.fields_by_name["name"]._options = None -_UPDATEPRODUCTREQUEST.fields_by_name["product"]._options = None -_DELETEPRODUCTREQUEST.fields_by_name["name"]._options = None -_CREATEPRODUCTSETREQUEST.fields_by_name["parent"]._options = None -_CREATEPRODUCTSETREQUEST.fields_by_name["product_set"]._options = None -_LISTPRODUCTSETSREQUEST.fields_by_name["parent"]._options = None -_GETPRODUCTSETREQUEST.fields_by_name["name"]._options = None -_UPDATEPRODUCTSETREQUEST.fields_by_name["product_set"]._options = None -_DELETEPRODUCTSETREQUEST.fields_by_name["name"]._options = None -_CREATEREFERENCEIMAGEREQUEST.fields_by_name["parent"]._options = None -_CREATEREFERENCEIMAGEREQUEST.fields_by_name["reference_image"]._options = None -_LISTREFERENCEIMAGESREQUEST.fields_by_name["parent"]._options = None -_GETREFERENCEIMAGEREQUEST.fields_by_name["name"]._options = None -_DELETEREFERENCEIMAGEREQUEST.fields_by_name["name"]._options = None -_ADDPRODUCTTOPRODUCTSETREQUEST.fields_by_name["name"]._options = None -_ADDPRODUCTTOPRODUCTSETREQUEST.fields_by_name["product"]._options = None -_REMOVEPRODUCTFROMPRODUCTSETREQUEST.fields_by_name["name"]._options = None -_REMOVEPRODUCTFROMPRODUCTSETREQUEST.fields_by_name["product"]._options = None -_LISTPRODUCTSINPRODUCTSETREQUEST.fields_by_name["name"]._options = None -_IMPORTPRODUCTSETSREQUEST.fields_by_name["parent"]._options = None -_IMPORTPRODUCTSETSREQUEST.fields_by_name["input_config"]._options = None -_PURGEPRODUCTSREQUEST.fields_by_name["parent"]._options = None - -_PRODUCTSEARCH = _descriptor.ServiceDescriptor( - name="ProductSearch", - full_name="google.cloud.vision.v1p4beta1.ProductSearch", - file=DESCRIPTOR, - index=0, - serialized_options=_b( - "\312A\025vision.googleapis.com\322A[https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloud-vision" - ), - serialized_start=4919, - serialized_end=9097, - methods=[ - _descriptor.MethodDescriptor( - name="CreateProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.CreateProductSet", - index=0, - containing_service=None, - input_type=_CREATEPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - '\202\323\344\223\002E"6/v1p4beta1/{parent=projects/*/locations/*}/productSets:\013product_set\332A!parent,product_set,product_set_id' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductSets", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.ListProductSets", - index=1, - containing_service=None, - input_type=_LISTPRODUCTSETSREQUEST, - output_type=_LISTPRODUCTSETSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0028\0226/v1p4beta1/{parent=projects/*/locations/*}/productSets\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.GetProductSet", - index=2, - containing_service=None, - input_type=_GETPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\0028\0226/v1p4beta1/{name=projects/*/locations/*/productSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.UpdateProductSet", - index=3, - containing_service=None, - input_type=_UPDATEPRODUCTSETREQUEST, - output_type=_PRODUCTSET, - serialized_options=_b( - "\202\323\344\223\002Q2B/v1p4beta1/{product_set.name=projects/*/locations/*/productSets/*}:\013product_set\332A\027product_set,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.DeleteProductSet", - index=4, - containing_service=None, - input_type=_DELETEPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0028*6/v1p4beta1/{name=projects/*/locations/*/productSets/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateProduct", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.CreateProduct", - index=5, - containing_service=None, - input_type=_CREATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - '\202\323\344\223\002>"3/v1p4beta1/{parent=projects/*/locations/*}/products:\007product\332A\031parent,product,product_id' - ), - ), - _descriptor.MethodDescriptor( - name="ListProducts", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.ListProducts", - index=6, - containing_service=None, - input_type=_LISTPRODUCTSREQUEST, - output_type=_LISTPRODUCTSRESPONSE, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1p4beta1/{parent=projects/*/locations/*}/products\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetProduct", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.GetProduct", - index=7, - containing_service=None, - input_type=_GETPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\0025\0223/v1p4beta1/{name=projects/*/locations/*/products/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="UpdateProduct", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.UpdateProduct", - index=8, - containing_service=None, - input_type=_UPDATEPRODUCTREQUEST, - output_type=_PRODUCT, - serialized_options=_b( - "\202\323\344\223\002F2;/v1p4beta1/{product.name=projects/*/locations/*/products/*}:\007product\332A\023product,update_mask" - ), - ), - _descriptor.MethodDescriptor( - name="DeleteProduct", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.DeleteProduct", - index=9, - containing_service=None, - input_type=_DELETEPRODUCTREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0025*3/v1p4beta1/{name=projects/*/locations/*/products/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="CreateReferenceImage", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.CreateReferenceImage", - index=10, - containing_service=None, - input_type=_CREATEREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - '\202\323\344\223\002X"E/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages:\017reference_image\332A)parent,reference_image,reference_image_id' - ), - ), - _descriptor.MethodDescriptor( - name="DeleteReferenceImage", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.DeleteReferenceImage", - index=11, - containing_service=None, - input_type=_DELETEREFERENCEIMAGEREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002G*E/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ListReferenceImages", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.ListReferenceImages", - index=12, - containing_service=None, - input_type=_LISTREFERENCEIMAGESREQUEST, - output_type=_LISTREFERENCEIMAGESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1p4beta1/{parent=projects/*/locations/*/products/*}/referenceImages\332A\006parent" - ), - ), - _descriptor.MethodDescriptor( - name="GetReferenceImage", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.GetReferenceImage", - index=13, - containing_service=None, - input_type=_GETREFERENCEIMAGEREQUEST, - output_type=_REFERENCEIMAGE, - serialized_options=_b( - "\202\323\344\223\002G\022E/v1p4beta1/{name=projects/*/locations/*/products/*/referenceImages/*}\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="AddProductToProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.AddProductToProductSet", - index=14, - containing_service=None, - input_type=_ADDPRODUCTTOPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002F"A/v1p4beta1/{name=projects/*/locations/*/productSets/*}:addProduct:\001*\332A\014name,product' - ), - ), - _descriptor.MethodDescriptor( - name="RemoveProductFromProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.RemoveProductFromProductSet", - index=15, - containing_service=None, - input_type=_REMOVEPRODUCTFROMPRODUCTSETREQUEST, - output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - '\202\323\344\223\002I"D/v1p4beta1/{name=projects/*/locations/*/productSets/*}:removeProduct:\001*\332A\014name,product' - ), - ), - _descriptor.MethodDescriptor( - name="ListProductsInProductSet", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.ListProductsInProductSet", - index=16, - containing_service=None, - input_type=_LISTPRODUCTSINPRODUCTSETREQUEST, - output_type=_LISTPRODUCTSINPRODUCTSETRESPONSE, - serialized_options=_b( - "\202\323\344\223\002A\022?/v1p4beta1/{name=projects/*/locations/*/productSets/*}/products\332A\004name" - ), - ), - _descriptor.MethodDescriptor( - name="ImportProductSets", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.ImportProductSets", - index=17, - containing_service=None, - input_type=_IMPORTPRODUCTSETSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002B"=/v1p4beta1/{parent=projects/*/locations/*}/productSets:import:\001*\332A\023parent,input_config\312A3\n\031ImportProductSetsResponse\022\026BatchOperationMetadata' - ), - ), - _descriptor.MethodDescriptor( - name="PurgeProducts", - full_name="google.cloud.vision.v1p4beta1.ProductSearch.PurgeProducts", - index=18, - containing_service=None, - input_type=_PURGEPRODUCTSREQUEST, - output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, - serialized_options=_b( - '\202\323\344\223\002>"9/v1p4beta1/{parent=projects/*/locations/*}/products:purge:\001*\332A\006parent\312A/\n\025google.protobuf.Empty\022\026BatchOperationMetadata' - ), - ), - ], -) -_sym_db.RegisterServiceDescriptor(_PRODUCTSEARCH) - -DESCRIPTOR.services_by_name["ProductSearch"] = _PRODUCTSEARCH - -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py deleted file mode 100644 index 0d1f9704cb5a..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py +++ /dev/null @@ -1,530 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc - -from google.cloud.vision_v1p4beta1.proto import ( - product_search_service_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2, -) -from google.longrunning import ( - operations_pb2 as google_dot_longrunning_dot_operations__pb2, -) -from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 - - -class ProductSearchStub(object): - """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.v1p4beta1.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.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` - - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, - named - `projects/*/locations/*/products/*/referenceImages/*` - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/CreateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.ListProductSets = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/ListProductSets", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.FromString, - ) - self.GetProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/GetProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.UpdateProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/UpdateProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.FromString, - ) - self.DeleteProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/DeleteProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateProduct = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/CreateProduct", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.ListProducts = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/ListProducts", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.FromString, - ) - self.GetProduct = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/GetProduct", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.UpdateProduct = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/UpdateProduct", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.FromString, - ) - self.DeleteProduct = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/DeleteProduct", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.CreateReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/CreateReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.DeleteReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/DeleteReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListReferenceImages = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/ListReferenceImages", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.FromString, - ) - self.GetReferenceImage = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/GetReferenceImage", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.FromString, - ) - self.AddProductToProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/AddProductToProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.RemoveProductFromProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/RemoveProductFromProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.SerializeToString, - response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, - ) - self.ListProductsInProductSet = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/ListProductsInProductSet", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.SerializeToString, - response_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.FromString, - ) - self.ImportProductSets = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/ImportProductSets", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - self.PurgeProducts = channel.unary_unary( - "/google.cloud.vision.v1p4beta1.ProductSearch/PurgeProducts", - request_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.PurgeProductsRequest.SerializeToString, - response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, - ) - - -class ProductSearchServicer(object): - """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.v1p4beta1.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.v1p4beta1.Product] resources, named - `projects/*/locations/*/products/*` - - - Each [Product][google.cloud.vision.v1p4beta1.Product] has a collection of - [ReferenceImage][google.cloud.vision.v1p4beta1.ReferenceImage] resources, - named - `projects/*/locations/*/products/*/referenceImages/*` - """ - - def CreateProductSet(self, request, context): - """Creates and returns a new ProductSet resource. - - Possible errors: - - * Returns INVALID_ARGUMENT if display_name is missing, or is longer than - 4096 characters. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductSets(self, request, context): - """Lists ProductSets in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100, or less - than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProductSet(self, request, context): - """Gets information associated with a ProductSet. - - Possible errors: - - * Returns NOT_FOUND if the ProductSet does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProductSet(self, request, context): - """Permanently deletes a ProductSet. Products and ReferenceImages in the - ProductSet are not deleted. - - The actual image files are not deleted from Google Cloud Storage. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProducts(self, request, context): - """Lists products in an unspecified order. - - Possible errors: - - * Returns INVALID_ARGUMENT if page_size is greater than 100 or less than 1. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetProduct(self, request, context): - """Gets information associated with a Product. - - Possible errors: - - * Returns NOT_FOUND if the Product does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def UpdateProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteProduct(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def CreateReferenceImage(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def DeleteReferenceImage(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListReferenceImages(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def GetReferenceImage(self, request, context): - """Gets information associated with a ReferenceImage. - - Possible errors: - - * Returns NOT_FOUND if the specified image does not exist. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def AddProductToProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def RemoveProductFromProductSet(self, request, context): - """Removes a Product from the specified ProductSet. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ListProductsInProductSet(self, request, context): - """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. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def ImportProductSets(self, request, context): - """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.v1p4beta1.ImportProductSetsGcsSource.csv_file_uri]. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - def PurgeProducts(self, request, context): - """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) - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details("Method not implemented!") - raise NotImplementedError("Method not implemented!") - - -def add_ProductSearchServicer_to_server(servicer, server): - rpc_method_handlers = { - "CreateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.CreateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "ListProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ListProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductSetsResponse.SerializeToString, - ), - "GetProductSet": grpc.unary_unary_rpc_method_handler( - servicer.GetProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "UpdateProductSet": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.UpdateProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ProductSet.SerializeToString, - ), - "DeleteProductSet": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateProduct": grpc.unary_unary_rpc_method_handler( - servicer.CreateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "ListProducts": grpc.unary_unary_rpc_method_handler( - servicer.ListProducts, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsResponse.SerializeToString, - ), - "GetProduct": grpc.unary_unary_rpc_method_handler( - servicer.GetProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "UpdateProduct": grpc.unary_unary_rpc_method_handler( - servicer.UpdateProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.UpdateProductRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.Product.SerializeToString, - ), - "DeleteProduct": grpc.unary_unary_rpc_method_handler( - servicer.DeleteProduct, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteProductRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "CreateReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.CreateReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.CreateReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "DeleteReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.DeleteReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.DeleteReferenceImageRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListReferenceImages": grpc.unary_unary_rpc_method_handler( - servicer.ListReferenceImages, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListReferenceImagesResponse.SerializeToString, - ), - "GetReferenceImage": grpc.unary_unary_rpc_method_handler( - servicer.GetReferenceImage, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.GetReferenceImageRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ReferenceImage.SerializeToString, - ), - "AddProductToProductSet": grpc.unary_unary_rpc_method_handler( - servicer.AddProductToProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.AddProductToProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "RemoveProductFromProductSet": grpc.unary_unary_rpc_method_handler( - servicer.RemoveProductFromProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.RemoveProductFromProductSetRequest.FromString, - response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, - ), - "ListProductsInProductSet": grpc.unary_unary_rpc_method_handler( - servicer.ListProductsInProductSet, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetRequest.FromString, - response_serializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ListProductsInProductSetResponse.SerializeToString, - ), - "ImportProductSets": grpc.unary_unary_rpc_method_handler( - servicer.ImportProductSets, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.ImportProductSetsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - "PurgeProducts": grpc.unary_unary_rpc_method_handler( - servicer.PurgeProducts, - request_deserializer=google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_product__search__service__pb2.PurgeProductsRequest.FromString, - response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - "google.cloud.vision.v1p4beta1.ProductSearch", rpc_method_handlers - ) - server.add_generic_rpc_handlers((generic_handler,)) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation.proto b/vision/google/cloud/vision_v1p4beta1/proto/text_annotation.proto deleted file mode 100644 index fbc35bb5458f..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation.proto +++ /dev/null @@ -1,261 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; -import "google/cloud/vision/v1p4beta1/geometry.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "TextAnnotationProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// TextAnnotation contains a structured representation of OCR extracted text. -// The hierarchy of an OCR extracted text structure is like this: -// TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol -// Each structural component, starting from Page, may further have their own -// properties. Properties describe detected languages, breaks etc.. Please refer -// to the -// [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] -// message definition below for more detail. -message TextAnnotation { - // Detected language for a structural component. - message DetectedLanguage { - // The BCP-47 language code, such as "en-US" or "sr-Latn". For more - // information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 1; - - // Confidence of detected language. Range [0, 1]. - float confidence = 2; - } - - // Detected start or end of a structural component. - message DetectedBreak { - // Enum to denote the type of break found. New line, space etc. - enum BreakType { - // Unknown break label type. - UNKNOWN = 0; - - // Regular space. - SPACE = 1; - - // Sure space (very wide). - SURE_SPACE = 2; - - // Line-wrapping break. - EOL_SURE_SPACE = 3; - - // End-line hyphen that is not present in text; does not co-occur with - // `SPACE`, `LEADER_SPACE`, or `LINE_BREAK`. - HYPHEN = 4; - - // Line break that ends a paragraph. - LINE_BREAK = 5; - } - - // Detected break type. - BreakType type = 1; - - // True if break prepends the element. - bool is_prefix = 2; - } - - // Additional information detected on the structural component. - message TextProperty { - // A list of detected languages together with confidence. - repeated DetectedLanguage detected_languages = 1; - - // Detected start or end of a text segment. - DetectedBreak detected_break = 2; - } - - // List of pages detected by OCR. - repeated Page pages = 1; - - // UTF-8 text detected on the pages. - string text = 2; -} - -// Detected page from OCR. -message Page { - // Additional information detected on the page. - TextAnnotation.TextProperty property = 1; - - // Page width. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 width = 2; - - // Page height. For PDFs the unit is points. For images (including - // TIFFs) the unit is pixels. - int32 height = 3; - - // List of blocks of text, images etc on this page. - repeated Block blocks = 4; - - // Confidence of the OCR results on the page. Range [0, 1]. - float confidence = 5; -} - -// Logical element on the page. -message Block { - // Type of a block (text, image etc) as identified by OCR. - enum BlockType { - // Unknown block type. - UNKNOWN = 0; - - // Regular text block. - TEXT = 1; - - // Table block. - TABLE = 2; - - // Image block. - PICTURE = 3; - - // Horizontal/vertical line box. - RULER = 4; - - // Barcode block. - BARCODE = 5; - } - - // Additional information detected for the block. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the block. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // - // * when the text is horizontal it might look like: - // - // 0----1 - // | | - // 3----2 - // - // * when it's rotated 180 degrees around the top-left corner it becomes: - // - // 2----3 - // | | - // 1----0 - // - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of paragraphs in this block (if this blocks is of type text). - repeated Paragraph paragraphs = 3; - - // Detected block type (text, image etc) for this block. - BlockType block_type = 4; - - // Confidence of the OCR results on the block. Range [0, 1]. - float confidence = 5; -} - -// Structural unit of text representing a number of words in certain order. -message Paragraph { - // Additional information detected for the paragraph. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the paragraph. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of all words in this paragraph. - repeated Word words = 3; - - // Confidence of the OCR results for the paragraph. Range [0, 1]. - float confidence = 4; -} - -// A word representation. -message Word { - // Additional information detected for the word. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the word. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // List of symbols in the word. - // The order of the symbols follows the natural reading order. - repeated Symbol symbols = 3; - - // Confidence of the OCR results for the word. Range [0, 1]. - float confidence = 4; -} - -// A single symbol representation. -message Symbol { - // Additional information detected for the symbol. - TextAnnotation.TextProperty property = 1; - - // The bounding box for the symbol. - // The vertices are in the order of top-left, top-right, bottom-right, - // bottom-left. When a rotation of the bounding box is detected the rotation - // is represented as around the top-left corner as defined when the text is - // read in the 'natural' orientation. - // For example: - // * when the text is horizontal it might look like: - // 0----1 - // | | - // 3----2 - // * when it's rotated 180 degrees around the top-left corner it becomes: - // 2----3 - // | | - // 1----0 - // and the vertex order will still be (0, 1, 2, 3). - BoundingPoly bounding_box = 2; - - // The actual UTF-8 representation of the symbol. - string text = 3; - - // Confidence of the OCR results for the symbol. Range [0, 1]. - float confidence = 4; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py deleted file mode 100644 index afabc3ee403a..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py +++ /dev/null @@ -1,1139 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/text_annotation.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 -from google.cloud.vision_v1p4beta1.proto import ( - geometry_pb2 as google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2, -) - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/text_annotation.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\023TextAnnotationProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n9google/cloud/vision_v1p4beta1/proto/text_annotation.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto\x1a\x32google/cloud/vision_v1p4beta1/proto/geometry.proto"\xb2\x04\n\x0eTextAnnotation\x12\x32\n\x05pages\x18\x01 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Page\x12\x0c\n\x04text\x18\x02 \x01(\t\x1a=\n\x10\x44\x65tectedLanguage\x12\x15\n\rlanguage_code\x18\x01 \x01(\t\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x1a\xdc\x01\n\rDetectedBreak\x12S\n\x04type\x18\x01 \x01(\x0e\x32\x45.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType\x12\x11\n\tis_prefix\x18\x02 \x01(\x08"c\n\tBreakType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\t\n\x05SPACE\x10\x01\x12\x0e\n\nSURE_SPACE\x10\x02\x12\x12\n\x0e\x45OL_SURE_SPACE\x10\x03\x12\n\n\x06HYPHEN\x10\x04\x12\x0e\n\nLINE_BREAK\x10\x05\x1a\xbf\x01\n\x0cTextProperty\x12Z\n\x12\x64\x65tected_languages\x18\x01 \x03(\x0b\x32>.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage\x12S\n\x0e\x64\x65tected_break\x18\x02 \x01(\x0b\x32;.google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak"\xbd\x01\n\x04Page\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\r\n\x05width\x18\x02 \x01(\x05\x12\x0e\n\x06height\x18\x03 \x01(\x05\x12\x34\n\x06\x62locks\x18\x04 \x03(\x0b\x32$.google.cloud.vision.v1p4beta1.Block\x12\x12\n\nconfidence\x18\x05 \x01(\x02"\x82\x03\n\x05\x42lock\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12<\n\nparagraphs\x18\x03 \x03(\x0b\x32(.google.cloud.vision.v1p4beta1.Paragraph\x12\x42\n\nblock_type\x18\x04 \x01(\x0e\x32..google.cloud.vision.v1p4beta1.Block.BlockType\x12\x12\n\nconfidence\x18\x05 \x01(\x02"R\n\tBlockType\x12\x0b\n\x07UNKNOWN\x10\x00\x12\x08\n\x04TEXT\x10\x01\x12\t\n\x05TABLE\x10\x02\x12\x0b\n\x07PICTURE\x10\x03\x12\t\n\x05RULER\x10\x04\x12\x0b\n\x07\x42\x41RCODE\x10\x05"\xe4\x01\n\tParagraph\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x32\n\x05words\x18\x03 \x03(\x0b\x32#.google.cloud.vision.v1p4beta1.Word\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xe3\x01\n\x04Word\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x36\n\x07symbols\x18\x03 \x03(\x0b\x32%.google.cloud.vision.v1p4beta1.Symbol\x12\x12\n\nconfidence\x18\x04 \x01(\x02"\xbb\x01\n\x06Symbol\x12L\n\x08property\x18\x01 \x01(\x0b\x32:.google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty\x12\x41\n\x0c\x62ounding_box\x18\x02 \x01(\x0b\x32+.google.cloud.vision.v1p4beta1.BoundingPoly\x12\x0c\n\x04text\x18\x03 \x01(\t\x12\x12\n\nconfidence\x18\x04 \x01(\x02\x42\x89\x01\n!com.google.cloud.vision.v1p4beta1B\x13TextAnnotationProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[ - google_dot_api_dot_annotations__pb2.DESCRIPTOR, - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2.DESCRIPTOR, - ], -) - - -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE = _descriptor.EnumDescriptor( - name="BreakType", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.BreakType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SPACE", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="SURE_SPACE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="EOL_SURE_SPACE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="HYPHEN", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="LINE_BREAK", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=444, - serialized_end=543, -) -_sym_db.RegisterEnumDescriptor(_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE) - -_BLOCK_BLOCKTYPE = _descriptor.EnumDescriptor( - name="BlockType", - full_name="google.cloud.vision.v1p4beta1.Block.BlockType", - filename=None, - file=DESCRIPTOR, - values=[ - _descriptor.EnumValueDescriptor( - name="UNKNOWN", index=0, number=0, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TEXT", index=1, number=1, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="TABLE", index=2, number=2, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="PICTURE", index=3, number=3, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="RULER", index=4, number=4, serialized_options=None, type=None - ), - _descriptor.EnumValueDescriptor( - name="BARCODE", index=5, number=5, serialized_options=None, type=None - ), - ], - containing_type=None, - serialized_options=None, - serialized_start=1236, - serialized_end=1318, -) -_sym_db.RegisterEnumDescriptor(_BLOCK_BLOCKTYPE) - - -_TEXTANNOTATION_DETECTEDLANGUAGE = _descriptor.Descriptor( - name="DetectedLanguage", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.language_code", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage.confidence", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=259, - serialized_end=320, -) - -_TEXTANNOTATION_DETECTEDBREAK = _descriptor.Descriptor( - name="DetectedBreak", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="type", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.type", - index=0, - number=1, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="is_prefix", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak.is_prefix", - index=1, - number=2, - type=8, - cpp_type=7, - label=1, - has_default_value=False, - default_value=False, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=323, - serialized_end=543, -) - -_TEXTANNOTATION_TEXTPROPERTY = _descriptor.Descriptor( - name="TextProperty", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="detected_languages", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.detected_languages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="detected_break", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty.detected_break", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=546, - serialized_end=737, -) - -_TEXTANNOTATION = _descriptor.Descriptor( - name="TextAnnotation", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="pages", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.pages", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p4beta1.TextAnnotation.text", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _TEXTANNOTATION_DETECTEDLANGUAGE, - _TEXTANNOTATION_DETECTEDBREAK, - _TEXTANNOTATION_TEXTPROPERTY, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=175, - serialized_end=737, -) - - -_PAGE = _descriptor.Descriptor( - name="Page", - full_name="google.cloud.vision.v1p4beta1.Page", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p4beta1.Page.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="width", - full_name="google.cloud.vision.v1p4beta1.Page.width", - index=1, - number=2, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="height", - full_name="google.cloud.vision.v1p4beta1.Page.height", - index=2, - number=3, - type=5, - cpp_type=1, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="blocks", - full_name="google.cloud.vision.v1p4beta1.Page.blocks", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.Page.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=740, - serialized_end=929, -) - - -_BLOCK = _descriptor.Descriptor( - name="Block", - full_name="google.cloud.vision.v1p4beta1.Block", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p4beta1.Block.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p4beta1.Block.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="paragraphs", - full_name="google.cloud.vision.v1p4beta1.Block.paragraphs", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="block_type", - full_name="google.cloud.vision.v1p4beta1.Block.block_type", - index=3, - number=4, - type=14, - cpp_type=8, - label=1, - has_default_value=False, - default_value=0, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.Block.confidence", - index=4, - number=5, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[_BLOCK_BLOCKTYPE], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=932, - serialized_end=1318, -) - - -_PARAGRAPH = _descriptor.Descriptor( - name="Paragraph", - full_name="google.cloud.vision.v1p4beta1.Paragraph", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p4beta1.Paragraph.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p4beta1.Paragraph.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="words", - full_name="google.cloud.vision.v1p4beta1.Paragraph.words", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.Paragraph.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1321, - serialized_end=1549, -) - - -_WORD = _descriptor.Descriptor( - name="Word", - full_name="google.cloud.vision.v1p4beta1.Word", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p4beta1.Word.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p4beta1.Word.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="symbols", - full_name="google.cloud.vision.v1p4beta1.Word.symbols", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.Word.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1552, - serialized_end=1779, -) - - -_SYMBOL = _descriptor.Descriptor( - name="Symbol", - full_name="google.cloud.vision.v1p4beta1.Symbol", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="property", - full_name="google.cloud.vision.v1p4beta1.Symbol.property", - index=0, - number=1, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="bounding_box", - full_name="google.cloud.vision.v1p4beta1.Symbol.bounding_box", - index=1, - number=2, - type=11, - cpp_type=10, - label=1, - has_default_value=False, - default_value=None, - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="text", - full_name="google.cloud.vision.v1p4beta1.Symbol.text", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="confidence", - full_name="google.cloud.vision.v1p4beta1.Symbol.confidence", - index=3, - number=4, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=1782, - serialized_end=1969, -) - -_TEXTANNOTATION_DETECTEDLANGUAGE.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK.fields_by_name[ - "type" -].enum_type = _TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE -_TEXTANNOTATION_DETECTEDBREAK.containing_type = _TEXTANNOTATION -_TEXTANNOTATION_DETECTEDBREAK_BREAKTYPE.containing_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_languages" -].message_type = _TEXTANNOTATION_DETECTEDLANGUAGE -_TEXTANNOTATION_TEXTPROPERTY.fields_by_name[ - "detected_break" -].message_type = _TEXTANNOTATION_DETECTEDBREAK -_TEXTANNOTATION_TEXTPROPERTY.containing_type = _TEXTANNOTATION -_TEXTANNOTATION.fields_by_name["pages"].message_type = _PAGE -_PAGE.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PAGE.fields_by_name["blocks"].message_type = _BLOCK -_BLOCK.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_BLOCK.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_BLOCK.fields_by_name["paragraphs"].message_type = _PARAGRAPH -_BLOCK.fields_by_name["block_type"].enum_type = _BLOCK_BLOCKTYPE -_BLOCK_BLOCKTYPE.containing_type = _BLOCK -_PARAGRAPH.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_PARAGRAPH.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_PARAGRAPH.fields_by_name["words"].message_type = _WORD -_WORD.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_WORD.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -_WORD.fields_by_name["symbols"].message_type = _SYMBOL -_SYMBOL.fields_by_name["property"].message_type = _TEXTANNOTATION_TEXTPROPERTY -_SYMBOL.fields_by_name[ - "bounding_box" -].message_type = ( - google_dot_cloud_dot_vision__v1p4beta1_dot_proto_dot_geometry__pb2._BOUNDINGPOLY -) -DESCRIPTOR.message_types_by_name["TextAnnotation"] = _TEXTANNOTATION -DESCRIPTOR.message_types_by_name["Page"] = _PAGE -DESCRIPTOR.message_types_by_name["Block"] = _BLOCK -DESCRIPTOR.message_types_by_name["Paragraph"] = _PARAGRAPH -DESCRIPTOR.message_types_by_name["Word"] = _WORD -DESCRIPTOR.message_types_by_name["Symbol"] = _SYMBOL -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -TextAnnotation = _reflection.GeneratedProtocolMessageType( - "TextAnnotation", - (_message.Message,), - dict( - DetectedLanguage=_reflection.GeneratedProtocolMessageType( - "DetectedLanguage", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDLANGUAGE, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Detected language for a structural component. - - - Attributes: - language_code: - The BCP-47 language code, such as "en-US" or "sr-Latn". For - more information, see http://www.unicode.org/reports/tr35/#Uni - code\_locale\_identifier. - confidence: - Confidence of detected language. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedLanguage) - ), - ), - DetectedBreak=_reflection.GeneratedProtocolMessageType( - "DetectedBreak", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_DETECTEDBREAK, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Detected start or end of a structural component. - - - Attributes: - type: - Detected break type. - is_prefix: - True if break prepends the element. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.DetectedBreak) - ), - ), - TextProperty=_reflection.GeneratedProtocolMessageType( - "TextProperty", - (_message.Message,), - dict( - DESCRIPTOR=_TEXTANNOTATION_TEXTPROPERTY, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Additional information detected on the structural - component. - - - Attributes: - detected_languages: - A list of detected languages together with confidence. - detected_break: - Detected start or end of a text segment. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty) - ), - ), - DESCRIPTOR=_TEXTANNOTATION, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""TextAnnotation contains a structured representation of OCR - extracted text. The hierarchy of an OCR extracted text structure is like - this: TextAnnotation -> Page -> Block -> Paragraph -> Word -> Symbol - Each structural component, starting from Page, may further have their - own properties. Properties describe detected languages, breaks etc.. - Please refer to the - [TextAnnotation.TextProperty][google.cloud.vision.v1p4beta1.TextAnnotation.TextProperty] - message definition below for more detail. - - - Attributes: - pages: - List of pages detected by OCR. - text: - UTF-8 text detected on the pages. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.TextAnnotation) - ), -) -_sym_db.RegisterMessage(TextAnnotation) -_sym_db.RegisterMessage(TextAnnotation.DetectedLanguage) -_sym_db.RegisterMessage(TextAnnotation.DetectedBreak) -_sym_db.RegisterMessage(TextAnnotation.TextProperty) - -Page = _reflection.GeneratedProtocolMessageType( - "Page", - (_message.Message,), - dict( - DESCRIPTOR=_PAGE, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Detected page from OCR. - - - Attributes: - property: - Additional information detected on the page. - width: - Page width. For PDFs the unit is points. For images (including - TIFFs) the unit is pixels. - height: - Page height. For PDFs the unit is points. For images - (including TIFFs) the unit is pixels. - blocks: - List of blocks of text, images etc on this page. - confidence: - Confidence of the OCR results on the page. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Page) - ), -) -_sym_db.RegisterMessage(Page) - -Block = _reflection.GeneratedProtocolMessageType( - "Block", - (_message.Message,), - dict( - DESCRIPTOR=_BLOCK, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Logical element on the page. - - - Attributes: - property: - Additional information detected for the block. - bounding_box: - The bounding box for the block. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: - - when the text is horizontal it might look like: :: - 0----1 | | 3----2 - when it's rotated 180 - degrees around the top-left corner it becomes: :: - 2----3 | | 1----0 and the vertex order will - still be (0, 1, 2, 3). - paragraphs: - List of paragraphs in this block (if this blocks is of type - text). - block_type: - Detected block type (text, image etc) for this block. - confidence: - Confidence of the OCR results on the block. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Block) - ), -) -_sym_db.RegisterMessage(Block) - -Paragraph = _reflection.GeneratedProtocolMessageType( - "Paragraph", - (_message.Message,), - dict( - DESCRIPTOR=_PARAGRAPH, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""Structural unit of text representing a number of words in - certain order. - - - Attributes: - property: - Additional information detected for the paragraph. - bounding_box: - The bounding box for the paragraph. The vertices are in the - order of top-left, top-right, bottom-right, bottom-left. When - a rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - words: - List of all words in this paragraph. - confidence: - Confidence of the OCR results for the paragraph. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Paragraph) - ), -) -_sym_db.RegisterMessage(Paragraph) - -Word = _reflection.GeneratedProtocolMessageType( - "Word", - (_message.Message,), - dict( - DESCRIPTOR=_WORD, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""A word representation. - - - Attributes: - property: - Additional information detected for the word. - bounding_box: - The bounding box for the word. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - symbols: - List of symbols in the word. The order of the symbols follows - the natural reading order. - confidence: - Confidence of the OCR results for the word. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Word) - ), -) -_sym_db.RegisterMessage(Word) - -Symbol = _reflection.GeneratedProtocolMessageType( - "Symbol", - (_message.Message,), - dict( - DESCRIPTOR=_SYMBOL, - __module__="google.cloud.vision_v1p4beta1.proto.text_annotation_pb2", - __doc__="""A single symbol representation. - - - Attributes: - property: - Additional information detected for the symbol. - bounding_box: - The bounding box for the symbol. The vertices are in the order - of top-left, top-right, bottom-right, bottom-left. When a - rotation of the bounding box is detected the rotation is - represented as around the top-left corner as defined when the - text is read in the 'natural' orientation. For example: \* - when the text is horizontal it might look like: 0----1 \| \| 3 - ----2 \* when it's rotated 180 degrees around the top-left - corner it becomes: 2----3 \| \| 1----0 and the vertex order - will still be (0, 1, 2, 3). - text: - The actual UTF-8 representation of the symbol. - confidence: - Confidence of the OCR results for the symbol. Range [0, 1]. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.Symbol) - ), -) -_sym_db.RegisterMessage(Symbol) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p4beta1/proto/web_detection.proto b/vision/google/cloud/vision_v1p4beta1/proto/web_detection.proto deleted file mode 100644 index 446a937f1c8e..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/web_detection.proto +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2019 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 -// -// http://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. -// - -syntax = "proto3"; - -package google.cloud.vision.v1p4beta1; - -import "google/api/annotations.proto"; - -option cc_enable_arenas = true; -option go_package = "google.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision"; -option java_multiple_files = true; -option java_outer_classname = "WebDetectionProto"; -option java_package = "com.google.cloud.vision.v1p4beta1"; -option objc_class_prefix = "GCVN"; - -// Relevant information for the image from the Internet. -message WebDetection { - // Entity deduced from similar images on the Internet. - message WebEntity { - // Opaque entity ID. - string entity_id = 1; - - // Overall relevancy score for the entity. - // Not normalized and not comparable across different image queries. - float score = 2; - - // Canonical description of the entity, in English. - string description = 3; - } - - // Metadata for online images. - message WebImage { - // The result image URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the image. - float score = 2; - } - - // Metadata for web pages. - message WebPage { - // The result web page URL. - string url = 1; - - // (Deprecated) Overall relevancy score for the web page. - float score = 2; - - // Title for the web page, may contain HTML markups. - string page_title = 3; - - // Fully matching images on the page. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 4; - - // Partial matching images on the page. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its - // crops. - repeated WebImage partial_matching_images = 5; - } - - // Label to provide extra metadata for the web detection. - message WebLabel { - // Label for extra metadata. - string label = 1; - - // The BCP-47 language code for `label`, such as "en-US" or "sr-Latn". - // For more information, see - // http://www.unicode.org/reports/tr35/#Unicode_locale_identifier. - string language_code = 2; - } - - // Deduced entities from similar images on the Internet. - repeated WebEntity web_entities = 1; - - // Fully matching images from the Internet. - // Can include resized copies of the query image. - repeated WebImage full_matching_images = 2; - - // Partial matching images from the Internet. - // Those images are similar enough to share some key-point features. For - // example an original image will likely have partial matching for its crops. - repeated WebImage partial_matching_images = 3; - - // Web pages containing the matching images from the Internet. - repeated WebPage pages_with_matching_images = 4; - - // The visually similar image results. - repeated WebImage visually_similar_images = 6; - - // The service's best guess as to the topic of the request image. - // Inferred from similar images on the open web. - repeated WebLabel best_guess_labels = 8; -} diff --git a/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py b/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py deleted file mode 100644 index b87762541a5a..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py +++ /dev/null @@ -1,617 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/vision_v1p4beta1/proto/web_detection.proto - -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) -from google.protobuf import descriptor as _descriptor -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database - -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from google.api import annotations_pb2 as google_dot_api_dot_annotations__pb2 - - -DESCRIPTOR = _descriptor.FileDescriptor( - name="google/cloud/vision_v1p4beta1/proto/web_detection.proto", - package="google.cloud.vision.v1p4beta1", - syntax="proto3", - serialized_options=_b( - "\n!com.google.cloud.vision.v1p4beta1B\021WebDetectionProtoP\001ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\370\001\001\242\002\004GCVN" - ), - serialized_pb=_b( - '\n7google/cloud/vision_v1p4beta1/proto/web_detection.proto\x12\x1dgoogle.cloud.vision.v1p4beta1\x1a\x1cgoogle/api/annotations.proto"\x8c\x07\n\x0cWebDetection\x12K\n\x0cweb_entities\x18\x01 \x03(\x0b\x32\x35.google.cloud.vision.v1p4beta1.WebDetection.WebEntity\x12R\n\x14\x66ull_matching_images\x18\x02 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x03 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12W\n\x1apages_with_matching_images\x18\x04 \x03(\x0b\x32\x33.google.cloud.vision.v1p4beta1.WebDetection.WebPage\x12U\n\x17visually_similar_images\x18\x06 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12O\n\x11\x62\x65st_guess_labels\x18\x08 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebLabel\x1a\x42\n\tWebEntity\x12\x11\n\tentity_id\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x13\n\x0b\x64\x65scription\x18\x03 \x01(\t\x1a&\n\x08WebImage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x1a\xe4\x01\n\x07WebPage\x12\x0b\n\x03url\x18\x01 \x01(\t\x12\r\n\x05score\x18\x02 \x01(\x02\x12\x12\n\npage_title\x18\x03 \x01(\t\x12R\n\x14\x66ull_matching_images\x18\x04 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x12U\n\x17partial_matching_images\x18\x05 \x03(\x0b\x32\x34.google.cloud.vision.v1p4beta1.WebDetection.WebImage\x1a\x30\n\x08WebLabel\x12\r\n\x05label\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\tB\x87\x01\n!com.google.cloud.vision.v1p4beta1B\x11WebDetectionProtoP\x01ZCgoogle.golang.org/genproto/googleapis/cloud/vision/v1p4beta1;vision\xf8\x01\x01\xa2\x02\x04GCVNb\x06proto3' - ), - dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR], -) - - -_WEBDETECTION_WEBENTITY = _descriptor.Descriptor( - name="WebEntity", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebEntity", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="entity_id", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebEntity.entity_id", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebEntity.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="description", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebEntity.description", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=642, - serialized_end=708, -) - -_WEBDETECTION_WEBIMAGE = _descriptor.Descriptor( - name="WebImage", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebImage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebImage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebImage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=710, - serialized_end=748, -) - -_WEBDETECTION_WEBPAGE = _descriptor.Descriptor( - name="WebPage", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="url", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage.url", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="score", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage.score", - index=1, - number=2, - type=2, - cpp_type=6, - label=1, - has_default_value=False, - default_value=float(0), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="page_title", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage.page_title", - index=2, - number=3, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage.full_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebPage.partial_matching_images", - index=4, - number=5, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=751, - serialized_end=979, -) - -_WEBDETECTION_WEBLABEL = _descriptor.Descriptor( - name="WebLabel", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebLabel", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="label", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebLabel.label", - index=0, - number=1, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="language_code", - full_name="google.cloud.vision.v1p4beta1.WebDetection.WebLabel.language_code", - index=1, - number=2, - type=9, - cpp_type=9, - label=1, - has_default_value=False, - default_value=_b("").decode("utf-8"), - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=981, - serialized_end=1029, -) - -_WEBDETECTION = _descriptor.Descriptor( - name="WebDetection", - full_name="google.cloud.vision.v1p4beta1.WebDetection", - filename=None, - file=DESCRIPTOR, - containing_type=None, - fields=[ - _descriptor.FieldDescriptor( - name="web_entities", - full_name="google.cloud.vision.v1p4beta1.WebDetection.web_entities", - index=0, - number=1, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="full_matching_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.full_matching_images", - index=1, - number=2, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="partial_matching_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.partial_matching_images", - index=2, - number=3, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="pages_with_matching_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.pages_with_matching_images", - index=3, - number=4, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="visually_similar_images", - full_name="google.cloud.vision.v1p4beta1.WebDetection.visually_similar_images", - index=4, - number=6, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - _descriptor.FieldDescriptor( - name="best_guess_labels", - full_name="google.cloud.vision.v1p4beta1.WebDetection.best_guess_labels", - index=5, - number=8, - type=11, - cpp_type=10, - label=3, - has_default_value=False, - default_value=[], - message_type=None, - enum_type=None, - containing_type=None, - is_extension=False, - extension_scope=None, - serialized_options=None, - file=DESCRIPTOR, - ), - ], - extensions=[], - nested_types=[ - _WEBDETECTION_WEBENTITY, - _WEBDETECTION_WEBIMAGE, - _WEBDETECTION_WEBPAGE, - _WEBDETECTION_WEBLABEL, - ], - enum_types=[], - serialized_options=None, - is_extendable=False, - syntax="proto3", - extension_ranges=[], - oneofs=[], - serialized_start=121, - serialized_end=1029, -) - -_WEBDETECTION_WEBENTITY.containing_type = _WEBDETECTION -_WEBDETECTION_WEBIMAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBPAGE.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION_WEBPAGE.containing_type = _WEBDETECTION -_WEBDETECTION_WEBLABEL.containing_type = _WEBDETECTION -_WEBDETECTION.fields_by_name["web_entities"].message_type = _WEBDETECTION_WEBENTITY -_WEBDETECTION.fields_by_name[ - "full_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "partial_matching_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name[ - "pages_with_matching_images" -].message_type = _WEBDETECTION_WEBPAGE -_WEBDETECTION.fields_by_name[ - "visually_similar_images" -].message_type = _WEBDETECTION_WEBIMAGE -_WEBDETECTION.fields_by_name["best_guess_labels"].message_type = _WEBDETECTION_WEBLABEL -DESCRIPTOR.message_types_by_name["WebDetection"] = _WEBDETECTION -_sym_db.RegisterFileDescriptor(DESCRIPTOR) - -WebDetection = _reflection.GeneratedProtocolMessageType( - "WebDetection", - (_message.Message,), - dict( - WebEntity=_reflection.GeneratedProtocolMessageType( - "WebEntity", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBENTITY, - __module__="google.cloud.vision_v1p4beta1.proto.web_detection_pb2", - __doc__="""Entity deduced from similar images on the Internet. - - - Attributes: - entity_id: - Opaque entity ID. - score: - Overall relevancy score for the entity. Not normalized and not - comparable across different image queries. - description: - Canonical description of the entity, in English. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebEntity) - ), - ), - WebImage=_reflection.GeneratedProtocolMessageType( - "WebImage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBIMAGE, - __module__="google.cloud.vision_v1p4beta1.proto.web_detection_pb2", - __doc__="""Metadata for online images. - - - Attributes: - url: - The result image URL. - score: - (Deprecated) Overall relevancy score for the image. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebImage) - ), - ), - WebPage=_reflection.GeneratedProtocolMessageType( - "WebPage", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBPAGE, - __module__="google.cloud.vision_v1p4beta1.proto.web_detection_pb2", - __doc__="""Metadata for web pages. - - - Attributes: - url: - The result web page URL. - score: - (Deprecated) Overall relevancy score for the web page. - page_title: - Title for the web page, may contain HTML markups. - full_matching_images: - Fully matching images on the page. Can include resized copies - of the query image. - partial_matching_images: - Partial matching images on the page. Those images are similar - enough to share some key-point features. For example an - original image will likely have partial matching for its - crops. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebPage) - ), - ), - WebLabel=_reflection.GeneratedProtocolMessageType( - "WebLabel", - (_message.Message,), - dict( - DESCRIPTOR=_WEBDETECTION_WEBLABEL, - __module__="google.cloud.vision_v1p4beta1.proto.web_detection_pb2", - __doc__="""Label to provide extra metadata for the web detection. - - - Attributes: - label: - Label for extra metadata. - language_code: - The BCP-47 language code for ``label``, such as "en-US" or - "sr-Latn". For more information, see http://www.unicode.org/re - ports/tr35/#Unicode\_locale\_identifier. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection.WebLabel) - ), - ), - DESCRIPTOR=_WEBDETECTION, - __module__="google.cloud.vision_v1p4beta1.proto.web_detection_pb2", - __doc__="""Relevant information for the image from the Internet. - - - Attributes: - web_entities: - Deduced entities from similar images on the Internet. - full_matching_images: - Fully matching images from the Internet. Can include resized - copies of the query image. - partial_matching_images: - Partial matching images from the Internet. Those images are - similar enough to share some key-point features. For example - an original image will likely have partial matching for its - crops. - pages_with_matching_images: - Web pages containing the matching images from the Internet. - visually_similar_images: - The visually similar image results. - best_guess_labels: - The service's best guess as to the topic of the request image. - Inferred from similar images on the open web. - """, - # @@protoc_insertion_point(class_scope:google.cloud.vision.v1p4beta1.WebDetection) - ), -) -_sym_db.RegisterMessage(WebDetection) -_sym_db.RegisterMessage(WebDetection.WebEntity) -_sym_db.RegisterMessage(WebDetection.WebImage) -_sym_db.RegisterMessage(WebDetection.WebPage) -_sym_db.RegisterMessage(WebDetection.WebLabel) - - -DESCRIPTOR._options = None -# @@protoc_insertion_point(module_scope) diff --git a/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py b/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py deleted file mode 100644 index 07cb78fe03a9..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py +++ /dev/null @@ -1,2 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -import grpc diff --git a/vision/google/cloud/vision_v1p4beta1/types.py b/vision/google/cloud/vision_v1p4beta1/types.py deleted file mode 100644 index 25a10a3dc199..000000000000 --- a/vision/google/cloud/vision_v1p4beta1/types.py +++ /dev/null @@ -1,76 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - - -from __future__ import absolute_import -import sys - -from google.api_core.protobuf_helpers import get_messages - -from google.cloud.vision_v1p4beta1.proto import face_pb2 -from google.cloud.vision_v1p4beta1.proto import geometry_pb2 -from google.cloud.vision_v1p4beta1.proto import image_annotator_pb2 -from google.cloud.vision_v1p4beta1.proto import product_search_pb2 -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2 -from google.cloud.vision_v1p4beta1.proto import text_annotation_pb2 -from google.cloud.vision_v1p4beta1.proto import web_detection_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import any_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 -from google.protobuf import timestamp_pb2 -from google.protobuf import wrappers_pb2 -from google.rpc import status_pb2 -from google.type import color_pb2 -from google.type import latlng_pb2 - - -_shared_modules = [ - operations_pb2, - any_pb2, - empty_pb2, - field_mask_pb2, - timestamp_pb2, - wrappers_pb2, - status_pb2, - color_pb2, - latlng_pb2, -] - -_local_modules = [ - face_pb2, - geometry_pb2, - image_annotator_pb2, - product_search_pb2, - product_search_service_pb2, - text_annotation_pb2, - web_detection_pb2, -] - -names = [] - -for module in _shared_modules: # pragma: NO COVER - for name, message in get_messages(module).items(): - setattr(sys.modules[__name__], name, message) - names.append(name) -for module in _local_modules: - for name, message in get_messages(module).items(): - message.__module__ = "google.cloud.vision_v1p4beta1.types" - setattr(sys.modules[__name__], name, message) - names.append(name) - - -__all__ = tuple(sorted(names)) diff --git a/vision/noxfile.py b/vision/noxfile.py deleted file mode 100644 index f17c1dbe4973..000000000000 --- a/vision/noxfile.py +++ /dev/null @@ -1,161 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2018 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. - -# Generated by synthtool. DO NOT EDIT! - -from __future__ import absolute_import -import os -import shutil - -import nox - - -LOCAL_DEPS = (os.path.join("..", "api_core"), os.path.join("..", "core")) -BLACK_VERSION = "black==19.3b0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] - -if os.path.exists("samples"): - BLACK_PATHS.append("samples") - - -@nox.session(python="3.7") -def lint(session): - """Run linters. - - Returns a failure if the linters find linting errors or sufficiently - serious code quality issues. - """ - session.install("flake8", BLACK_VERSION, *LOCAL_DEPS) - session.run("black", "--check", *BLACK_PATHS) - session.run("flake8", "google", "tests") - - -@nox.session(python="3.6") -def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ - session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) - - -@nox.session(python="3.7") -def lint_setup_py(session): - """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "pygments") - session.run("python", "setup.py", "check", "--restructuredtext", "--strict") - - -def default(session): - # Install all test dependencies, then install this package in-place. - session.install("mock", "pytest", "pytest-cov") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", ".") - - # Run py.test against the unit tests. - session.run( - "py.test", - "--quiet", - "--cov=google.cloud", - "--cov=tests.unit", - "--cov-append", - "--cov-config=.coveragerc", - "--cov-report=", - "--cov-fail-under=0", - os.path.join("tests", "unit"), - *session.posargs, - ) - - -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) -def unit(session): - """Run the unit test suite.""" - default(session) - - -@nox.session(python=["2.7", "3.7"]) -def system(session): - """Run the system test suite.""" - system_test_path = os.path.join("tests", "system.py") - system_test_folder_path = os.path.join("tests", "system") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") - - system_test_exists = os.path.exists(system_test_path) - system_test_folder_exists = os.path.exists(system_test_folder_path) - # Sanity check: only run tests if found. - if not system_test_exists and not system_test_folder_exists: - session.skip("System tests were not found") - - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest") - for local_dep in LOCAL_DEPS: - session.install("-e", local_dep) - session.install("-e", "../test_utils/") - session.install("-e", "../storage") - session.install("-e", ".") - - # Run py.test against the system tests. - if system_test_exists: - session.run("py.test", "--quiet", system_test_path, *session.posargs) - if system_test_folder_exists: - session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) - - -@nox.session(python="3.7") -def cover(session): - """Run the final coverage report. - - This outputs the coverage report aggregating coverage from the unit - test runs (not system test runs), and then erases coverage data. - """ - session.install("coverage", "pytest-cov") - session.run("coverage", "report", "--show-missing", "--fail-under=100") - - session.run("coverage", "erase") - - -@nox.session(python="3.7") -def docs(session): - """Build the docs for this library.""" - - session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") - - shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) - session.run( - "sphinx-build", - "-W", # warnings as errors - "-T", # show full traceback on exception - "-N", # no colors - "-b", - "html", - "-d", - os.path.join("docs", "_build", "doctrees", ""), - os.path.join("docs", ""), - os.path.join("docs", "_build", "html", ""), - ) diff --git a/vision/pylint.config.py b/vision/pylint.config.py deleted file mode 100644 index 5d64b9d2f256..000000000000 --- a/vision/pylint.config.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright 2017 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 -# -# http://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. - -"""This module is used to configure gcp-devrel-py-tools run-pylint.""" - -# Library configuration - -# library_additions = {} -# library_replacements = {} - -# Test configuration - -# test_additions = copy.deepcopy(library_additions) -# test_replacements = copy.deepcopy(library_replacements) diff --git a/vision/setup.cfg b/vision/setup.cfg deleted file mode 100644 index 3bd555500e37..000000000000 --- a/vision/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -# Generated by synthtool. DO NOT EDIT! -[bdist_wheel] -universal = 1 diff --git a/vision/setup.py b/vision/setup.py deleted file mode 100644 index e44348662b4f..000000000000 --- a/vision/setup.py +++ /dev/null @@ -1,73 +0,0 @@ -# Copyright 2018 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. - -import io -import os - -import setuptools - -name = "google-cloud-vision" -description = "Cloud Vision API API client library" -version = "0.41.0" -release_status = "Development Status :: 4 - Beta" -dependencies = [ - "google-api-core[grpc] >= 1.14.0, < 2.0.0dev", - 'enum34; python_version < "3.4"', -] - -package_root = os.path.abspath(os.path.dirname(__file__)) - -readme_filename = os.path.join(package_root, "README.rst") -with io.open(readme_filename, encoding="utf-8") as readme_file: - readme = readme_file.read() - -packages = [ - package for package in setuptools.find_packages() if package.startswith("google") -] - -namespaces = ["google"] -if "google.cloud" in packages: - namespaces.append("google.cloud") - -setuptools.setup( - name=name, - version=version, - description=description, - long_description=readme, - author="Google LLC", - author_email="googleapis-packages@google.com", - license="Apache 2.0", - url="https://github.com/GoogleCloudPlatform/google-cloud-python", - classifiers=[ - release_status, - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Operating System :: OS Independent", - "Topic :: Internet", - ], - platforms="Posix; MacOS X; Windows", - packages=packages, - namespace_packages=namespaces, - install_requires=dependencies, - python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*", - include_package_data=True, - zip_safe=False, -) diff --git a/vision/synth.metadata b/vision/synth.metadata deleted file mode 100644 index f63ef43c7e9d..000000000000 --- a/vision/synth.metadata +++ /dev/null @@ -1,643 +0,0 @@ -{ - "updateTime": "2020-01-30T13:45:40.038358Z", - "sources": [ - { - "generator": { - "name": "artman", - "version": "0.44.4", - "dockerImage": "googleapis/artman@sha256:19e945954fc960a4bdfee6cb34695898ab21a8cf0bac063ee39b91f00a1faec8" - } - }, - { - "git": { - "name": "googleapis", - "remote": "https://github.com/googleapis/googleapis.git", - "sha": "c1246a29e22b0f98e800a536b5b0da2d933a55f2", - "internalRef": "292310790", - "log": "c1246a29e22b0f98e800a536b5b0da2d933a55f2\nUpdating v1 protos with the latest inline documentation (in comments) and config options. Also adding a per-service .yaml file.\n\nPiperOrigin-RevId: 292310790\n\nb491d07cadaae7cde5608321f913e5ca1459b32d\nRevert accidental local_repository change\n\nPiperOrigin-RevId: 292245373\n\naf3400a8cb6110025198b59a0f7d018ae3cda700\nUpdate gapic-generator dependency (prebuilt PHP binary support).\n\nPiperOrigin-RevId: 292243997\n\n341fd5690fae36f36cf626ef048fbcf4bbe7cee6\ngrafeas: v1 add resource_definition for the grafeas.io/Project and change references for Project.\n\nPiperOrigin-RevId: 292221998\n\n42e915ec2ece1cd37a590fbcd10aa2c0fb0e5b06\nUpdate the gapic-generator, protoc-java-resource-name-plugin and protoc-docs-plugin to the latest commit.\n\nPiperOrigin-RevId: 292182368\n\nf035f47250675d31492a09f4a7586cfa395520a7\nFix grafeas build and update build.sh script to include gerafeas.\n\nPiperOrigin-RevId: 292168753\n\n26ccb214b7bc4a716032a6266bcb0a9ca55d6dbb\nasset: v1p1beta1 add client config annotations and retry config\n\nPiperOrigin-RevId: 292154210\n\n974ee5c0b5d03e81a50dafcedf41e0efebb5b749\nasset: v1beta1 add client config annotations\n\nPiperOrigin-RevId: 292152573\n\n" - } - }, - { - "template": { - "name": "python_library", - "origin": "synthtool.gcp", - "version": "2019.10.17" - } - } - ], - "destinations": [ - { - "client": { - "source": "googleapis", - "apiName": "vision", - "apiVersion": "v1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/vision/artman_vision_v1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "vision", - "apiVersion": "v1p1beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/vision/artman_vision_v1p1beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "vision", - "apiVersion": "v1p2beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/vision/artman_vision_v1p2beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "vision", - "apiVersion": "v1p3beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/vision/artman_vision_v1p3beta1.yaml" - } - }, - { - "client": { - "source": "googleapis", - "apiName": "vision", - "apiVersion": "v1p4beta1", - "language": "python", - "generator": "gapic", - "config": "google/cloud/vision/artman_vision_v1p4beta1.yaml" - } - } - ], - "newFiles": [ - { - "path": ".coveragerc" - }, - { - "path": ".flake8" - }, - { - "path": ".repo-metadata.json" - }, - { - "path": "CHANGELOG.md" - }, - { - "path": "LICENSE" - }, - { - "path": "MANIFEST.in" - }, - { - "path": "README.rst" - }, - { - "path": "docs/README.rst" - }, - { - "path": "docs/_static/custom.css" - }, - { - "path": "docs/_templates/layout.html" - }, - { - "path": "docs/changelog.md" - }, - { - "path": "docs/conf.py" - }, - { - "path": "docs/gapic/v1/api.rst" - }, - { - "path": "docs/gapic/v1/types.rst" - }, - { - "path": "docs/gapic/v1p2beta1/api.rst" - }, - { - "path": "docs/gapic/v1p2beta1/types.rst" - }, - { - "path": "docs/gapic/v1p3beta1/api.rst" - }, - { - "path": "docs/gapic/v1p3beta1/types.rst" - }, - { - "path": "docs/gapic/v1p4beta1/api.rst" - }, - { - "path": "docs/gapic/v1p4beta1/types.rst" - }, - { - "path": "docs/index.rst" - }, - { - "path": "google/__init__.py" - }, - { - "path": "google/cloud/__init__.py" - }, - { - "path": "google/cloud/vision.py" - }, - { - "path": "google/cloud/vision_helpers/__init__.py" - }, - { - "path": "google/cloud/vision_helpers/decorators.py" - }, - { - "path": "google/cloud/vision_v1/__init__.py" - }, - { - "path": "google/cloud/vision_v1/gapic/__init__.py" - }, - { - "path": "google/cloud/vision_v1/gapic/enums.py" - }, - { - "path": "google/cloud/vision_v1/gapic/image_annotator_client.py" - }, - { - "path": "google/cloud/vision_v1/gapic/image_annotator_client_config.py" - }, - { - "path": "google/cloud/vision_v1/gapic/product_search_client.py" - }, - { - "path": "google/cloud/vision_v1/gapic/product_search_client_config.py" - }, - { - "path": "google/cloud/vision_v1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/vision_v1/gapic/transports/image_annotator_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1/gapic/transports/product_search_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1/proto/__init__.py" - }, - { - "path": "google/cloud/vision_v1/proto/geometry.proto" - }, - { - "path": "google/cloud/vision_v1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/proto/image_annotator.proto" - }, - { - "path": "google/cloud/vision_v1/proto/image_annotator_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/image_annotator_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/proto/product_search.proto" - }, - { - "path": "google/cloud/vision_v1/proto/product_search_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/product_search_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/proto/product_search_service.proto" - }, - { - "path": "google/cloud/vision_v1/proto/product_search_service_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/product_search_service_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/proto/text_annotation.proto" - }, - { - "path": "google/cloud/vision_v1/proto/text_annotation_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/text_annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/proto/web_detection.proto" - }, - { - "path": "google/cloud/vision_v1/proto/web_detection_pb2.py" - }, - { - "path": "google/cloud/vision_v1/proto/web_detection_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1/types.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/__init__.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/enums.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/image_annotator_client.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/image_annotator_client_config.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/gapic/transports/image_annotator_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/__init__.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/image_annotator.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/image_annotator_pb2.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/image_annotator_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/product_search.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/product_search_service.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/text_annotation.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/text_annotation_pb2.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/text_annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/web_detection.proto" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/web_detection_pb2.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/proto/web_detection_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p1beta1/types.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/__init__.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/enums.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/image_annotator_client.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/image_annotator_client_config.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/gapic/transports/image_annotator_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/__init__.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/image_annotator.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/image_annotator_pb2.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/image_annotator_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/product_search.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/product_search_service.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/text_annotation.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/text_annotation_pb2.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/text_annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/web_detection.proto" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/web_detection_pb2.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/proto/web_detection_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p2beta1/types.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/__init__.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/enums.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/image_annotator_client.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/image_annotator_client_config.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/product_search_client.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/product_search_client_config.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/transports/image_annotator_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/gapic/transports/product_search_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/__init__.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/image_annotator.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/image_annotator_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/image_annotator_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search_service.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search_service_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/product_search_service_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/text_annotation.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/text_annotation_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/text_annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/web_detection.proto" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/web_detection_pb2.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/proto/web_detection_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p3beta1/types.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/__init__.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/__init__.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/enums.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/image_annotator_client.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/image_annotator_client_config.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/product_search_client.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/product_search_client_config.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/transports/__init__.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/transports/image_annotator_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/gapic/transports/product_search_grpc_transport.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/__init__.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/face.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/face_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/face_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/geometry.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/geometry_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/geometry_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/image_annotator.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/image_annotator_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/image_annotator_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search_service.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search_service_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/product_search_service_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/text_annotation.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/text_annotation_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/text_annotation_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/web_detection.proto" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/web_detection_pb2.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/proto/web_detection_pb2_grpc.py" - }, - { - "path": "google/cloud/vision_v1p4beta1/types.py" - }, - { - "path": "noxfile.py" - }, - { - "path": "pylint.config.py" - }, - { - "path": "setup.cfg" - }, - { - "path": "setup.py" - }, - { - "path": "synth.metadata" - }, - { - "path": "synth.py" - }, - { - "path": "tests/__init__.py" - }, - { - "path": "tests/data/faces.jpg" - }, - { - "path": "tests/data/logo.png" - }, - { - "path": "tests/data/pdf_test.pdf" - }, - { - "path": "tests/system.py" - }, - { - "path": "tests/unit/__init__.py" - }, - { - "path": "tests/unit/gapic/v1/test_image_annotator_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1/test_product_search_client_v1.py" - }, - { - "path": "tests/unit/gapic/v1p1beta1/test_image_annotator_client_v1p1beta1.py" - }, - { - "path": "tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py" - }, - { - "path": "tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py" - }, - { - "path": "tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py" - }, - { - "path": "tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py" - }, - { - "path": "tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py" - }, - { - "path": "tests/unit/test_decorators.py" - }, - { - "path": "tests/unit/test_helpers.py" - } - ] -} \ No newline at end of file diff --git a/vision/synth.py b/vision/synth.py deleted file mode 100644 index 1872b7a850bc..000000000000 --- a/vision/synth.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright 2018 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 -# -# http://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. - -"""This script is used to synthesize generated parts of this library.""" - -import synthtool as s -from synthtool import gcp - -gapic = gcp.GAPICGenerator() -common = gcp.CommonTemplates() -versions = ["v1", "v1p1beta1", "v1p2beta1", "v1p3beta1", "v1p4beta1"] - - -# ---------------------------------------------------------------------------- -# Generate vision GAPIC layer -# ---------------------------------------------------------------------------- -for version in versions: - library = gapic.py_library("vision", version, include_protos=True) - - s.move(library / f"google/cloud/vision_{version}/gapic") - s.move(library / f"google/cloud/vision_{version}/__init__.py") - s.move(library / f"google/cloud/vision_{version}/types.py") - s.move(library / f"google/cloud/vision_{version}/proto") - s.move(library / f"tests/unit/gapic/{version}") - # don't publish docs for these versions - if version not in ["v1p1beta1"]: - s.move(library / f"docs/gapic/{version}") - - # Add vision helpers to each version - s.replace( - f"google/cloud/vision_{version}/__init__.py", - f"from __future__ import absolute_import", - f"\g<0>\n\n" - f"from google.cloud.vision_helpers.decorators import " - f"add_single_feature_methods\n" - f"from google.cloud.vision_helpers import VisionHelpers", - ) - - s.replace( - f"google/cloud/vision_{version}/__init__.py", f"image_annotator_client", f"iac" - ) - - s.replace( - f"google/cloud/vision_{version}/__init__.py", - f"from google.cloud.vision_{version}.gapic import iac", - f"from google.cloud.vision_{version}.gapic import " - f"image_annotator_client as iac", - ) - - s.replace( - f"google/cloud/vision_{version}/__init__.py", - f"class ImageAnnotatorClient\(iac.ImageAnnotatorClient\):", - f"@add_single_feature_methods\n" - f"class ImageAnnotatorClient(VisionHelpers, iac.ImageAnnotatorClient):", - ) - -# Move docs configuration -s.move(library / f"docs/conf.py") - -# Fix import of operations -targets = ["google/cloud/vision_*/**/*.py", "tests/system/gapic/*/**/*.py"] -s.replace( - targets, - "import google.api_core.operations_v1", - "from google.api_core import operations_v1", -) - -# ---------------------------------------------------------------------------- -# Add templated files -# ---------------------------------------------------------------------------- -templated_files = common.py_library( - unit_cov_level=97, cov_level=100, system_test_dependencies=["../storage"] -) -s.move(templated_files) - -s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/vision/tests/__init__.py b/vision/tests/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/tests/data/faces.jpg b/vision/tests/data/faces.jpg deleted file mode 100644 index af26c6e3f334..000000000000 Binary files a/vision/tests/data/faces.jpg and /dev/null differ diff --git a/vision/tests/data/logo.png b/vision/tests/data/logo.png deleted file mode 100644 index 5538eaed2bdf..000000000000 Binary files a/vision/tests/data/logo.png and /dev/null differ diff --git a/vision/tests/data/pdf_test.pdf b/vision/tests/data/pdf_test.pdf deleted file mode 100644 index bca60f549b9b..000000000000 Binary files a/vision/tests/data/pdf_test.pdf and /dev/null differ diff --git a/vision/tests/system.py b/vision/tests/system.py deleted file mode 100644 index 839c269aee37..000000000000 --- a/vision/tests/system.py +++ /dev/null @@ -1,926 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -"""System tests for Vision API.""" - -import grpc -import io -import json -import os -import time -import unittest - -import pytest - -from google.api_core import exceptions -from google.cloud import storage -from google.cloud import vision - -from test_utils.retry import RetryErrors -from test_utils.system import unique_resource_id -from test_utils.vpcsc_config import vpcsc_config - - -_SYS_TESTS_DIR = os.path.realpath(os.path.dirname(__file__)) -FACE_FILE = os.path.join(_SYS_TESTS_DIR, "data", "faces.jpg") -LOGO_FILE = os.path.join(_SYS_TESTS_DIR, "data", "logo.png") -PDF_FILE = os.path.join(_SYS_TESTS_DIR, "data", "pdf_test.pdf") -PROJECT_ID = os.environ.get("PROJECT_ID") -_VPCSC_PROHIBITED_MESSAGE = "Request is prohibited by organization's policy" - - -class VisionSystemTestBase(unittest.TestCase): - client = None - test_bucket = None - - def setUp(self): - self.to_delete_by_case = [] - - def tearDown(self): - for value in self.to_delete_by_case: - value.delete() - - -def setUpModule(): - VisionSystemTestBase.client = vision.ImageAnnotatorClient() - VisionSystemTestBase.ps_client = vision.ProductSearchClient() - storage_client = storage.Client() - bucket_name = "new" + unique_resource_id() - VisionSystemTestBase.test_bucket = storage_client.bucket(bucket_name) - - # 429 Too Many Requests in case API requests rate-limited. - retry_429 = RetryErrors(exceptions.TooManyRequests) - retry_429(VisionSystemTestBase.test_bucket.create)() - - -def tearDownModule(): - # 409 Conflict if the bucket is full. - # 429 Too Many Requests in case API requests rate-limited. - bucket_retry = RetryErrors((exceptions.TooManyRequests, exceptions.Conflict)) - bucket_retry(VisionSystemTestBase.test_bucket.delete)(force=True) - - -class TestVisionClientLogo(VisionSystemTestBase): - def test_detect_logos_content(self): - # Read the file. - with io.open(LOGO_FILE, "rb") as image_file: - content = image_file.read() - - # Make the request. - response = self.client.logo_detection({"content": content}) - - # Check to ensure we got what we expect. - assert len(response.logo_annotations) == 1 - assert response.logo_annotations[0].description.lower() == "google" - - def test_detect_logos_file_handler(self): - # Get a file handler, and make the request using it. - with io.open(LOGO_FILE, "rb") as image_file: - response = self.client.logo_detection(image_file) - - # Check to ensure we got what we expect. - assert len(response.logo_annotations) == 1 - assert response.logo_annotations[0].description.lower() == "google" - - def test_detect_logos_filename(self): - # Make the request with the filename directly. - response = self.client.logo_detection({"source": {"filename": LOGO_FILE}}) - - # Check to ensure we got what we expect. - assert len(response.logo_annotations) == 1 - assert response.logo_annotations[0].description.lower() == "google" - - def test_detect_logos_gcs(self): - # Upload the image to Google Cloud Storage. - blob_name = "logo.png" - blob = self.test_bucket.blob(blob_name) - self.to_delete_by_case.append(blob) - with io.open(LOGO_FILE, "rb") as image_file: - blob.upload_from_file(image_file) - - # Make the request. - response = self.client.logo_detection( - { - "source": { - "image_uri": "gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=blob_name - ) - } - } - ) - - # Check the response. - assert len(response.logo_annotations) == 1 - assert response.logo_annotations[0].description.lower() == "google" - - def test_detect_logos_async(self): - # Upload the image to Google Cloud Storage. - blob_name = "logo_async.png" - blob = self.test_bucket.blob(blob_name) - self.to_delete_by_case.append(blob) - with io.open(LOGO_FILE, "rb") as image_file: - blob.upload_from_file(image_file) - - # Make the request. - request = { - "image": { - "source": { - "image_uri": "gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=blob_name - ) - } - }, - "features": [{"type": vision.enums.Feature.Type.LOGO_DETECTION}], - } - method_name = "test_detect_logos_async" - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=self.test_bucket.name, method_name=method_name - ) - output_config = {"gcs_destination": {"uri": output_gcs_uri_prefix}} - response = self.client.async_batch_annotate_images([request], output_config) - - # Wait for the operation to complete. - lro_waiting_seconds = 90 - start_time = time.time() - while not response.done() and (time.time() - start_time) < lro_waiting_seconds: - time.sleep(1) - - if not response.done(): - self.fail( - "{method_name} timed out after {lro_waiting_seconds} seconds".format( - method_name=method_name, lro_waiting_seconds=lro_waiting_seconds - ) - ) - - # Make sure getting the result is not an error. - response.result() - - # There should be exactly 1 output file in gcs at the prefix output_gcs_uri_prefix. - blobs = list(self.test_bucket.list_blobs(prefix=method_name)) - assert len(blobs) == 1 - blob = blobs[0] - - # Download the output file and verify the result - result_str = blob.download_as_string().decode("utf8") - result = json.loads(result_str) - responses = result["responses"] - assert len(responses) == 1 - logo_annotations = responses[0]["logoAnnotations"] - assert len(logo_annotations) == 1 - assert logo_annotations[0]["description"].lower() == "google" - - -class TestVisionClientFiles(VisionSystemTestBase): - def test_async_batch_annotate_files(self): - # Upload the image to Google Cloud Storage. - blob_name = "async_batch_annotate_files.pdf" - blob = self.test_bucket.blob(blob_name) - self.to_delete_by_case.append(blob) - with io.open(PDF_FILE, "rb") as image_file: - blob.upload_from_file(image_file) - - # Make the request. - method_name = "test_async_batch_annotate_files" - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=self.test_bucket.name, method_name=method_name - ) - request = { - "input_config": { - "gcs_source": { - "uri": "gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=blob_name - ) - }, - "mime_type": "application/pdf", - }, - "features": [{"type": vision.enums.Feature.Type.DOCUMENT_TEXT_DETECTION}], - "output_config": {"gcs_destination": {"uri": output_gcs_uri_prefix}}, - } - response = self.client.async_batch_annotate_files([request]) - - # Wait for the operation to complete. - lro_waiting_seconds = 90 - start_time = time.time() - while not response.done() and (time.time() - start_time) < lro_waiting_seconds: - time.sleep(1) - - if not response.done(): - self.fail( - "{method_name} timed out after {lro_waiting_seconds} seconds".format( - method_name=method_name, lro_waiting_seconds=lro_waiting_seconds - ) - ) - - # Make sure getting the result is not an error. - response.result() - - # There should be exactly 1 output file in gcs at the prefix output_gcs_uri_prefix. - blobs = list(self.test_bucket.list_blobs(prefix=method_name)) - assert len(blobs) == 1 - blob = blobs[0] - - # Download the output file and verify the result - result_str = blob.download_as_string().decode("utf8") - result = json.loads(result_str) - responses = result["responses"] - assert len(responses) == 1 - text = responses[0]["fullTextAnnotation"]["text"] - expected_text = "test text" - self.assertTrue( - expected_text in text, - "'{expected_text}' not in '{text}'".format( - expected_text=expected_text, text=text - ), - ) - - -@unittest.skipUnless(PROJECT_ID, "PROJECT_ID not set in environment.") -class TestVisionClientProductSearch(VisionSystemTestBase): - def setUp(self): - VisionSystemTestBase.setUp(self) - self.reference_images_to_delete = [] - self.products_to_delete = [] - self.product_sets_to_delete = [] - self.location = "us-west1" - self.location_path = self.ps_client.location_path( - project=PROJECT_ID, location=self.location - ) - - def tearDown(self): - VisionSystemTestBase.tearDown(self) - for reference_image in self.reference_images_to_delete: - self.ps_client.delete_reference_image(name=reference_image) - for product in self.products_to_delete: - self.ps_client.delete_product(name=product) - for product_set in self.product_sets_to_delete: - self.ps_client.delete_product_set(name=product_set) - - def _upload_image(self, image_name): - blob = self.test_bucket.blob(image_name) - self.to_delete_by_case.append(blob) - with io.open(FACE_FILE, "rb") as image_file: - blob.upload_from_file(image_file) - return "gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=image_name - ) - - def test_create_product_set(self): - # Create a ProductSet. - product_set = vision.types.ProductSet(display_name="display name") - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - response = self.ps_client.create_product_set( - parent=self.location_path, - product_set=product_set, - product_set_id=product_set_id, - ) - self.product_sets_to_delete.append(response.name) - # Verify the ProductSet was successfully created. - self.assertEqual(response.name, product_set_path) - - def test_get_product_set(self): - # Create a ProductSet. - product_set = vision.types.ProductSet(display_name="display name") - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - response = self.ps_client.create_product_set( - parent=self.location_path, - product_set=product_set, - product_set_id=product_set_id, - ) - self.product_sets_to_delete.append(response.name) - self.assertEqual(response.name, product_set_path) - # Get the ProductSet. - get_response = self.ps_client.get_product_set(name=product_set_path) - self.assertEqual(get_response.name, product_set_path) - - def test_list_product_sets(self): - # Create a ProductSet. - product_set = vision.types.ProductSet(display_name="display name") - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - response = self.ps_client.create_product_set( - parent=self.location_path, - product_set=product_set, - product_set_id=product_set_id, - ) - self.product_sets_to_delete.append(response.name) - self.assertEqual(response.name, product_set_path) - # Verify ProductSets can be listed. - product_sets_iterator = self.ps_client.list_product_sets( - parent=self.location_path - ) - product_sets_exist = False - for product_set in product_sets_iterator: - product_sets_exist = True - break - self.assertTrue(product_sets_exist) - - def test_update_product_set(self): - # Create a ProductSet. - product_set = vision.types.ProductSet(display_name="display name") - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - response = self.ps_client.create_product_set( - parent=self.location_path, - product_set=product_set, - product_set_id=product_set_id, - ) - self.product_sets_to_delete.append(response.name) - self.assertEqual(response.name, product_set_path) - # Update the ProductSet. - new_display_name = "updated name" - updated_product_set_request = vision.types.ProductSet( - name=product_set_path, display_name=new_display_name - ) - update_mask = vision.types.FieldMask(paths=["display_name"]) - updated_product_set = self.ps_client.update_product_set( - product_set=updated_product_set_request, update_mask=update_mask - ) - self.assertEqual(updated_product_set.display_name, new_display_name) - - def test_create_product(self): - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - # Verify the Product was successfully created. - self.assertEqual(response.name, product_path) - - def test_get_product(self): - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - self.assertEqual(response.name, product_path) - # Get the Product. - get_response = self.ps_client.get_product(name=product_path) - self.assertEqual(get_response.name, product_path) - - def test_update_product(self): - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - self.assertEqual(response.name, product_path) - # Update the Product. - new_display_name = "updated product name" - updated_product_request = vision.types.Product( - name=product_path, display_name=new_display_name - ) - update_mask = vision.types.FieldMask(paths=["display_name"]) - updated_product = self.ps_client.update_product( - product=updated_product_request, update_mask=update_mask - ) - self.assertEqual(updated_product.display_name, new_display_name) - - def test_list_products(self): - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - self.assertEqual(response.name, product_path) - # Verify Products can be listed. - products_iterator = self.ps_client.list_products(parent=self.location_path) - products_exist = False - for product in products_iterator: - products_exist = True - break - self.assertTrue(products_exist) - - def test_list_products_in_product_set(self): - # Create a ProductSet. - product_set = vision.types.ProductSet(display_name="display name") - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - response = self.ps_client.create_product_set( - parent=self.location_path, - product_set=product_set, - product_set_id=product_set_id, - ) - self.product_sets_to_delete.append(response.name) - self.assertEqual(response.name, product_set_path) - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - self.assertEqual(response.name, product_path) - # Add the Product to the ProductSet. - self.ps_client.add_product_to_product_set( - name=product_set_path, product=product_path - ) - # List the Products in the ProductSet. - listed_products = list( - self.ps_client.list_products_in_product_set(name=product_set_path) - ) - self.assertEqual(len(listed_products), 1) - self.assertEqual(listed_products[0].name, product_path) - # Remove the Product from the ProductSet. - self.ps_client.remove_product_from_product_set( - name=product_set_path, product=product_path - ) - - def test_reference_image(self): - # Create a Product. - product = vision.types.Product( - display_name="product display name", product_category="apparel" - ) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - response = self.ps_client.create_product( - parent=self.location_path, product=product, product_id=product_id - ) - self.products_to_delete.append(response.name) - self.assertEqual(response.name, product_path) - - # Upload image to gcs. - gcs_uri = self._upload_image("reference_image_test.jpg") - - # Create a ReferenceImage. - reference_image_id = "reference_image" + unique_resource_id() - reference_image_path = self.ps_client.reference_image_path( - project=PROJECT_ID, - location=self.location, - product=product_id, - reference_image=reference_image_id, - ) - reference_image = vision.types.ReferenceImage(uri=gcs_uri) - response = self.ps_client.create_reference_image( - parent=product_path, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - self.reference_images_to_delete.append(response.name) - self.assertEqual(response.name, reference_image_path) - - # Get the ReferenceImage. - get_response = self.ps_client.get_reference_image(name=reference_image_path) - self.assertEqual(get_response.name, reference_image_path) - - # List the ReferenceImages in the Product. - listed_reference_images = list( - self.ps_client.list_reference_images(parent=product_path) - ) - self.assertEqual(len(listed_reference_images), 1) - self.assertEqual(listed_reference_images[0].name, reference_image_path) - - def _build_csv_line( - self, gcs_uri_image, reference_image_id, product_set_id, product_id - ): - return ",".join( - [ - gcs_uri_image, - reference_image_id, - product_set_id, - product_id, - "apparel", - "display name", - '"color=black,style=formal"', - "", - ] - ) - - def test_import_product_sets(self): - # Generate the ids that will be used in the import. - product_set_id = "set" + unique_resource_id() - product_set_path = self.ps_client.product_set_path( - project=PROJECT_ID, location=self.location, product_set=product_set_id - ) - self.product_sets_to_delete.append(product_set_path) - product_id = "product" + unique_resource_id() - product_path = self.ps_client.product_path( - project=PROJECT_ID, location=self.location, product=product_id - ) - self.products_to_delete.append(product_path) - reference_image_id_1 = "reference_image_1" + unique_resource_id() - reference_image_path = self.ps_client.reference_image_path( - project=PROJECT_ID, - location=self.location, - product=product_id, - reference_image=reference_image_id_1, - ) - self.reference_images_to_delete.append(reference_image_path) - reference_image_id_2 = "reference_image_2" + unique_resource_id() - reference_image_path = self.ps_client.reference_image_path( - project=PROJECT_ID, - location=self.location, - product=product_id, - reference_image=reference_image_id_2, - ) - self.reference_images_to_delete.append(reference_image_path) - - # Upload images to gcs. - gcs_uri_image_1 = self._upload_image("import_sets_image_1.jpg") - gcs_uri_image_2 = self._upload_image("import_sets_image_2.jpg") - - # Build the string that will be uploaded to gcs as a csv file. - csv_data = "\n".join( - [ - self._build_csv_line( - gcs_uri_image_1, reference_image_id_1, product_set_id, product_id - ), - self._build_csv_line( - gcs_uri_image_2, reference_image_id_2, product_set_id, product_id - ), - ] - ) - - # Upload a csv file to gcs. - csv_filename = "import_sets.csv" - blob = self.test_bucket.blob(csv_filename) - self.to_delete_by_case.append(blob) - blob.upload_from_string(csv_data) - - # Make the import_product_sets request. - gcs_source = vision.types.ImportProductSetsGcsSource( - csv_file_uri="gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=csv_filename - ) - ) - input_config = vision.types.ImportProductSetsInputConfig(gcs_source=gcs_source) - response = self.ps_client.import_product_sets( - parent=self.location_path, input_config=input_config - ) - - # Verify the result. - image_prefix = "import_sets_image_" - for ref_image in response.result().reference_images: - self.assertTrue( - image_prefix in ref_image.uri, - "'{image_prefix}' not in '{uri}'".format( - image_prefix=image_prefix, uri=ref_image.uri - ), - ) - for status in response.result().statuses: - self.assertEqual(status.code, grpc.StatusCode.OK.value[0]) - - -@vpcsc_config.skip_unless_outside_project -class TestVisionClientProductSearchVpcsc(VisionSystemTestBase): - # Tests to verify ProductSearch is blocked by VPC SC when trying to access a resource outside of a secure perimeter. - def setUp(self): - super(TestVisionClientProductSearchVpcsc, self).setUp() - uniq = unique_resource_id() - self.location = "us-west1" - self.location_path = self.ps_client.location_path( - project=vpcsc_config.project_outside, location=self.location - ) - self.product_set_id = product_set_id = "set" + uniq - self.product_set_path = self.ps_client.product_set_path( - project=vpcsc_config.project_outside, - location=self.location, - product_set=product_set_id, - ) - self.product_id = "product" + uniq - self.product_path = self.ps_client.product_path( - project=vpcsc_config.project_outside, - location=self.location, - product=self.product_id, - ) - self.reference_image_id = "reference_image" + uniq - self.reference_image_path = self.ps_client.reference_image_path( - project=vpcsc_config.project_outside, - location=self.location, - product=self.product_id, - reference_image=self.reference_image_id, - ) - - def test_create_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.create_product_set( - parent=self.location_path, - product_set={}, - product_set_id=self.product_set_id, - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_get_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.get_product_set(name=self.product_set_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_delete_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.delete_product_set(name=self.product_set_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_list_product_sets_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(self.ps_client.list_product_sets(parent=self.location_path)) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_update_product_set_blocked(self): - product_set = vision.types.ProductSet(name=self.product_set_path) - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.update_product_set(product_set=product_set) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_create_product_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.create_product( - parent=self.location_path, product={}, product_id=self.product_id - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_get_product_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.get_product(name=self.product_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_delete_product_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.delete_product(name=self.product_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_update_product_blocked(self): - product = vision.types.Product(name=self.product_path) - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.update_product(product=product) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_list_products_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(self.ps_client.list_products(parent=self.location_path)) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_list_products_in_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - list( - self.ps_client.list_products_in_product_set(name=self.product_set_path) - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_add_product_to_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.add_product_to_product_set( - name=self.product_set_path, product=self.product_path - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_remove_product_from_product_set_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.remove_product_from_product_set( - name=self.product_set_path, product=self.product_path - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_create_reference_image_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.create_reference_image( - parent=self.product_path, - reference_image={}, - reference_image_id=self.reference_image_id, - ) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_get_reference_image_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.get_reference_image(name=self.reference_image_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_delete_reference_image_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - self.ps_client.delete_reference_image(name=self.reference_image_path) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - def test_list_reference_images_blocked(self): - with pytest.raises(exceptions.PermissionDenied) as exc: - list(self.ps_client.list_reference_images(parent=self.product_path)) - - assert exc.value.message.startswith(_VPCSC_PROHIBITED_MESSAGE) - - -@vpcsc_config.skip_unless_inside_vpcsc -class TestVisionClientVpcsc(VisionSystemTestBase): - # Tests to verify Vision API methods are blocked by VPC SC when trying to access a gcs resource outside of a secure perimeter. - def setUp(self): - super(TestVisionClientVpcsc, self).setUp() - self.blocked_file = "LC08/01_$folder$" - self.gcs_uri_blocked_file = "gs://{bucket}/{file}".format( - bucket=vpcsc_config.bucket_outside, file=self.blocked_file - ) - self.gcs_read_error_message = "Error opening file: gs://" - self.gcs_write_error_message = "Error writing final output to" - self.location = "us-west1" - self.location_path = self.ps_client.location_path( - project=vpcsc_config.project_inside, location=self.location - ) - - def test_import_product_sets_blocked(self): - # The csv file is outside the secure perimeter. - gcs_source = vision.types.ImportProductSetsGcsSource( - csv_file_uri=self.gcs_uri_blocked_file - ) - input_config = vision.types.ImportProductSetsInputConfig(gcs_source=gcs_source) - with pytest.raises(exceptions.Forbidden) as exc: - self.ps_client.import_product_sets( - parent=self.location_path, input_config=input_config - ) - - assert self.gcs_read_error_message in exc.value.message - - def test_async_batch_annotate_files_read_blocked(self): - # Make the request. - method_name = "test_async_batch_annotate_files_read_blocked" - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=self.test_bucket.name, method_name=method_name - ) - # The input file is in a gcs bucket that is outside of the secure perimeter. - request = { - "input_config": { - "gcs_source": {"uri": self.gcs_uri_blocked_file}, - "mime_type": "application/pdf", - }, - "features": [{"type": vision.enums.Feature.Type.DOCUMENT_TEXT_DETECTION}], - "output_config": {"gcs_destination": {"uri": output_gcs_uri_prefix}}, - } - with pytest.raises(exceptions.Forbidden) as exc: - self.client.async_batch_annotate_files([request]) - - assert self.gcs_read_error_message in exc.value.message - - def test_async_batch_annotate_files_write_blocked(self): - # Upload the image to Google Cloud Storage. - blob_name = "async_batch_annotate_files_write_blocked.pdf" - blob = self.test_bucket.blob(blob_name) - self.to_delete_by_case.append(blob) - with io.open(PDF_FILE, "rb") as image_file: - blob.upload_from_file(image_file) - - method_name = "test_async_batch_annotate_files_write_blocked" - # Write the result to a bucket outside of the secure perimeter. - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=vpcsc_config.bucket_outside, method_name=method_name - ) - request = { - "input_config": { - "gcs_source": { - "uri": "gs://{bucket}/{blob}".format( - bucket=self.test_bucket.name, blob=blob_name - ) - }, - "mime_type": "application/pdf", - }, - "features": [{"type": vision.enums.Feature.Type.DOCUMENT_TEXT_DETECTION}], - "output_config": {"gcs_destination": {"uri": output_gcs_uri_prefix}}, - } - response = self.client.async_batch_annotate_files([request]) - - # Wait for the operation to complete. - lro_waiting_seconds = 90 - start_time = time.time() - while not response.done() and (time.time() - start_time) < lro_waiting_seconds: - time.sleep(1) - assert response.done - - # Verify there was an error writing to the output bucket. - error = response.operation.error - assert error.code == 7 - assert self.gcs_write_error_message in error.message - - def test_async_batch_annotate_images_read_blocked(self): - request = { - "image": {"source": {"image_uri": self.gcs_uri_blocked_file}}, - "features": [{"type": vision.enums.Feature.Type.LOGO_DETECTION}], - } - method_name = "test_async_batch_annotate_images_read_blocked" - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=self.test_bucket.name, method_name=method_name - ) - output_config = {"gcs_destination": {"uri": output_gcs_uri_prefix}} - response = self.client.async_batch_annotate_images([request], output_config) - # Wait for the operation to complete. - lro_waiting_seconds = 90 - start_time = time.time() - while not response.done() and (time.time() - start_time) < lro_waiting_seconds: - time.sleep(1) - assert response.done() - - # Make sure getting the result is not an error. - response.result() - blobs = list(self.test_bucket.list_blobs(prefix=method_name)) - assert len(blobs) == 1 - blob = blobs[0] - - # Download the output file. - result_str = blob.download_as_string().decode("utf8") - result = json.loads(result_str) - responses = result["responses"] - assert len(responses) == 1 - - # Verify the read error. - error = responses[0]["error"] - assert error["code"] == 7 - assert self.gcs_read_error_message in error["message"] - - def test_async_batch_annotate_images_write_blocked(self): - request = { - "image": {"source": {"image_uri": self.gcs_uri_blocked_file}}, - "features": [{"type": vision.enums.Feature.Type.LOGO_DETECTION}], - } - method_name = "test_async_batch_annotate_images_write_blocked" - - # Write the result to a bucket outside of the secure perimeter. - output_gcs_uri_prefix = "gs://{bucket}/{method_name}".format( - bucket=vpcsc_config.bucket_outside, method_name=method_name - ) - output_config = {"gcs_destination": {"uri": output_gcs_uri_prefix}} - response = self.client.async_batch_annotate_images([request], output_config) - # Wait for the operation to complete. - lro_waiting_seconds = 90 - start_time = time.time() - while not response.done() and (time.time() - start_time) < lro_waiting_seconds: - time.sleep(1) - assert response.done() - - # Verify there was an error writing to the output bucket. - error = response.operation.error - assert error.code == 7 - assert self.gcs_write_error_message in error.message - - def test_batch_annotate_images_read_blocked(self): - response = self.client.logo_detection( - {"source": {"image_uri": self.gcs_uri_blocked_file}} - ) - error = response.error - assert error.code == 7 - assert self.gcs_read_error_message in error.message diff --git a/vision/tests/unit/__init__.py b/vision/tests/unit/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py b/vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py deleted file mode 100644 index 0cca03f9a1e9..000000000000 --- a/vision/tests/unit/gapic/v1/test_image_annotator_client_v1.py +++ /dev/null @@ -1,256 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1 -from google.cloud.vision_v1.proto import image_annotator_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestImageAnnotatorClient(object): - def test_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_images(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_images_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_images(requests) - - def test_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateFilesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_files(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_files_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_files(requests) - - def test_async_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateImagesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_images", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - output_config = {} - - response = client.async_batch_annotate_images(requests, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateImagesRequest( - requests=requests, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_images_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_images_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - output_config = {} - - response = client.async_batch_annotate_images(requests, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_async_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateFilesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_files_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1/test_product_search_client_v1.py b/vision/tests/unit/gapic/v1/test_product_search_client_v1.py deleted file mode 100644 index 5a3ac65490b6..000000000000 --- a/vision/tests/unit/gapic/v1/test_product_search_client_v1.py +++ /dev/null @@ -1,895 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1 -from google.cloud.vision_v1.proto import product_search_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestProductSearchClient(object): - def test_create_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - - response = client.create_product_set(parent, product_set) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - - with pytest.raises(CustomException): - client.create_product_set(parent, product_set) - - def test_list_product_sets(self): - # Setup Expected Response - next_page_token = "" - product_sets_element = {} - product_sets = [product_sets_element] - expected_response = { - "next_page_token": next_page_token, - "product_sets": product_sets, - } - expected_response = product_search_service_pb2.ListProductSetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.product_sets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductSetsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_product_sets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product_set(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - expected_response = {"name": name_2, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - response = client.get_product_set(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.get_product_set(name) - - def test_update_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - product_set = {} - - response = client.update_product_set(product_set) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - product_set = {} - - with pytest.raises(CustomException): - client.update_product_set(product_set) - - def test_delete_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - client.delete_product_set(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.delete_product_set(name) - - def test_create_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - - response = client.create_product(parent, product) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - - with pytest.raises(CustomException): - client.create_product(parent, product) - - def test_list_products(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - response = client.get_product(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.get_product(name) - - def test_update_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - product = {} - - response = client.update_product(product) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductRequest( - product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - product = {} - - with pytest.raises(CustomException): - client.update_product(product) - - def test_delete_product(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - client.delete_product(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.delete_product(name) - - def test_create_reference_image(self): - # Setup Expected Response - name = "name3373707" - uri = "uri116076" - expected_response = {"name": name, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - - response = client.create_reference_image(parent, reference_image) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, reference_image=reference_image - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - - with pytest.raises(CustomException): - client.create_reference_image(parent, reference_image) - - def test_delete_reference_image(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - client.delete_reference_image(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.delete_reference_image(name) - - def test_list_reference_images(self): - # Setup Expected Response - page_size = 883849137 - next_page_token = "" - reference_images_element = {} - reference_images = [reference_images_element] - expected_response = { - "page_size": page_size, - "next_page_token": next_page_token, - "reference_images": reference_images, - } - expected_response = product_search_service_pb2.ListReferenceImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.reference_images[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_reference_images_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_reference_image(self): - # Setup Expected Response - name_2 = "name2-1052831874" - uri = "uri116076" - expected_response = {"name": name_2, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - response = client.get_reference_image(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.get_reference_image(name) - - def test_add_product_to_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - client.add_product_to_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_add_product_to_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.add_product_to_product_set(name, product) - - def test_remove_product_from_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - client.remove_product_from_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_remove_product_from_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.remove_product_from_product_set(name, product) - - def test_list_products_in_product_set(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsInProductSetResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_in_product_set_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_import_product_sets(self): - # Setup Expected Response - expected_response = {} - expected_response = product_search_service_pb2.ImportProductSetsResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_import_product_sets", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_product_sets_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_product_sets_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_purge_products(self): - # Setup Expected Response - expected_response = {} - expected_response = empty_pb2.Empty(**expected_response) - operation = operations_pb2.Operation( - name="operations/test_purge_products", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.purge_products(parent) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.PurgeProductsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_purge_products_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_purge_products_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - response = client.purge_products(parent) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1p1beta1/test_image_annotator_client_v1p1beta1.py b/vision/tests/unit/gapic/v1p1beta1/test_image_annotator_client_v1p1beta1.py deleted file mode 100644 index 0b0b7fe03012..000000000000 --- a/vision/tests/unit/gapic/v1p1beta1/test_image_annotator_client_v1p1beta1.py +++ /dev/null @@ -1,102 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.cloud import vision_v1p1beta1 -from google.cloud.vision_v1p1beta1.proto import image_annotator_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestImageAnnotatorClient(object): - def test_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p1beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_images(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_images_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p1beta1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_images(requests) diff --git a/vision/tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py b/vision/tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py deleted file mode 100644 index 8bc24368c192..000000000000 --- a/vision/tests/unit/gapic/v1p2beta1/test_image_annotator_client_v1p2beta1.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1p2beta1 -from google.cloud.vision_v1p2beta1.proto import image_annotator_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestImageAnnotatorClient(object): - def test_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p2beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_images(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_images_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p2beta1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_images(requests) - - def test_async_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateFilesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p2beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_files_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p2beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py b/vision/tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py deleted file mode 100644 index de5486baf098..000000000000 --- a/vision/tests/unit/gapic/v1p3beta1/test_image_annotator_client_v1p3beta1.py +++ /dev/null @@ -1,159 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1p3beta1 -from google.cloud.vision_v1p3beta1.proto import image_annotator_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestImageAnnotatorClient(object): - def test_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_images(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_images_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_images(requests) - - def test_async_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateFilesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_files_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py b/vision/tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py deleted file mode 100644 index 7790314c85bb..000000000000 --- a/vision/tests/unit/gapic/v1p3beta1/test_product_search_client_v1p3beta1.py +++ /dev/null @@ -1,858 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1p3beta1 -from google.cloud.vision_v1p3beta1.proto import product_search_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestProductSearchClient(object): - def test_create_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - product_set_id = "productSetId4216680" - - response = client.create_product_set(parent, product_set, product_set_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - product_set_id = "productSetId4216680" - - with pytest.raises(CustomException): - client.create_product_set(parent, product_set, product_set_id) - - def test_list_product_sets(self): - # Setup Expected Response - next_page_token = "" - product_sets_element = {} - product_sets = [product_sets_element] - expected_response = { - "next_page_token": next_page_token, - "product_sets": product_sets, - } - expected_response = product_search_service_pb2.ListProductSetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.product_sets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductSetsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_product_sets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product_set(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - expected_response = {"name": name_2, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - response = client.get_product_set(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.get_product_set(name) - - def test_update_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - product_set = {} - update_mask = {} - - response = client.update_product_set(product_set, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - product_set = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_product_set(product_set, update_mask) - - def test_delete_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - client.delete_product_set(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.delete_product_set(name) - - def test_create_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - product_id = "productId1753008747" - - response = client.create_product(parent, product, product_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - product_id = "productId1753008747" - - with pytest.raises(CustomException): - client.create_product(parent, product, product_id) - - def test_list_products(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - response = client.get_product(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.get_product(name) - - def test_update_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - product = {} - update_mask = {} - - response = client.update_product(product, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - product = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_product(product, update_mask) - - def test_delete_product(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - client.delete_product(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.delete_product(name) - - def test_create_reference_image(self): - # Setup Expected Response - name = "name3373707" - uri = "uri116076" - expected_response = {"name": name, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - reference_image_id = "referenceImageId1946713331" - - response = client.create_reference_image( - parent, reference_image, reference_image_id - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - reference_image_id = "referenceImageId1946713331" - - with pytest.raises(CustomException): - client.create_reference_image(parent, reference_image, reference_image_id) - - def test_delete_reference_image(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - client.delete_reference_image(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.delete_reference_image(name) - - def test_list_reference_images(self): - # Setup Expected Response - page_size = 883849137 - next_page_token = "" - reference_images_element = {} - reference_images = [reference_images_element] - expected_response = { - "page_size": page_size, - "next_page_token": next_page_token, - "reference_images": reference_images, - } - expected_response = product_search_service_pb2.ListReferenceImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.reference_images[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_reference_images_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_reference_image(self): - # Setup Expected Response - name_2 = "name2-1052831874" - uri = "uri116076" - expected_response = {"name": name_2, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - response = client.get_reference_image(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.get_reference_image(name) - - def test_add_product_to_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - client.add_product_to_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_add_product_to_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - with pytest.raises(CustomException): - client.add_product_to_product_set(name, product) - - def test_remove_product_from_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - client.remove_product_from_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_remove_product_from_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - with pytest.raises(CustomException): - client.remove_product_from_product_set(name, product) - - def test_list_products_in_product_set(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsInProductSetResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_in_product_set_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_import_product_sets(self): - # Setup Expected Response - expected_response = {} - expected_response = product_search_service_pb2.ImportProductSetsResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_import_product_sets", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_product_sets_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_product_sets_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p3beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py b/vision/tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py deleted file mode 100644 index a1ec513a1b2c..000000000000 --- a/vision/tests/unit/gapic/v1p4beta1/test_image_annotator_client_v1p4beta1.py +++ /dev/null @@ -1,256 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1p4beta1 -from google.cloud.vision_v1p4beta1.proto import image_annotator_pb2 -from google.longrunning import operations_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestImageAnnotatorClient(object): - def test_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_images(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateImagesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_images_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_images(requests) - - def test_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.BatchAnnotateFilesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.batch_annotate_files(requests) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.BatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_batch_annotate_files_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup request - requests = [] - - with pytest.raises(CustomException): - client.batch_annotate_files(requests) - - def test_async_batch_annotate_images(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateImagesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_images", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - output_config = {} - - response = client.async_batch_annotate_images(requests, output_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateImagesRequest( - requests=requests, output_config=output_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_images_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_images_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - output_config = {} - - response = client.async_batch_annotate_images(requests, output_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_async_batch_annotate_files(self): - # Setup Expected Response - expected_response = {} - expected_response = image_annotator_pb2.AsyncBatchAnnotateFilesResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = image_annotator_pb2.AsyncBatchAnnotateFilesRequest( - requests=requests - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_async_batch_annotate_files_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_async_batch_annotate_files_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ImageAnnotatorClient() - - # Setup Request - requests = [] - - response = client.async_batch_annotate_files(requests) - exception = response.exception() - assert exception.errors[0] == error diff --git a/vision/tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py b/vision/tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py deleted file mode 100644 index 35aad821b9b1..000000000000 --- a/vision/tests/unit/gapic/v1p4beta1/test_product_search_client_v1p4beta1.py +++ /dev/null @@ -1,891 +0,0 @@ -# -*- coding: utf-8 -*- -# -# Copyright 2020 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. - -"""Unit tests.""" - -import mock -import pytest - -from google.rpc import status_pb2 - -from google.cloud import vision_v1p4beta1 -from google.cloud.vision_v1p4beta1.proto import product_search_service_pb2 -from google.longrunning import operations_pb2 -from google.protobuf import empty_pb2 -from google.protobuf import field_mask_pb2 - - -class MultiCallableStub(object): - """Stub for the grpc.UnaryUnaryMultiCallable interface.""" - - def __init__(self, method, channel_stub): - self.method = method - self.channel_stub = channel_stub - - def __call__(self, request, timeout=None, metadata=None, credentials=None): - self.channel_stub.requests.append((self.method, request)) - - response = None - if self.channel_stub.responses: - response = self.channel_stub.responses.pop() - - if isinstance(response, Exception): - raise response - - if response: - return response - - -class ChannelStub(object): - """Stub for the grpc.Channel interface.""" - - def __init__(self, responses=[]): - self.responses = responses - self.requests = [] - - def unary_unary(self, method, request_serializer=None, response_deserializer=None): - return MultiCallableStub(method, self) - - -class CustomException(Exception): - pass - - -class TestProductSearchClient(object): - def test_create_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - product_set_id = "productSetId4216680" - - response = client.create_product_set(parent, product_set, product_set_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductSetRequest( - parent=parent, product_set=product_set, product_set_id=product_set_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product_set = {} - product_set_id = "productSetId4216680" - - with pytest.raises(CustomException): - client.create_product_set(parent, product_set, product_set_id) - - def test_list_product_sets(self): - # Setup Expected Response - next_page_token = "" - product_sets_element = {} - product_sets = [product_sets_element] - expected_response = { - "next_page_token": next_page_token, - "product_sets": product_sets, - } - expected_response = product_search_service_pb2.ListProductSetsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.product_sets[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductSetsRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_product_sets_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_product_sets(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product_set(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - expected_response = {"name": name_2, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - response = client.get_product_set(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.get_product_set(name) - - def test_update_product_set(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - expected_response = {"name": name, "display_name": display_name} - expected_response = product_search_service_pb2.ProductSet(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - product_set = {} - update_mask = {} - - response = client.update_product_set(product_set, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductSetRequest( - product_set=product_set, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - product_set = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_product_set(product_set, update_mask) - - def test_delete_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - client.delete_product_set(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductSetRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - with pytest.raises(CustomException): - client.delete_product_set(name) - - def test_create_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - product_id = "productId1753008747" - - response = client.create_product(parent, product, product_id) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateProductRequest( - parent=parent, product=product, product_id=product_id - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - product = {} - product_id = "productId1753008747" - - with pytest.raises(CustomException): - client.create_product(parent, product, product_id) - - def test_list_products(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsRequest(parent=parent) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.location_path("[PROJECT]", "[LOCATION]") - - paged_list_response = client.list_products(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_product(self): - # Setup Expected Response - name_2 = "name2-1052831874" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name_2, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - response = client.get_product(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.get_product(name) - - def test_update_product(self): - # Setup Expected Response - name = "name3373707" - display_name = "displayName1615086568" - description = "description-1724546052" - product_category = "productCategory-1607451058" - expected_response = { - "name": name, - "display_name": display_name, - "description": description, - "product_category": product_category, - } - expected_response = product_search_service_pb2.Product(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - product = {} - update_mask = {} - - response = client.update_product(product, update_mask) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.UpdateProductRequest( - product=product, update_mask=update_mask - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_update_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - product = {} - update_mask = {} - - with pytest.raises(CustomException): - client.update_product(product, update_mask) - - def test_delete_product(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - client.delete_product(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteProductRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_product_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - with pytest.raises(CustomException): - client.delete_product(name) - - def test_create_reference_image(self): - # Setup Expected Response - name = "name3373707" - uri = "uri116076" - expected_response = {"name": name, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - reference_image_id = "referenceImageId1946713331" - - response = client.create_reference_image( - parent, reference_image, reference_image_id - ) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.CreateReferenceImageRequest( - parent=parent, - reference_image=reference_image, - reference_image_id=reference_image_id, - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_create_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - reference_image = {} - reference_image_id = "referenceImageId1946713331" - - with pytest.raises(CustomException): - client.create_reference_image(parent, reference_image, reference_image_id) - - def test_delete_reference_image(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - client.delete_reference_image(name) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.DeleteReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.delete_reference_image(name) - - def test_list_reference_images(self): - # Setup Expected Response - page_size = 883849137 - next_page_token = "" - reference_images_element = {} - reference_images = [reference_images_element] - expected_response = { - "page_size": page_size, - "next_page_token": next_page_token, - "reference_images": reference_images, - } - expected_response = product_search_service_pb2.ListReferenceImagesResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.reference_images[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListReferenceImagesRequest( - parent=parent - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_reference_images_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - parent = client.product_path("[PROJECT]", "[LOCATION]", "[PRODUCT]") - - paged_list_response = client.list_reference_images(parent) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_get_reference_image(self): - # Setup Expected Response - name_2 = "name2-1052831874" - uri = "uri116076" - expected_response = {"name": name_2, "uri": uri} - expected_response = product_search_service_pb2.ReferenceImage( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - response = client.get_reference_image(name) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.GetReferenceImageRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_get_reference_image_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.reference_image_path( - "[PROJECT]", "[LOCATION]", "[PRODUCT]", "[REFERENCE_IMAGE]" - ) - - with pytest.raises(CustomException): - client.get_reference_image(name) - - def test_add_product_to_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - client.add_product_to_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.AddProductToProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_add_product_to_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - with pytest.raises(CustomException): - client.add_product_to_product_set(name, product) - - def test_remove_product_from_product_set(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - client.remove_product_from_product_set(name, product) - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.RemoveProductFromProductSetRequest( - name=name, product=product - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_remove_product_from_product_set_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - product = "product-309474065" - - with pytest.raises(CustomException): - client.remove_product_from_product_set(name, product) - - def test_list_products_in_product_set(self): - # Setup Expected Response - next_page_token = "" - products_element = {} - products = [products_element] - expected_response = {"next_page_token": next_page_token, "products": products} - expected_response = product_search_service_pb2.ListProductsInProductSetResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - resources = list(paged_list_response) - assert len(resources) == 1 - - assert expected_response.products[0] == resources[0] - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ListProductsInProductSetRequest( - name=name - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_list_products_in_product_set_exception(self): - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup request - name = client.product_set_path("[PROJECT]", "[LOCATION]", "[PRODUCT_SET]") - - paged_list_response = client.list_products_in_product_set(name) - with pytest.raises(CustomException): - list(paged_list_response) - - def test_import_product_sets(self): - # Setup Expected Response - expected_response = {} - expected_response = product_search_service_pb2.ImportProductSetsResponse( - **expected_response - ) - operation = operations_pb2.Operation( - name="operations/test_import_product_sets", done=True - ) - operation.response.Pack(expected_response) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - result = response.result() - assert expected_response == result - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.ImportProductSetsRequest( - parent=parent, input_config=input_config - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_import_product_sets_exception(self): - # Setup Response - error = status_pb2.Status() - operation = operations_pb2.Operation( - name="operations/test_import_product_sets_exception", done=True - ) - operation.error.CopyFrom(error) - - # Mock the API response - channel = ChannelStub(responses=[operation]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - # Setup Request - parent = client.location_path("[PROJECT]", "[LOCATION]") - input_config = {} - - response = client.import_product_sets(parent, input_config) - exception = response.exception() - assert exception.errors[0] == error - - def test_purge_products(self): - # Setup Expected Response - name = "name3373707" - done = True - expected_response = {"name": name, "done": done} - expected_response = operations_pb2.Operation(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - response = client.purge_products() - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = product_search_service_pb2.PurgeProductsRequest() - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_purge_products_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = vision_v1p4beta1.ProductSearchClient() - - with pytest.raises(CustomException): - client.purge_products() diff --git a/vision/tests/unit/test_decorators.py b/vision/tests/unit/test_decorators.py deleted file mode 100644 index c78707b29829..000000000000 --- a/vision/tests/unit/test_decorators.py +++ /dev/null @@ -1,112 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import -import unittest - -import mock - -from google.auth.credentials import Credentials -from google.cloud import vision -from google.cloud import vision_helpers - - -class DecoratorTests(unittest.TestCase): - def test_noop_without_enums(self): - class A(object): - pass - - APrime = vision_helpers.decorators.add_single_feature_methods(A) - - # It should be the same class object. - assert A is APrime - - # Nothing should have been added. - assert not hasattr(A, "face_detection") - assert not hasattr(A, "logo_detection") - - def test_with_enums(self): - class A(object): - enums = vision.enums - - # There should not be detection methods yet. - assert not hasattr(A, "face_detection") - - # Add the detection methods. - APrime = vision_helpers.decorators.add_single_feature_methods(A) - assert A is APrime - - # There should be detection methods now. - assert hasattr(A, "face_detection") - assert callable(A.face_detection) - - -class SingleFeatureMethodTests(unittest.TestCase): - @mock.patch.object(vision.ImageAnnotatorClient, "annotate_image") - def test_runs_generic_single_image(self, ai): - ai.return_value = vision.types.AnnotateImageResponse() - - # Prove that other aspects of the AnnotateImageRequest, such as the - # image context, will be preserved. - SENTINEL = mock.sentinel.image_context - - # Make a face detection request. - client = vision.ImageAnnotatorClient(credentials=mock.Mock(spec=Credentials)) - image = {"source": {"image_uri": "gs://my-test-bucket/image.jpg"}} - max_results = 50 - response = client.face_detection( - image, image_context=SENTINEL, max_results=max_results - ) - assert isinstance(response, vision.types.AnnotateImageResponse) - - # Assert that the single-image method was called as expected. - ai.assert_called_once_with( - { - "features": [ - { - "type": vision.enums.Feature.Type.FACE_DETECTION, - "max_results": max_results, - } - ], - "image": image, - "image_context": SENTINEL, - }, - retry=None, - timeout=None, - ) - - @mock.patch.object(vision.ImageAnnotatorClient, "annotate_image") - def test_runs_generic_single_image_without_max_results(self, ai): - ai.return_value = vision.types.AnnotateImageResponse() - - # Prove that other aspects of the AnnotateImageRequest, such as the - # image context, will be preserved. - SENTINEL = mock.sentinel.image_context - - # Make a face detection request. - client = vision.ImageAnnotatorClient(credentials=mock.Mock(spec=Credentials)) - image = {"source": {"image_uri": "gs://my-test-bucket/image.jpg"}} - response = client.face_detection(image, image_context=SENTINEL) - assert isinstance(response, vision.types.AnnotateImageResponse) - - # Assert that the single-image method was called as expected. - ai.assert_called_once_with( - { - "features": [{"type": vision.enums.Feature.Type.FACE_DETECTION}], - "image": image, - "image_context": SENTINEL, - }, - retry=None, - timeout=None, - ) diff --git a/vision/tests/unit/test_helpers.py b/vision/tests/unit/test_helpers.py deleted file mode 100644 index 97239a140d28..000000000000 --- a/vision/tests/unit/test_helpers.py +++ /dev/null @@ -1,129 +0,0 @@ -# Copyright 2017, Google LLC All rights reserved. -# -# 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 -# -# http://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. - -from __future__ import absolute_import -import io -import unittest - -import mock - -from google.auth.credentials import Credentials - -from google.cloud.vision_v1 import ImageAnnotatorClient -from google.cloud.vision_v1 import types - - -class TestSingleImageHelper(unittest.TestCase): - def setUp(self): - credentials = mock.Mock(spec=Credentials) - self.client = ImageAnnotatorClient(credentials=credentials) - - @mock.patch.object(ImageAnnotatorClient, "batch_annotate_images") - def test_all_features_default(self, batch_annotate): - # Set up an image annotation request with no features. - image = types.Image(source={"image_uri": "http://foo.com/img.jpg"}) - request = types.AnnotateImageRequest(image=image) - assert not request.features - - # Perform the single image request. - self.client.annotate_image(request) - - # Evalute the argument sent to batch_annotate_images. - assert batch_annotate.call_count == 1 - _, args, kwargs = batch_annotate.mock_calls[0] - - # Only a single request object should be sent. - assert len(args[0]) == 1 - - # Evalute the request object to ensure it looks correct. - request_sent = args[0][0] - all_features = self.client._get_all_features() - assert request_sent.image is request.image - assert len(request_sent.features) == len(all_features) - - @mock.patch.object(ImageAnnotatorClient, "batch_annotate_images") - def test_explicit_features(self, batch_annotate): - # Set up an image annotation request with no features. - image = types.Image(source={"image_uri": "http://foo.com/img.jpg"}) - request = types.AnnotateImageRequest( - image=image, - features=[ - types.Feature(type=1), - types.Feature(type=2), - types.Feature(type=3), - ], - ) - - # Perform the single image request. - self.client.annotate_image(request) - - # Evalute the argument sent to batch_annotate_images. - assert batch_annotate.call_count == 1 - _, args, kwargs = batch_annotate.mock_calls[0] - - # Only a single request object should be sent. - assert len(args[0]) == 1 - - # Evalute the request object to ensure it looks correct. - request_sent = args[0][0] - assert request_sent.image is request.image - assert len(request_sent.features) == 3 - for feature, i in zip(request_sent.features, range(1, 4)): - assert feature.type == i - assert feature.max_results == 0 - - @mock.patch.object(ImageAnnotatorClient, "batch_annotate_images") - def test_image_file_handler(self, batch_annotate): - # Set up a file handler. - file_ = io.BytesIO(b"bogus==") - - # Perform the single image request. - self.client.annotate_image({"image": file_}) - - # Evaluate the argument sent to batch_annotate_images. - assert batch_annotate.call_count == 1 - _, args, kwargs = batch_annotate.mock_calls[0] - - # Only a single request object should be sent. - assert len(args[0]) == 1 - - # Evalute the request object to ensure it looks correct. - request_sent = args[0][0] - assert request_sent["image"]["content"] == b"bogus==" - - @mock.patch.object(ImageAnnotatorClient, "batch_annotate_images") - @mock.patch.object(io, "open") - def test_image_filename(self, io_open, batch_annotate): - # Make io.open send back a mock with a read method. - file_ = mock.MagicMock(spec=io.BytesIO) - io_open.return_value = file_ - file_.__enter__.return_value = file_ - file_.read.return_value = b"imagefile==" - - # Perform the single image request using a filename. - self.client.annotate_image({"image": {"source": {"filename": "image.jpeg"}}}) - - # Establish that my file was opened. - io_open.assert_called_once_with("image.jpeg", "rb") - - # Evalute the argument sent to batch_annotate_images. - assert batch_annotate.call_count == 1 - _, args, kwargs = batch_annotate.mock_calls[0] - - # Only a single request object should be sent. - assert len(args[0]) == 1 - - # Evalute the request object to ensure it looks correct. - request_sent = args[0][0] - assert request_sent["image"]["content"] == b"imagefile=="