diff --git a/videointelligence/google/cloud/gapic/__init__.py b/videointelligence/google/cloud/gapic/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/gapic/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/gapic/videointelligence/__init__.py b/videointelligence/google/cloud/gapic/videointelligence/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py deleted file mode 100644 index 5baae515c69c..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client.py +++ /dev/null @@ -1,238 +0,0 @@ -# Copyright 2017, Google Inc. 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. -# -# EDITING INSTRUCTIONS -# This file was generated from the file -# https://github.com/google/googleapis/blob/master/google/cloud/videointelligence/v1beta1/video_intelligence.proto, -# and updates to that file get reflected here through a refresh process. -# For the short term, the refresh process will only be runnable by Google engineers. -# -# The only allowed edits are to method and file documentation. A 3-way -# merge preserves those additions if the generated source changes. -"""Accesses the google.cloud.videointelligence.v1beta1 VideoIntelligenceService API.""" - -import collections -import json -import os -import pkg_resources -import platform - -from google.gapic.longrunning import operations_client -from google.gax import api_callable -from google.gax import config -from google.gax import path_template -import google.gax - -from google.cloud.gapic.videointelligence.v1beta1 import enums -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 - - -class VideoIntelligenceServiceClient(object): - """Service that implements Google Cloud Video Intelligence API.""" - - SERVICE_ADDRESS = 'videointelligence.googleapis.com' - """The default address of the service.""" - - DEFAULT_SERVICE_PORT = 443 - """The default port of the service.""" - - # The scopes needed to make gRPC calls to all of the methods defined in - # this service - _ALL_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) - - def __init__(self, - service_path=SERVICE_ADDRESS, - port=DEFAULT_SERVICE_PORT, - channel=None, - credentials=None, - ssl_credentials=None, - scopes=None, - client_config=None, - app_name=None, - app_version='', - lib_name=None, - lib_version='', - metrics_headers=()): - """Constructor. - - Args: - service_path (string): The domain name of the API remote host. - port (int): The port on which to connect to the remote host. - channel (:class:`grpc.Channel`): A ``Channel`` instance through - which to make calls. - credentials (object): The authorization credentials to attach to - requests. These credentials identify this application to the - service. - ssl_credentials (:class:`grpc.ChannelCredentials`): A - ``ChannelCredentials`` instance for use with an SSL-enabled - channel. - scopes (list[string]): A list of OAuth2 scopes to attach to requests. - client_config (dict): - A dictionary for call options for each method. See - :func:`google.gax.construct_settings` for the structure of - this data. Falls back to the default config if not specified - or the specified config is missing data points. - app_name (string): The name of the application calling - the service. Recommended for analytics purposes. - app_version (string): The version of the application calling - the service. Recommended for analytics purposes. - lib_name (string): The API library software used for calling - the service. (Unless you are writing an API client itself, - leave this as default.) - lib_version (string): The API library software version used - for calling the service. (Unless you are writing an API client - itself, leave this as default.) - metrics_headers (dict): A dictionary of values for tracking - client library metrics. Ultimately serializes to a string - (e.g. 'foo/1.2.3 bar/3.14.1'). This argument should be - considered private. - - Returns: - A VideoIntelligenceServiceClient object. - """ - # Unless the calling application specifically requested - # OAuth scopes, request everything. - if scopes is None: - scopes = self._ALL_SCOPES - - # Initialize an empty client config, if none is set. - if client_config is None: - client_config = {} - - # Initialize metrics_headers as an ordered dictionary - # (cuts down on cardinality of the resulting string slightly). - metrics_headers = collections.OrderedDict(metrics_headers) - metrics_headers['gl-python'] = platform.python_version() - - # The library may or may not be set, depending on what is - # calling this client. Newer client libraries set the library name - # and version. - if lib_name: - metrics_headers[lib_name] = lib_version - - # Finally, track the GAPIC package version. - metrics_headers['gapic'] = pkg_resources.get_distribution( - 'google-cloud-videointelligence', ).version - - # Load the configuration defaults. - default_client_config = json.loads( - pkg_resources.resource_string( - __name__, 'video_intelligence_service_client_config.json') - .decode()) - defaults = api_callable.construct_settings( - 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', - default_client_config, - client_config, - config.STATUS_CODE_NAMES, - metrics_headers=metrics_headers, ) - self.video_intelligence_service_stub = config.create_stub( - video_intelligence_pb2.VideoIntelligenceServiceStub, - channel=channel, - service_path=service_path, - service_port=port, - credentials=credentials, - scopes=scopes, - ssl_credentials=ssl_credentials) - - self.operations_client = operations_client.OperationsClient( - service_path=service_path, - port=port, - channel=channel, - credentials=credentials, - ssl_credentials=ssl_credentials, - scopes=scopes, - client_config=client_config, - metrics_headers=metrics_headers, ) - - self._annotate_video = api_callable.create_api_call( - self.video_intelligence_service_stub.AnnotateVideo, - settings=defaults['annotate_video']) - - # Service calls - def annotate_video(self, - input_uri, - features, - input_content=None, - video_context=None, - output_uri=None, - location_id=None, - options=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.gapic.videointelligence.v1beta1 import video_intelligence_service_client - >>> from google.cloud.gapic.videointelligence.v1beta1 import enums - >>> client = video_intelligence_service_client.VideoIntelligenceServiceClient() - >>> input_uri = '' - >>> features = [] - >>> response = client.annotate_video(input_uri, features) - >>> - >>> def callback(operation_future): - >>> # Handle result. - >>> result = operation_future.result() - >>> - >>> response.add_done_callback(callback) - >>> - >>> # Handle metadata. - >>> metadata = response.metadata() - - Args: - input_uri (string): 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. - features (list[enum :class:`google.cloud.gapic.videointelligence.v1beta1.enums.Feature`]): Requested video annotation features. - input_content (string): The video data bytes. Encoding: base64. If unset, the input video(s) - should be specified via ``input_uri``. If set, ``input_uri`` should be unset. - video_context (:class:`google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2.VideoContext`): Additional video context and/or feature-specific parameters. - output_uri (string): 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 (string): 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. - options (:class:`google.gax.CallOptions`): Overrides the default - settings for this call, e.g, timeout, retries etc. - - Returns: - A :class:`google.gax._OperationFuture` instance. - - Raises: - :exc:`google.gax.errors.GaxError` if the RPC is aborted. - :exc:`ValueError` if the parameters are invalid. - """ - request = video_intelligence_pb2.AnnotateVideoRequest( - input_uri=input_uri, - features=features, - input_content=input_content, - video_context=video_context, - output_uri=output_uri, - location_id=location_id) - return google.gax._OperationFuture( - self._annotate_video(request, options), self.operations_client, - video_intelligence_pb2.AnnotateVideoResponse, - video_intelligence_pb2.AnnotateVideoProgress, options) diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json b/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json deleted file mode 100644 index 996b2ab5e30b..000000000000 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/video_intelligence_service_client_config.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "interfaces": { - "google.cloud.videointelligence.v1beta1.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/proto/__init__.py b/videointelligence/google/cloud/proto/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/proto/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/proto/videointelligence/__init__.py b/videointelligence/google/cloud/proto/videointelligence/__init__.py deleted file mode 100644 index de40ea7ca058..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/__init__.py +++ /dev/null @@ -1 +0,0 @@ -__import__('pkg_resources').declare_namespace(__name__) diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py b/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py deleted file mode 100644 index 8b137891791f..000000000000 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/__init__.py +++ /dev/null @@ -1 +0,0 @@ - diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py index 9e732b5800bd..9c89e385979c 100644 --- a/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/__init__.py @@ -14,15 +14,18 @@ from __future__ import absolute_import -from google.cloud.gapic.videointelligence.v1beta1.video_intelligence_service_client import VideoIntelligenceServiceClient -from google.cloud.gapic.videointelligence.v1beta1 import enums - from google.cloud.videointelligence_v1beta1 import types +from google.cloud.videointelligence_v1beta1.gapic import enums +from google.cloud.videointelligence_v1beta1.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', -) + 'VideoIntelligenceServiceClient', ) diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/__init__.py similarity index 100% rename from videointelligence/google/cloud/gapic/videointelligence/v1beta1/__init__.py rename to videointelligence/google/cloud/videointelligence_v1beta1/gapic/__init__.py diff --git a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py similarity index 95% rename from videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py rename to videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py index b0781914a3de..b44bb33c43ae 100644 --- a/videointelligence/google/cloud/gapic/videointelligence/v1beta1/enums.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/enums.py @@ -1,4 +1,4 @@ -# Copyright 2016 Google Inc. All rights reserved. +# Copyright 2017, Google Inc. 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. @@ -41,7 +41,7 @@ class LabelLevel(object): VIDEO_LEVEL (int): Video-level. Corresponds to the whole video. SEGMENT_LEVEL (int): Segment-level. Corresponds to one of ``AnnotateSpec.segments``. SHOT_LEVEL (int): Shot-level. Corresponds to a single shot (i.e. a series of frames - without a major camera position or background change). + without a major camera position or background change). FRAME_LEVEL (int): Frame-level. Corresponds to a single video frame. """ LABEL_LEVEL_UNSPECIFIED = 0 diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py new file mode 100644 index 000000000000..63bd4d4ea7c4 --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client.py @@ -0,0 +1,225 @@ +# Copyright 2017, Google Inc. 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. +# +# EDITING INSTRUCTIONS +# This file was generated from the file +# https://github.com/google/googleapis/blob/master/google/cloud/videointelligence/v1beta1/video_intelligence.proto, +# and updates to that file get reflected here through a refresh process. +# For the short term, the refresh process will only be runnable by Google engineers. +# +# The only allowed edits are to method and file documentation. A 3-way +# merge preserves those additions if the generated source changes. +"""Accesses the google.cloud.videointelligence.v1beta1 VideoIntelligenceService API.""" + +import collections +import json +import os +import pkg_resources +import platform + +from google.gapic.longrunning import operations_client +from google.gax import api_callable +from google.gax import config +from google.gax import path_template +import google.gax + +from google.cloud.videointelligence_v1beta1.gapic import enums +from google.cloud.videointelligence_v1beta1.gapic import video_intelligence_service_client_config +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 + + +class VideoIntelligenceServiceClient(object): + """Service that implements Google Cloud Video Intelligence API.""" + + SERVICE_ADDRESS = 'videointelligence.googleapis.com' + """The default address of the service.""" + + DEFAULT_SERVICE_PORT = 443 + """The default port of the service.""" + + # The scopes needed to make gRPC calls to all of the methods defined in + # this service + _ALL_SCOPES = ('https://www.googleapis.com/auth/cloud-platform', ) + + def __init__(self, + channel=None, + credentials=None, + ssl_credentials=None, + scopes=None, + client_config=None, + lib_name=None, + lib_version='', + metrics_headers=()): + """Constructor. + + Args: + channel (~grpc.Channel): A ``Channel`` instance through + which to make calls. + credentials (~google.auth.credentials.Credentials): The authorization + credentials to attach to requests. These credentials identify this + application to the service. + ssl_credentials (~grpc.ChannelCredentials): A + ``ChannelCredentials`` instance for use with an SSL-enabled + channel. + scopes (Sequence[str]): A list of OAuth2 scopes to attach to requests. + client_config (dict): + A dictionary for call options for each method. See + :func:`google.gax.construct_settings` for the structure of + this data. Falls back to the default config if not specified + or the specified config is missing data points. + lib_name (str): The API library software used for calling + the service. (Unless you are writing an API client itself, + leave this as default.) + lib_version (str): The API library software version used + for calling the service. (Unless you are writing an API client + itself, leave this as default.) + metrics_headers (dict): A dictionary of values for tracking + client library metrics. Ultimately serializes to a string + (e.g. 'foo/1.2.3 bar/3.14.1'). This argument should be + considered private. + """ + # Unless the calling application specifically requested + # OAuth scopes, request everything. + if scopes is None: + scopes = self._ALL_SCOPES + + # Initialize an empty client config, if none is set. + if client_config is None: + client_config = {} + + # Initialize metrics_headers as an ordered dictionary + # (cuts down on cardinality of the resulting string slightly). + metrics_headers = collections.OrderedDict(metrics_headers) + metrics_headers['gl-python'] = platform.python_version() + + # The library may or may not be set, depending on what is + # calling this client. Newer client libraries set the library name + # and version. + if lib_name: + metrics_headers[lib_name] = lib_version + + # Finally, track the GAPIC package version. + metrics_headers['gapic'] = pkg_resources.get_distribution( + 'google-cloud-videointelligence', ).version + + # Load the configuration defaults. + defaults = api_callable.construct_settings( + 'google.cloud.videointelligence.v1beta1.VideoIntelligenceService', + video_intelligence_service_client_config.config, + client_config, + config.STATUS_CODE_NAMES, + metrics_headers=metrics_headers, ) + self.video_intelligence_service_stub = config.create_stub( + video_intelligence_pb2.VideoIntelligenceServiceStub, + channel=channel, + service_path=self.SERVICE_ADDRESS, + service_port=self.DEFAULT_SERVICE_PORT, + credentials=credentials, + scopes=scopes, + ssl_credentials=ssl_credentials) + + self.operations_client = operations_client.OperationsClient( + channel=channel, + credentials=credentials, + ssl_credentials=ssl_credentials, + scopes=scopes, + client_config=client_config, + metrics_headers=metrics_headers, ) + + self._annotate_video = api_callable.create_api_call( + self.video_intelligence_service_stub.AnnotateVideo, + settings=defaults['annotate_video']) + + # Service calls + def annotate_video(self, + input_uri, + features, + input_content=None, + video_context=None, + output_uri=None, + location_id=None, + options=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_v1beta1 + >>> from google.cloud.videointelligence_v1beta1 import enums + >>> + >>> client = videointelligence_v1beta1.VideoIntelligenceServiceClient() + >>> + >>> input_uri = '' + >>> features = [] + >>> + >>> response = client.annotate_video(input_uri, 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. + features (list[~google.cloud.videointelligence_v1beta1.types.Feature]): Requested video annotation features. + input_content (str): The video data bytes. Encoding: base64. If unset, the input video(s) + should be specified via ``input_uri``. If set, ``input_uri`` should be unset. + video_context (Union[dict, ~google.cloud.videointelligence_v1beta1.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_v1beta1.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. + options (~google.gax.CallOptions): Overrides the default + settings for this call, e.g, timeout, retries etc. + + Returns: + A :class:`~google.cloud.videointelligence_v1beta1.types._OperationFuture` instance. + + Raises: + :exc:`google.gax.errors.GaxError` if the RPC is aborted. + :exc:`ValueError` if the parameters are invalid. + """ + request = video_intelligence_pb2.AnnotateVideoRequest( + input_uri=input_uri, + features=features, + input_content=input_content, + video_context=video_context, + output_uri=output_uri, + location_id=location_id) + return google.gax._OperationFuture( + self._annotate_video(request, options), self.operations_client, + video_intelligence_pb2.AnnotateVideoResponse, + video_intelligence_pb2.AnnotateVideoProgress, options) diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py new file mode 100644 index 000000000000..1f9d656ca75e --- /dev/null +++ b/videointelligence/google/cloud/videointelligence_v1beta1/gapic/video_intelligence_service_client_config.py @@ -0,0 +1,28 @@ +config = { + "interfaces": { + "google.cloud.videointelligence.v1beta1.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_v1beta1/proto/__init__.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/__init__.py new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py similarity index 96% rename from videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py rename to videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py index 7eb2e71d7e05..12eb7e100a74 100644 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2.py @@ -1,5 +1,5 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! -# source: google/cloud/proto/videointelligence/v1beta1/video_intelligence.proto +# source: google/cloud/videointelligence_v1beta1/proto/video_intelligence.proto import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) @@ -21,13 +21,12 @@ DESCRIPTOR = _descriptor.FileDescriptor( - name='google/cloud/proto/videointelligence/v1beta1/video_intelligence.proto', + name='google/cloud/videointelligence_v1beta1/proto/video_intelligence.proto', package='google.cloud.videointelligence.v1beta1', syntax='proto3', - serialized_pb=_b('\nEgoogle/cloud/proto/videointelligence/v1beta1/video_intelligence.proto\x12&google.cloud.videointelligence.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.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(\t\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32/.google.cloud.videointelligence.v1beta1.Feature\x12K\n\rvideo_context\x18\x03 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t\"\xd2\x02\n\x0cVideoContext\x12\x46\n\x08segments\x18\x01 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12X\n\x14label_detection_mode\x18\x02 \x01(\x0e\x32:.google.cloud.videointelligence.v1beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x03 \x01(\x08\x12\x1d\n\x15label_detection_model\x18\x04 \x01(\t\x12\x1c\n\x14\x66\x61\x63\x65_detection_model\x18\x05 \x01(\t\x12#\n\x1bshot_change_detection_model\x18\x06 \x01(\t\x12#\n\x1bsafe_search_detection_model\x18\x07 \x01(\t\"B\n\x0cVideoSegment\x12\x19\n\x11start_time_offset\x18\x01 \x01(\x03\x12\x17\n\x0f\x65nd_time_offset\x18\x02 \x01(\x03\"\xad\x01\n\rLabelLocation\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x41\n\x05level\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.LabelLevel\"\x87\x01\n\x0fLabelAnnotation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12H\n\tlocations\x18\x03 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1beta1.LabelLocation\"\xfd\x02\n\x14SafeSearchAnnotation\x12\x41\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x41\n\x05spoof\x18\x02 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07medical\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07violent\x18\x04 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12@\n\x04racy\x18\x05 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x13\n\x0btime_offset\x18\x06 \x01(\x03\"G\n\x0b\x42oundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\r\n\x05right\x18\x02 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x03 \x01(\x05\x12\x0b\n\x03top\x18\x04 \x01(\x05\"n\n\x0c\x46\x61\x63\x65Location\x12I\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32\x33.google.cloud.videointelligence.v1beta1.BoundingBox\x12\x13\n\x0btime_offset\x18\x02 \x01(\x03\"\xb4\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\t\x12\x46\n\x08segments\x18\x02 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12G\n\tlocations\x18\x03 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.FaceLocation\"\xa3\x03\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12R\n\x11label_annotations\x18\x02 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta1.LabelAnnotation\x12P\n\x10\x66\x61\x63\x65_annotations\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1beta1.FaceAnnotation\x12N\n\x10shot_annotations\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12]\n\x17safe_search_annotations\x18\x06 \x03(\x0b\x32<.google.cloud.videointelligence.v1beta1.SafeSearchAnnotation\x12!\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.Status\"s\n\x15\x41nnotateVideoResponse\x12Z\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1beta1.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.v1beta1.VideoAnnotationProgress*\x81\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x02\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x03\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x04*n\n\nLabelLevel\x12\x1b\n\x17LABEL_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bVIDEO_LEVEL\x10\x01\x12\x11\n\rSEGMENT_LEVEL\x10\x02\x12\x0e\n\nSHOT_LEVEL\x10\x03\x12\x0f\n\x0b\x46RAME_LEVEL\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*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\xae\x01\n\x18VideoIntelligenceService\x12\x91\x01\n\rAnnotateVideo\x12<.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/videos:annotate:\x01*B\xcf\x01\n*com.google.cloud.videointelligence.v1beta1B\x1dVideoIntelligenceServiceProtoP\x01ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\xaa\x02&Google.Cloud.VideoIntelligence.V1Beta1b\x06proto3') + serialized_pb=_b('\nEgoogle/cloud/videointelligence_v1beta1/proto/video_intelligence.proto\x12&google.cloud.videointelligence.v1beta1\x1a\x1cgoogle/api/annotations.proto\x1a#google/longrunning/operations.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(\t\x12\x41\n\x08\x66\x65\x61tures\x18\x02 \x03(\x0e\x32/.google.cloud.videointelligence.v1beta1.Feature\x12K\n\rvideo_context\x18\x03 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoContext\x12\x12\n\noutput_uri\x18\x04 \x01(\t\x12\x13\n\x0blocation_id\x18\x05 \x01(\t\"\xd2\x02\n\x0cVideoContext\x12\x46\n\x08segments\x18\x01 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12X\n\x14label_detection_mode\x18\x02 \x01(\x0e\x32:.google.cloud.videointelligence.v1beta1.LabelDetectionMode\x12\x19\n\x11stationary_camera\x18\x03 \x01(\x08\x12\x1d\n\x15label_detection_model\x18\x04 \x01(\t\x12\x1c\n\x14\x66\x61\x63\x65_detection_model\x18\x05 \x01(\t\x12#\n\x1bshot_change_detection_model\x18\x06 \x01(\t\x12#\n\x1bsafe_search_detection_model\x18\x07 \x01(\t\"B\n\x0cVideoSegment\x12\x19\n\x11start_time_offset\x18\x01 \x01(\x03\x12\x17\n\x0f\x65nd_time_offset\x18\x02 \x01(\x03\"\xad\x01\n\rLabelLocation\x12\x45\n\x07segment\x18\x01 \x01(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12\x12\n\nconfidence\x18\x02 \x01(\x02\x12\x41\n\x05level\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.LabelLevel\"\x87\x01\n\x0fLabelAnnotation\x12\x13\n\x0b\x64\x65scription\x18\x01 \x01(\t\x12\x15\n\rlanguage_code\x18\x02 \x01(\t\x12H\n\tlocations\x18\x03 \x03(\x0b\x32\x35.google.cloud.videointelligence.v1beta1.LabelLocation\"\xfd\x02\n\x14SafeSearchAnnotation\x12\x41\n\x05\x61\x64ult\x18\x01 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x41\n\x05spoof\x18\x02 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07medical\x18\x03 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x43\n\x07violent\x18\x04 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12@\n\x04racy\x18\x05 \x01(\x0e\x32\x32.google.cloud.videointelligence.v1beta1.Likelihood\x12\x13\n\x0btime_offset\x18\x06 \x01(\x03\"G\n\x0b\x42oundingBox\x12\x0c\n\x04left\x18\x01 \x01(\x05\x12\r\n\x05right\x18\x02 \x01(\x05\x12\x0e\n\x06\x62ottom\x18\x03 \x01(\x05\x12\x0b\n\x03top\x18\x04 \x01(\x05\"n\n\x0c\x46\x61\x63\x65Location\x12I\n\x0c\x62ounding_box\x18\x01 \x01(\x0b\x32\x33.google.cloud.videointelligence.v1beta1.BoundingBox\x12\x13\n\x0btime_offset\x18\x02 \x01(\x03\"\xb4\x01\n\x0e\x46\x61\x63\x65\x41nnotation\x12\x11\n\tthumbnail\x18\x01 \x01(\t\x12\x46\n\x08segments\x18\x02 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12G\n\tlocations\x18\x03 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.FaceLocation\"\xa3\x03\n\x16VideoAnnotationResults\x12\x11\n\tinput_uri\x18\x01 \x01(\t\x12R\n\x11label_annotations\x18\x02 \x03(\x0b\x32\x37.google.cloud.videointelligence.v1beta1.LabelAnnotation\x12P\n\x10\x66\x61\x63\x65_annotations\x18\x03 \x03(\x0b\x32\x36.google.cloud.videointelligence.v1beta1.FaceAnnotation\x12N\n\x10shot_annotations\x18\x04 \x03(\x0b\x32\x34.google.cloud.videointelligence.v1beta1.VideoSegment\x12]\n\x17safe_search_annotations\x18\x06 \x03(\x0b\x32<.google.cloud.videointelligence.v1beta1.SafeSearchAnnotation\x12!\n\x05\x65rror\x18\x05 \x01(\x0b\x32\x12.google.rpc.Status\"s\n\x15\x41nnotateVideoResponse\x12Z\n\x12\x61nnotation_results\x18\x01 \x03(\x0b\x32>.google.cloud.videointelligence.v1beta1.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.v1beta1.VideoAnnotationProgress*\x81\x01\n\x07\x46\x65\x61ture\x12\x17\n\x13\x46\x45\x41TURE_UNSPECIFIED\x10\x00\x12\x13\n\x0fLABEL_DETECTION\x10\x01\x12\x12\n\x0e\x46\x41\x43\x45_DETECTION\x10\x02\x12\x19\n\x15SHOT_CHANGE_DETECTION\x10\x03\x12\x19\n\x15SAFE_SEARCH_DETECTION\x10\x04*n\n\nLabelLevel\x12\x1b\n\x17LABEL_LEVEL_UNSPECIFIED\x10\x00\x12\x0f\n\x0bVIDEO_LEVEL\x10\x01\x12\x11\n\rSEGMENT_LEVEL\x10\x02\x12\x0e\n\nSHOT_LEVEL\x10\x03\x12\x0f\n\x0b\x46RAME_LEVEL\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*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\xae\x01\n\x18VideoIntelligenceService\x12\x91\x01\n\rAnnotateVideo\x12<.google.cloud.videointelligence.v1beta1.AnnotateVideoRequest\x1a\x1d.google.longrunning.Operation\"#\x82\xd3\xe4\x93\x02\x1d\"\x18/v1beta1/videos:annotate:\x01*B\xcf\x01\n*com.google.cloud.videointelligence.v1beta1B\x1dVideoIntelligenceServiceProtoP\x01ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\xaa\x02&Google.Cloud.VideoIntelligence.V1Beta1b\x06proto3') , dependencies=[google_dot_api_dot_annotations__pb2.DESCRIPTOR,google_dot_longrunning_dot_operations__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,google_dot_rpc_dot_status__pb2.DESCRIPTOR,]) -_sym_db.RegisterFileDescriptor(DESCRIPTOR) _FEATURE = _descriptor.EnumDescriptor( name='Feature', @@ -880,10 +879,11 @@ DESCRIPTOR.enum_types_by_name['LabelLevel'] = _LABELLEVEL 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.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Video annotation request. @@ -931,7 +931,7 @@ VideoContext = _reflection.GeneratedProtocolMessageType('VideoContext', (_message.Message,), dict( DESCRIPTOR = _VIDEOCONTEXT, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Video context and/or feature-specific parameters. @@ -968,7 +968,7 @@ VideoSegment = _reflection.GeneratedProtocolMessageType('VideoSegment', (_message.Message,), dict( DESCRIPTOR = _VIDEOSEGMENT, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Video segment. @@ -985,7 +985,7 @@ LabelLocation = _reflection.GeneratedProtocolMessageType('LabelLocation', (_message.Message,), dict( DESCRIPTOR = _LABELLOCATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Label location. @@ -1007,7 +1007,7 @@ LabelAnnotation = _reflection.GeneratedProtocolMessageType('LabelAnnotation', (_message.Message,), dict( DESCRIPTOR = _LABELANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Label annotation. @@ -1026,7 +1026,7 @@ SafeSearchAnnotation = _reflection.GeneratedProtocolMessageType('SafeSearchAnnotation', (_message.Message,), dict( DESCRIPTOR = _SAFESEARCHANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Safe search annotation (based on per-frame visual signals only). If no unsafe content has been detected in a frame, no annotations are present @@ -1056,7 +1056,7 @@ BoundingBox = _reflection.GeneratedProtocolMessageType('BoundingBox', (_message.Message,), dict( DESCRIPTOR = _BOUNDINGBOX, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Bounding box. @@ -1077,7 +1077,7 @@ FaceLocation = _reflection.GeneratedProtocolMessageType('FaceLocation', (_message.Message,), dict( DESCRIPTOR = _FACELOCATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Face location. @@ -1094,7 +1094,7 @@ FaceAnnotation = _reflection.GeneratedProtocolMessageType('FaceAnnotation', (_message.Message,), dict( DESCRIPTOR = _FACEANNOTATION, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Face annotation. @@ -1116,7 +1116,7 @@ VideoAnnotationResults = _reflection.GeneratedProtocolMessageType('VideoAnnotationResults', (_message.Message,), dict( DESCRIPTOR = _VIDEOANNOTATIONRESULTS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Annotation results for a single video. @@ -1146,7 +1146,7 @@ AnnotateVideoResponse = _reflection.GeneratedProtocolMessageType('AnnotateVideoResponse', (_message.Message,), dict( DESCRIPTOR = _ANNOTATEVIDEORESPONSE, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Video annotation response. Included in the ``response`` field of the ``Operation`` returned by the ``GetOperation`` call of the @@ -1164,7 +1164,7 @@ VideoAnnotationProgress = _reflection.GeneratedProtocolMessageType('VideoAnnotationProgress', (_message.Message,), dict( DESCRIPTOR = _VIDEOANNOTATIONPROGRESS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Annotation progress for a single video. @@ -1187,7 +1187,7 @@ AnnotateVideoProgress = _reflection.GeneratedProtocolMessageType('AnnotateVideoProgress', (_message.Message,), dict( DESCRIPTOR = _ANNOTATEVIDEOPROGRESS, - __module__ = 'google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2' + __module__ = 'google.cloud.videointelligence_v1beta1.proto.video_intelligence_pb2' , __doc__ = """Video annotation progress. Included in the ``metadata`` field of the ``Operation`` returned by the ``GetOperation`` call of the @@ -1206,6 +1206,30 @@ DESCRIPTOR.has_options = True DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n*com.google.cloud.videointelligence.v1beta1B\035VideoIntelligenceServiceProtoP\001ZWgoogle.golang.org/genproto/googleapis/cloud/videointelligence/v1beta1;videointelligence\252\002&Google.Cloud.VideoIntelligence.V1Beta1')) + +_VIDEOINTELLIGENCESERVICE = _descriptor.ServiceDescriptor( + name='VideoIntelligenceService', + full_name='google.cloud.videointelligence.v1beta1.VideoIntelligenceService', + file=DESCRIPTOR, + index=0, + options=None, + serialized_start=3257, + serialized_end=3431, + methods=[ + _descriptor.MethodDescriptor( + name='AnnotateVideo', + full_name='google.cloud.videointelligence.v1beta1.VideoIntelligenceService.AnnotateVideo', + index=0, + containing_service=None, + input_type=_ANNOTATEVIDEOREQUEST, + output_type=google_dot_longrunning_dot_operations__pb2._OPERATION, + options=_descriptor._ParseOptions(descriptor_pb2.MethodOptions(), _b('\202\323\344\223\002\035\"\030/v1beta1/videos:annotate:\001*')), + ), +]) +_sym_db.RegisterServiceDescriptor(_VIDEOINTELLIGENCESERVICE) + +DESCRIPTOR.services_by_name['VideoIntelligenceService'] = _VIDEOINTELLIGENCESERVICE + try: # THESE ELEMENTS WILL BE DEPRECATED. # Please use the generated *_pb2_grpc.py files instead. diff --git a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py similarity index 74% rename from videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py rename to videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py index ca09db976c12..9625085d430f 100644 --- a/videointelligence/google/cloud/proto/videointelligence/v1beta1/video_intelligence_pb2_grpc.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/proto/video_intelligence_pb2_grpc.py @@ -1,8 +1,8 @@ # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! import grpc -import google.cloud.proto.videointelligence.v1beta1.video_intelligence_pb2 as google_dot_cloud_dot_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2 -import google.longrunning.operations_pb2 as google_dot_longrunning_dot_operations__pb2 +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 as google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2 +from google.longrunning import operations_pb2 as google_dot_longrunning_dot_operations__pb2 class VideoIntelligenceServiceStub(object): @@ -17,7 +17,7 @@ def __init__(self, channel): """ self.AnnotateVideo = channel.unary_unary( '/google.cloud.videointelligence.v1beta1.VideoIntelligenceService/AnnotateVideo', - request_serializer=google_dot_cloud_dot_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, + request_serializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.SerializeToString, response_deserializer=google_dot_longrunning_dot_operations__pb2.Operation.FromString, ) @@ -41,7 +41,7 @@ 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_proto_dot_videointelligence_dot_v1beta1_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, + request_deserializer=google_dot_cloud_dot_videointelligence__v1beta1_dot_proto_dot_video__intelligence__pb2.AnnotateVideoRequest.FromString, response_serializer=google_dot_longrunning_dot_operations__pb2.Operation.SerializeToString, ), } diff --git a/videointelligence/google/cloud/videointelligence_v1beta1/types.py b/videointelligence/google/cloud/videointelligence_v1beta1/types.py index bfc99c3ab24b..0c096fdfb931 100644 --- a/videointelligence/google/cloud/videointelligence_v1beta1/types.py +++ b/videointelligence/google/cloud/videointelligence_v1beta1/types.py @@ -15,15 +15,30 @@ from __future__ import absolute_import import sys -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 from google.gax.utils.messages import get_messages +from google.api import http_pb2 +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 +from google.longrunning import operations_pb2 +from google.protobuf import any_pb2 +from google.protobuf import descriptor_pb2 +from google.protobuf import empty_pb2 +from google.protobuf import timestamp_pb2 +from google.rpc import status_pb2 names = [] -for name, message in get_messages(video_intelligence_pb2).items(): - message.__module__ = 'google.cloud.videointelligence_v1beta1.types' - setattr(sys.modules[__name__], name, message) - names.append(name) - +for module in ( + http_pb2, + video_intelligence_pb2, + operations_pb2, + any_pb2, + descriptor_pb2, + empty_pb2, + timestamp_pb2, + status_pb2, ): + for name, message in get_messages(module).items(): + message.__module__ = 'google.cloud.videointelligence_v1beta1.types' + setattr(sys.modules[__name__], name, message) + names.append(name) __all__ = tuple(sorted(names)) diff --git a/videointelligence/setup.py b/videointelligence/setup.py index 6b69d4267840..2d6d4a6c06e4 100644 --- a/videointelligence/setup.py +++ b/videointelligence/setup.py @@ -35,10 +35,6 @@ namespace_packages=[ 'google', 'google.cloud', - 'google.cloud.gapic', - 'google.cloud.gapic.videointelligence', - 'google.cloud.proto', - 'google.cloud.proto.videointelligence', ], packages=find_packages(exclude=('tests*',)), install_requires=( diff --git a/videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py b/videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py similarity index 88% rename from videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py rename to videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py index 3d2dcb325420..8d6855f59313 100644 --- a/videointelligence/tests/gapic/v1beta1/test_video_intelligence_service_client.py +++ b/videointelligence/tests/unit/gapic/v1beta1/test_video_intelligence_service_client_v1beta1.py @@ -19,8 +19,8 @@ from google.gax import errors from google.rpc import status_pb2 -from google.cloud.gapic.videointelligence.v1beta1 import video_intelligence_service_client -from google.cloud.proto.videointelligence.v1beta1 import video_intelligence_pb2 +from google.cloud import videointelligence_v1beta1 +from google.cloud.videointelligence_v1beta1.proto import video_intelligence_pb2 from google.longrunning import operations_pb2 @@ -35,15 +35,16 @@ def test_annotate_video(self, mock_create_stub): grpc_stub = mock.Mock() mock_create_stub.return_value = grpc_stub - client = video_intelligence_service_client.VideoIntelligenceServiceClient( - ) + client = videointelligence_v1beta1.VideoIntelligenceServiceClient() # Mock request input_uri = 'inputUri1707300727' features = [] # Mock response - expected_response = video_intelligence_pb2.AnnotateVideoResponse() + 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) @@ -69,8 +70,7 @@ def test_annotate_video_exception(self, mock_create_stub): grpc_stub = mock.Mock() mock_create_stub.return_value = grpc_stub - client = video_intelligence_service_client.VideoIntelligenceServiceClient( - ) + client = videointelligence_v1beta1.VideoIntelligenceServiceClient() # Mock request input_uri = 'inputUri1707300727'