Skip to content
This repository was archived by the owner on Apr 20, 2024. It is now read-only.

Commit 2e7ee2d

Browse files
docs: fix the resource name format in comment for CreatePhraseSetRequest (#509)
* feat: Add support for BatchRecognize Deprecate the `update_config_request` field in the `OperationMetadata` message, which was never used and is output only. PiperOrigin-RevId: 517976288 Source-Link: googleapis/googleapis@7ee7867 Source-Link: https://github.com/googleapis/googleapis-gen/commit/04050e15e7a409f9d421f63dbfdf37eac72a3c14 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMDQwNTBlMTVlN2E0MDlmOWQ0MjFmNjNkYmZkZjM3ZWFjNzJhM2MxNCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: fix the resource name format in comment for CreatePhraseSetRequest PiperOrigin-RevId: 518025142 Source-Link: googleapis/googleapis@e354eef Source-Link: https://github.com/googleapis/googleapis-gen/commit/f3e26850eb545f37e41a3da71426d13202eae013 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZjNlMjY4NTBlYjU0NWYzN2U0MWEzZGE3MTQyNmQxMzIwMmVhZTAxMyJ9 * 🦉 Updates from OwlBot post-processor 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>
1 parent e67e496 commit 2e7ee2d

File tree

20 files changed

+1151
-64
lines changed

20 files changed

+1151
-64
lines changed

google/cloud/speech_v1/services/adaptation/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async def sample_create_phrase_set():
265265
Required. The parent resource where this phrase set will
266266
be created. Format:
267267
268-
``projects/{project}/locations/{location}/phraseSets``
268+
``projects/{project}/locations/{location}``
269269
270270
Speech-to-Text supports three locations: ``global``,
271271
``us`` (US North America), and ``eu`` (Europe). If you

google/cloud/speech_v1/services/adaptation/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def sample_create_phrase_set():
518518
Required. The parent resource where this phrase set will
519519
be created. Format:
520520
521-
``projects/{project}/locations/{location}/phraseSets``
521+
``projects/{project}/locations/{location}``
522522
523523
Speech-to-Text supports three locations: ``global``,
524524
``us`` (US North America), and ``eu`` (Europe). If you

google/cloud/speech_v1/types/cloud_speech_adaptation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CreatePhraseSetRequest(proto.Message):
5050
Required. The parent resource where this phrase set will be
5151
created. Format:
5252
53-
``projects/{project}/locations/{location}/phraseSets``
53+
``projects/{project}/locations/{location}``
5454
5555
Speech-to-Text supports three locations: ``global``, ``us``
5656
(US North America), and ``eu`` (Europe). If you are calling

google/cloud/speech_v1p1beta1/services/adaptation/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ async def sample_create_phrase_set():
265265
Required. The parent resource where this phrase set will
266266
be created. Format:
267267
268-
``projects/{project}/locations/{location}/phraseSets``
268+
``projects/{project}/locations/{location}``
269269
270270
Speech-to-Text supports three locations: ``global``,
271271
``us`` (US North America), and ``eu`` (Europe). If you

google/cloud/speech_v1p1beta1/services/adaptation/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def sample_create_phrase_set():
518518
Required. The parent resource where this phrase set will
519519
be created. Format:
520520
521-
``projects/{project}/locations/{location}/phraseSets``
521+
``projects/{project}/locations/{location}``
522522
523523
Speech-to-Text supports three locations: ``global``,
524524
``us`` (US North America), and ``eu`` (Europe). If you

google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CreatePhraseSetRequest(proto.Message):
5050
Required. The parent resource where this phrase set will be
5151
created. Format:
5252
53-
``projects/{project}/locations/{location}/phraseSets``
53+
``projects/{project}/locations/{location}``
5454
5555
Speech-to-Text supports three locations: ``global``, ``us``
5656
(US North America), and ``eu`` (Europe). If you are calling

google/cloud/speech_v2/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from .types.cloud_speech import BatchRecognizeMetadata
2828
from .types.cloud_speech import BatchRecognizeRequest
2929
from .types.cloud_speech import BatchRecognizeResponse
30+
from .types.cloud_speech import BatchRecognizeResults
3031
from .types.cloud_speech import BatchRecognizeTranscriptionMetadata
3132
from .types.cloud_speech import Config
3233
from .types.cloud_speech import CreateCustomClassRequest
@@ -37,10 +38,12 @@
3738
from .types.cloud_speech import DeletePhraseSetRequest
3839
from .types.cloud_speech import DeleteRecognizerRequest
3940
from .types.cloud_speech import ExplicitDecodingConfig
41+
from .types.cloud_speech import GcsOutputConfig
4042
from .types.cloud_speech import GetConfigRequest
4143
from .types.cloud_speech import GetCustomClassRequest
4244
from .types.cloud_speech import GetPhraseSetRequest
4345
from .types.cloud_speech import GetRecognizerRequest
46+
from .types.cloud_speech import InlineOutputConfig
4447
from .types.cloud_speech import ListCustomClassesRequest
4548
from .types.cloud_speech import ListCustomClassesResponse
4649
from .types.cloud_speech import ListPhraseSetsRequest
@@ -51,6 +54,7 @@
5154
from .types.cloud_speech import PhraseSet
5255
from .types.cloud_speech import RecognitionConfig
5356
from .types.cloud_speech import RecognitionFeatures
57+
from .types.cloud_speech import RecognitionOutputConfig
5458
from .types.cloud_speech import RecognitionResponseMetadata
5559
from .types.cloud_speech import Recognizer
5660
from .types.cloud_speech import RecognizeRequest
@@ -81,6 +85,7 @@
8185
"BatchRecognizeMetadata",
8286
"BatchRecognizeRequest",
8387
"BatchRecognizeResponse",
88+
"BatchRecognizeResults",
8489
"BatchRecognizeTranscriptionMetadata",
8590
"Config",
8691
"CreateCustomClassRequest",
@@ -91,10 +96,12 @@
9196
"DeletePhraseSetRequest",
9297
"DeleteRecognizerRequest",
9398
"ExplicitDecodingConfig",
99+
"GcsOutputConfig",
94100
"GetConfigRequest",
95101
"GetCustomClassRequest",
96102
"GetPhraseSetRequest",
97103
"GetRecognizerRequest",
104+
"InlineOutputConfig",
98105
"ListCustomClassesRequest",
99106
"ListCustomClassesResponse",
100107
"ListPhraseSetsRequest",
@@ -105,6 +112,7 @@
105112
"PhraseSet",
106113
"RecognitionConfig",
107114
"RecognitionFeatures",
115+
"RecognitionOutputConfig",
108116
"RecognitionResponseMetadata",
109117
"RecognizeRequest",
110118
"RecognizeResponse",

google/cloud/speech_v2/services/speech/async_client.py

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747

4848
from google.api_core import operation # type: ignore
4949
from google.api_core import operation_async # type: ignore
50+
from google.cloud.location import locations_pb2 # type: ignore
5051
from google.cloud.speech_v2.services.speech import pagers
5152
from google.cloud.speech_v2.types import cloud_speech
5253
from google.longrunning import operations_pb2
@@ -500,7 +501,7 @@ async def get_recognizer(
500501
r"""Returns the requested
501502
[Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
502503
[NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
503-
recognizer doesn't exist.
504+
Recognizer doesn't exist.
504505
505506
.. code-block:: python
506507
@@ -1405,7 +1406,8 @@ async def sample_batch_recognize():
14051406
should not be set.
14061407
files (:class:`MutableSequence[google.cloud.speech_v2.types.BatchRecognizeFileMetadata]`):
14071408
Audio files with file metadata for
1408-
ASR.
1409+
ASR. The maximum number of files allowed
1410+
to be specified is 5.
14091411
14101412
This corresponds to the ``files`` field
14111413
on the ``request`` instance; if ``request`` is provided, this
@@ -3401,6 +3403,114 @@ async def cancel_operation(
34013403
metadata=metadata,
34023404
)
34033405

3406+
async def get_location(
3407+
self,
3408+
request: Optional[locations_pb2.GetLocationRequest] = None,
3409+
*,
3410+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3411+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3412+
metadata: Sequence[Tuple[str, str]] = (),
3413+
) -> locations_pb2.Location:
3414+
r"""Gets information about a location.
3415+
3416+
Args:
3417+
request (:class:`~.location_pb2.GetLocationRequest`):
3418+
The request object. Request message for
3419+
`GetLocation` method.
3420+
retry (google.api_core.retry.Retry): Designation of what errors,
3421+
if any, should be retried.
3422+
timeout (float): The timeout for this request.
3423+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3424+
sent along with the request as metadata.
3425+
Returns:
3426+
~.location_pb2.Location:
3427+
Location object.
3428+
"""
3429+
# Create or coerce a protobuf request object.
3430+
# The request isn't a proto-plus wrapped type,
3431+
# so it must be constructed via keyword expansion.
3432+
if isinstance(request, dict):
3433+
request = locations_pb2.GetLocationRequest(**request)
3434+
3435+
# Wrap the RPC method; this adds retry and timeout information,
3436+
# and friendly error handling.
3437+
rpc = gapic_v1.method.wrap_method(
3438+
self._client._transport.get_location,
3439+
default_timeout=None,
3440+
client_info=DEFAULT_CLIENT_INFO,
3441+
)
3442+
3443+
# Certain fields should be provided within the metadata header;
3444+
# add these here.
3445+
metadata = tuple(metadata) + (
3446+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3447+
)
3448+
3449+
# Send the request.
3450+
response = await rpc(
3451+
request,
3452+
retry=retry,
3453+
timeout=timeout,
3454+
metadata=metadata,
3455+
)
3456+
3457+
# Done; return the response.
3458+
return response
3459+
3460+
async def list_locations(
3461+
self,
3462+
request: Optional[locations_pb2.ListLocationsRequest] = None,
3463+
*,
3464+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3465+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3466+
metadata: Sequence[Tuple[str, str]] = (),
3467+
) -> locations_pb2.ListLocationsResponse:
3468+
r"""Lists information about the supported locations for this service.
3469+
3470+
Args:
3471+
request (:class:`~.location_pb2.ListLocationsRequest`):
3472+
The request object. Request message for
3473+
`ListLocations` method.
3474+
retry (google.api_core.retry.Retry): Designation of what errors,
3475+
if any, should be retried.
3476+
timeout (float): The timeout for this request.
3477+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3478+
sent along with the request as metadata.
3479+
Returns:
3480+
~.location_pb2.ListLocationsResponse:
3481+
Response message for ``ListLocations`` method.
3482+
"""
3483+
# Create or coerce a protobuf request object.
3484+
# The request isn't a proto-plus wrapped type,
3485+
# so it must be constructed via keyword expansion.
3486+
if isinstance(request, dict):
3487+
request = locations_pb2.ListLocationsRequest(**request)
3488+
3489+
# Wrap the RPC method; this adds retry and timeout information,
3490+
# and friendly error handling.
3491+
rpc = gapic_v1.method.wrap_method(
3492+
self._client._transport.list_locations,
3493+
default_timeout=None,
3494+
client_info=DEFAULT_CLIENT_INFO,
3495+
)
3496+
3497+
# Certain fields should be provided within the metadata header;
3498+
# add these here.
3499+
metadata = tuple(metadata) + (
3500+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3501+
)
3502+
3503+
# Send the request.
3504+
response = await rpc(
3505+
request,
3506+
retry=retry,
3507+
timeout=timeout,
3508+
metadata=metadata,
3509+
)
3510+
3511+
# Done; return the response.
3512+
return response
3513+
34043514
async def __aenter__(self):
34053515
return self
34063516

google/cloud/speech_v2/services/speech/client.py

Lines changed: 112 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
from google.api_core import operation # type: ignore
5252
from google.api_core import operation_async # type: ignore
53+
from google.cloud.location import locations_pb2 # type: ignore
5354
from google.cloud.speech_v2.services.speech import pagers
5455
from google.cloud.speech_v2.types import cloud_speech
5556
from google.longrunning import operations_pb2
@@ -839,7 +840,7 @@ def get_recognizer(
839840
r"""Returns the requested
840841
[Recognizer][google.cloud.speech.v2.Recognizer]. Fails with
841842
[NOT_FOUND][google.rpc.Code.NOT_FOUND] if the requested
842-
recognizer doesn't exist.
843+
Recognizer doesn't exist.
843844
844845
.. code-block:: python
845846
@@ -1738,7 +1739,8 @@ def sample_batch_recognize():
17381739
should not be set.
17391740
files (MutableSequence[google.cloud.speech_v2.types.BatchRecognizeFileMetadata]):
17401741
Audio files with file metadata for
1741-
ASR.
1742+
ASR. The maximum number of files allowed
1743+
to be specified is 5.
17421744
17431745
This corresponds to the ``files`` field
17441746
on the ``request`` instance; if ``request`` is provided, this
@@ -3747,6 +3749,114 @@ def cancel_operation(
37473749
metadata=metadata,
37483750
)
37493751

3752+
def get_location(
3753+
self,
3754+
request: Optional[locations_pb2.GetLocationRequest] = None,
3755+
*,
3756+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3757+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3758+
metadata: Sequence[Tuple[str, str]] = (),
3759+
) -> locations_pb2.Location:
3760+
r"""Gets information about a location.
3761+
3762+
Args:
3763+
request (:class:`~.location_pb2.GetLocationRequest`):
3764+
The request object. Request message for
3765+
`GetLocation` method.
3766+
retry (google.api_core.retry.Retry): Designation of what errors,
3767+
if any, should be retried.
3768+
timeout (float): The timeout for this request.
3769+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3770+
sent along with the request as metadata.
3771+
Returns:
3772+
~.location_pb2.Location:
3773+
Location object.
3774+
"""
3775+
# Create or coerce a protobuf request object.
3776+
# The request isn't a proto-plus wrapped type,
3777+
# so it must be constructed via keyword expansion.
3778+
if isinstance(request, dict):
3779+
request = locations_pb2.GetLocationRequest(**request)
3780+
3781+
# Wrap the RPC method; this adds retry and timeout information,
3782+
# and friendly error handling.
3783+
rpc = gapic_v1.method.wrap_method(
3784+
self._transport.get_location,
3785+
default_timeout=None,
3786+
client_info=DEFAULT_CLIENT_INFO,
3787+
)
3788+
3789+
# Certain fields should be provided within the metadata header;
3790+
# add these here.
3791+
metadata = tuple(metadata) + (
3792+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3793+
)
3794+
3795+
# Send the request.
3796+
response = rpc(
3797+
request,
3798+
retry=retry,
3799+
timeout=timeout,
3800+
metadata=metadata,
3801+
)
3802+
3803+
# Done; return the response.
3804+
return response
3805+
3806+
def list_locations(
3807+
self,
3808+
request: Optional[locations_pb2.ListLocationsRequest] = None,
3809+
*,
3810+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
3811+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3812+
metadata: Sequence[Tuple[str, str]] = (),
3813+
) -> locations_pb2.ListLocationsResponse:
3814+
r"""Lists information about the supported locations for this service.
3815+
3816+
Args:
3817+
request (:class:`~.location_pb2.ListLocationsRequest`):
3818+
The request object. Request message for
3819+
`ListLocations` method.
3820+
retry (google.api_core.retry.Retry): Designation of what errors,
3821+
if any, should be retried.
3822+
timeout (float): The timeout for this request.
3823+
metadata (Sequence[Tuple[str, str]]): Strings which should be
3824+
sent along with the request as metadata.
3825+
Returns:
3826+
~.location_pb2.ListLocationsResponse:
3827+
Response message for ``ListLocations`` method.
3828+
"""
3829+
# Create or coerce a protobuf request object.
3830+
# The request isn't a proto-plus wrapped type,
3831+
# so it must be constructed via keyword expansion.
3832+
if isinstance(request, dict):
3833+
request = locations_pb2.ListLocationsRequest(**request)
3834+
3835+
# Wrap the RPC method; this adds retry and timeout information,
3836+
# and friendly error handling.
3837+
rpc = gapic_v1.method.wrap_method(
3838+
self._transport.list_locations,
3839+
default_timeout=None,
3840+
client_info=DEFAULT_CLIENT_INFO,
3841+
)
3842+
3843+
# Certain fields should be provided within the metadata header;
3844+
# add these here.
3845+
metadata = tuple(metadata) + (
3846+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
3847+
)
3848+
3849+
# Send the request.
3850+
response = rpc(
3851+
request,
3852+
retry=retry,
3853+
timeout=timeout,
3854+
metadata=metadata,
3855+
)
3856+
3857+
# Done; return the response.
3858+
return response
3859+
37503860

37513861
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
37523862
gapic_version=package_version.__version__

0 commit comments

Comments
 (0)