Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
docs: add generated snippets (#273)
Browse files Browse the repository at this point in the history
* chore: use gapic-generator-python 0.63.2
docs: add generated snippets

PiperOrigin-RevId: 427792504

Source-Link: googleapis/googleapis@55b9e1e

Source-Link: googleapis/googleapis-gen@bf4e86b
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 <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] committed Feb 11, 2022
1 parent aef5b0c commit f0cc364
Show file tree
Hide file tree
Showing 29 changed files with 1,460 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit f0cc364

Please sign in to comment.