From f0cc36444044b971b43362915e7d8d0e9bef62bf Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 12:11:35 -0700 Subject: [PATCH] docs: add generated snippets (#273) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../async_client.py | 24 +++ .../video_intelligence_service/client.py | 25 +++ .../async_client.py | 24 +++ .../video_intelligence_service/client.py | 25 +++ .../async_client.py | 24 +++ .../video_intelligence_service/client.py | 25 +++ .../async_client.py | 24 +++ .../video_intelligence_service/client.py | 25 +++ .../async_client.py | 30 +++ .../client.py | 31 +++ .../async_client.py | 24 +++ .../video_intelligence_service/client.py | 25 +++ ...snippet_metadata_videointelligence_v1.json | 93 +++++++++ ...et_metadata_videointelligence_v1beta2.json | 93 +++++++++ ..._metadata_videointelligence_v1p1beta1.json | 93 +++++++++ ..._metadata_videointelligence_v1p2beta1.json | 93 +++++++++ ..._metadata_videointelligence_v1p3beta1.json | 182 ++++++++++++++++++ ...telligence_service_annotate_video_async.py | 49 +++++ ...ntelligence_service_annotate_video_sync.py | 49 +++++ ...telligence_service_annotate_video_async.py | 49 +++++ ...ntelligence_service_annotate_video_sync.py | 49 +++++ ...telligence_service_annotate_video_async.py | 49 +++++ ...ntelligence_service_annotate_video_sync.py | 49 +++++ ...telligence_service_annotate_video_async.py | 49 +++++ ...ntelligence_service_annotate_video_sync.py | 49 +++++ ..._service_streaming_annotate_video_async.py | 55 ++++++ ...e_service_streaming_annotate_video_sync.py | 55 ++++++ ...telligence_service_annotate_video_async.py | 49 +++++ ...ntelligence_service_annotate_video_sync.py | 49 +++++ 29 files changed, 1460 insertions(+) create mode 100644 samples/generated_samples/snippet_metadata_videointelligence_v1.json create mode 100644 samples/generated_samples/snippet_metadata_videointelligence_v1beta2.json create mode 100644 samples/generated_samples/snippet_metadata_videointelligence_v1p1beta1.json create mode 100644 samples/generated_samples/snippet_metadata_videointelligence_v1p2beta1.json create mode 100644 samples/generated_samples/snippet_metadata_videointelligence_v1p3beta1.json create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_sync.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_sync.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_sync.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_sync.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_sync.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_async.py create mode 100644 samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_sync.py diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py index d0327238..dfb6d5de 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/async_client.py @@ -222,6 +222,30 @@ async def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + .. code-block:: + + from google.cloud import videointelligence_v1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py index 021bdade..c338d6d1 100644 --- a/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1/services/video_intelligence_service/client.py @@ -402,6 +402,31 @@ def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + + .. code-block:: + + from google.cloud import videointelligence_v1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py index ce07f17d..e38d99f8 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/async_client.py @@ -222,6 +222,30 @@ async def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + .. code-block:: + + from google.cloud import videointelligence_v1beta2 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1beta2.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1beta2.AnnotateVideoRequest( + features="FACE_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1beta2.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py index 6d2cfabf..1531fa7e 100644 --- a/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1beta2/services/video_intelligence_service/client.py @@ -402,6 +402,31 @@ def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + + .. code-block:: + + from google.cloud import videointelligence_v1beta2 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1beta2.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1beta2.AnnotateVideoRequest( + features="FACE_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1beta2.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py index fc65bbf3..fed45772 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/async_client.py @@ -222,6 +222,30 @@ async def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + .. code-block:: + + from google.cloud import videointelligence_v1p1beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p1beta1.AnnotateVideoRequest( + features="SPEECH_TRANSCRIPTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p1beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py index 949281bd..983699e5 100644 --- a/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p1beta1/services/video_intelligence_service/client.py @@ -402,6 +402,31 @@ def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + + .. code-block:: + + from google.cloud import videointelligence_v1p1beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p1beta1.AnnotateVideoRequest( + features="SPEECH_TRANSCRIPTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p1beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py index 20cc2191..e9d923d5 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/async_client.py @@ -222,6 +222,30 @@ async def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + .. code-block:: + + from google.cloud import videointelligence_v1p2beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p2beta1.AnnotateVideoRequest( + features="OBJECT_TRACKING", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p2beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py index 04e6a1d3..c6d271f4 100644 --- a/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p2beta1/services/video_intelligence_service/client.py @@ -402,6 +402,31 @@ def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + + .. code-block:: + + from google.cloud import videointelligence_v1p2beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p2beta1.AnnotateVideoRequest( + features="OBJECT_TRACKING", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p2beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py index 84c6454b..6182f100 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/async_client.py @@ -241,6 +241,36 @@ def streaming_annotate_video( bytes. This method is only available via the gRPC API (not REST). + + .. code-block:: + + from google.cloud import videointelligence_v1p3beta1 + + def sample_streaming_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.StreamingAnnotateVideoRequest( + ) + + # This method expects an iterator which contains + # 'videointelligence_v1p3beta1.StreamingAnnotateVideoRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.streaming_annotate_video(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + Args: requests (AsyncIterator[`google.cloud.videointelligence_v1p3beta1.types.StreamingAnnotateVideoRequest`]): The request object AsyncIterator. The top-level message sent by the diff --git a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py index f061a371..2ad4ed18 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/streaming_video_intelligence_service/client.py @@ -407,6 +407,37 @@ def streaming_annotate_video( bytes. This method is only available via the gRPC API (not REST). + + + .. code-block:: + + from google.cloud import videointelligence_v1p3beta1 + + def sample_streaming_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.StreamingAnnotateVideoRequest( + ) + + # This method expects an iterator which contains + # 'videointelligence_v1p3beta1.StreamingAnnotateVideoRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.streaming_annotate_video(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + Args: requests (Iterator[google.cloud.videointelligence_v1p3beta1.types.StreamingAnnotateVideoRequest]): The request object iterator. The top-level message sent by the diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py index 753d39b2..79c078eb 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/async_client.py @@ -222,6 +222,30 @@ async def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + .. code-block:: + + from google.cloud import videointelligence_v1p3beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p3beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py index c9638eb5..29d4408a 100644 --- a/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py +++ b/google/cloud/videointelligence_v1p3beta1/services/video_intelligence_service/client.py @@ -402,6 +402,31 @@ def annotate_video( ``AnnotateVideoProgress`` (progress). ``Operation.response`` contains ``AnnotateVideoResponse`` (results). + + + .. code-block:: + + from google.cloud import videointelligence_v1p3beta1 + + def sample_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.videointelligence_v1p3beta1.types.AnnotateVideoRequest, dict]): The request object. Video annotation request. diff --git a/samples/generated_samples/snippet_metadata_videointelligence_v1.json b/samples/generated_samples/snippet_metadata_videointelligence_v1.json new file mode 100644 index 00000000..92ae355d --- /dev/null +++ b/samples/generated_samples/snippet_metadata_videointelligence_v1.json @@ -0,0 +1,93 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_videointelligence_v1beta2.json b/samples/generated_samples/snippet_metadata_videointelligence_v1beta2.json new file mode 100644 index 00000000..560c66b2 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_videointelligence_v1beta2.json @@ -0,0 +1,93 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_videointelligence_v1p1beta1.json b/samples/generated_samples/snippet_metadata_videointelligence_v1p1beta1.json new file mode 100644 index 00000000..3ffe80fe --- /dev/null +++ b/samples/generated_samples/snippet_metadata_videointelligence_v1p1beta1.json @@ -0,0 +1,93 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_videointelligence_v1p2beta1.json b/samples/generated_samples/snippet_metadata_videointelligence_v1p2beta1.json new file mode 100644 index 00000000..9ca02ab0 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_videointelligence_v1p2beta1.json @@ -0,0 +1,93 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_videointelligence_v1p3beta1.json b/samples/generated_samples/snippet_metadata_videointelligence_v1p3beta1.json new file mode 100644 index 00000000..79681c15 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_videointelligence_v1p3beta1.json @@ -0,0 +1,182 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "StreamingVideoIntelligenceService" + }, + "shortName": "StreamingAnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "StreamingVideoIntelligenceService" + }, + "shortName": "StreamingAnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_async.py", + "regionTag": "videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "VideoIntelligenceService" + }, + "shortName": "AnnotateVideo" + } + }, + "file": "videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_sync.py", + "regionTag": "videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_async.py new file mode 100644 index 00000000..1af0a955 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_async.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_async] +from google.cloud import videointelligence_v1 + + +async def sample_annotate_video(): + # Create a client + client = videointelligence_v1.VideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_sync.py new file mode 100644 index 00000000..2abf2e6c --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1_video_intelligence_service_annotate_video_sync.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_sync] +from google.cloud import videointelligence_v1 + + +def sample_annotate_video(): + # Create a client + client = videointelligence_v1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_async.py new file mode 100644 index 00000000..a21a6113 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_async.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_async] +from google.cloud import videointelligence_v1beta2 + + +async def sample_annotate_video(): + # Create a client + client = videointelligence_v1beta2.VideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1beta2.AnnotateVideoRequest( + features="FACE_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_sync.py new file mode 100644 index 00000000..e6321f67 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1beta2_video_intelligence_service_annotate_video_sync.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_sync] +from google.cloud import videointelligence_v1beta2 + + +def sample_annotate_video(): + # Create a client + client = videointelligence_v1beta2.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1beta2.AnnotateVideoRequest( + features="FACE_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1beta2_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_async.py new file mode 100644 index 00000000..df6de4fb --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_async.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_async] +from google.cloud import videointelligence_v1p1beta1 + + +async def sample_annotate_video(): + # Create a client + client = videointelligence_v1p1beta1.VideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1p1beta1.AnnotateVideoRequest( + features="SPEECH_TRANSCRIPTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_sync.py new file mode 100644 index 00000000..2763a426 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p1beta1_video_intelligence_service_annotate_video_sync.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_sync] +from google.cloud import videointelligence_v1p1beta1 + + +def sample_annotate_video(): + # Create a client + client = videointelligence_v1p1beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p1beta1.AnnotateVideoRequest( + features="SPEECH_TRANSCRIPTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p1beta1_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_async.py new file mode 100644 index 00000000..80e1e147 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_async.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_async] +from google.cloud import videointelligence_v1p2beta1 + + +async def sample_annotate_video(): + # Create a client + client = videointelligence_v1p2beta1.VideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1p2beta1.AnnotateVideoRequest( + features="OBJECT_TRACKING", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_sync.py new file mode 100644 index 00000000..2a2cd01b --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p2beta1_video_intelligence_service_annotate_video_sync.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_sync] +from google.cloud import videointelligence_v1p2beta1 + + +def sample_annotate_video(): + # Create a client + client = videointelligence_v1p2beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p2beta1.AnnotateVideoRequest( + features="OBJECT_TRACKING", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p2beta1_VideoIntelligenceService_AnnotateVideo_sync] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_async.py new file mode 100644 index 00000000..d60e5eb2 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_async.py @@ -0,0 +1,55 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingAnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async] +from google.cloud import videointelligence_v1p3beta1 + + +async def sample_streaming_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.StreamingAnnotateVideoRequest( + ) + + # This method expects an iterator which contains + # 'videointelligence_v1p3beta1.StreamingAnnotateVideoRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = await client.streaming_annotate_video(requests=request_generator()) + + # Handle the response + async for response in stream: + print(response) + +# [END videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_sync.py new file mode 100644 index 00000000..790f0ac7 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_streaming_video_intelligence_service_streaming_annotate_video_sync.py @@ -0,0 +1,55 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingAnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_sync] +from google.cloud import videointelligence_v1p3beta1 + + +def sample_streaming_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.StreamingVideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.StreamingAnnotateVideoRequest( + ) + + # This method expects an iterator which contains + # 'videointelligence_v1p3beta1.StreamingAnnotateVideoRequest' objects + # Here we create a generator that yields a single `request` for + # demonstrative purposes. + requests = [request] + + def request_generator(): + for request in requests: + yield request + + # Make the request + stream = client.streaming_annotate_video(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + +# [END videointelligence_generated_videointelligence_v1p3beta1_StreamingVideoIntelligenceService_StreamingAnnotateVideo_sync] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_async.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_async.py new file mode 100644 index 00000000..142a8999 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_async.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_async] +from google.cloud import videointelligence_v1p3beta1 + + +async def sample_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.VideoIntelligenceServiceAsyncClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_async] diff --git a/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_sync.py b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_sync.py new file mode 100644 index 00000000..c4c4e2a9 --- /dev/null +++ b/samples/generated_samples/videointelligence_generated_videointelligence_v1p3beta1_video_intelligence_service_annotate_video_sync.py @@ -0,0 +1,49 @@ +# -*- 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 +# +# 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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AnnotateVideo +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-videointelligence + + +# [START videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_sync] +from google.cloud import videointelligence_v1p3beta1 + + +def sample_annotate_video(): + # Create a client + client = videointelligence_v1p3beta1.VideoIntelligenceServiceClient() + + # Initialize request argument(s) + request = videointelligence_v1p3beta1.AnnotateVideoRequest( + features="PERSON_DETECTION", + ) + + # Make the request + operation = client.annotate_video(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END videointelligence_generated_videointelligence_v1p3beta1_VideoIntelligenceService_AnnotateVideo_sync]