8000 feat(v1p1beta1): add total_billed_time response field (#219) · googleapis/google-cloud-python@b570406 · GitHub
[go: up one dir, main page]

Skip to content

Commit b570406

Browse files
feat(v1p1beta1): add total_billed_time response field (#219)
Committer: @cherba PiperOrigin-RevId: 387131819 Source-Link: googleapis/googleapis@4fca877 Source-Link: googleapis/googleapis-gen@66600ac fix(v1p1beta1): phrase_set_id is required field in CreatePhraseSetRequest fix(v1p1beta1): custom_class_id is required field in CreateCustomClassRequest.
1 parent cfa96a7 commit b570406

File tree

8 files changed

+42
-14
lines changed

8 files changed

+42
-14
lines changed

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,9 @@ async def create_phrase_set(
193193
on the ``request`` instance; if ``request`` is provided, this
194194
should not be set.
195195
phrase_set_id (:class:`str`):
196-
The ID to use for the phrase set, which will become the
197-
final component of the phrase set's resource name.
196+
Required. The ID to use for the phrase set, which will
197+
become the final component of the phrase set's resource
198+
name.
198199
199200
This value should be 4-63 characters, and valid
200201
characters are /[a-z][0-9]-/.
@@ -590,8 +591,9 @@ async def create_custom_class(
590591
on the ``request`` instance; if ``request`` is provided, this
591592
should not be set.
592593
custom_class_id (:class:`str`):
593-
The ID to use for the custom class, which will become
594-
the final component of the custom class' resource name.
594+
Required. The ID to use for the custom class, which will
595+
become the final component of the custom class' resource
596+
name.
595597
596598
This value should be 4-63 characters, and valid
597599
characters are /[a-z][0-9]-/.

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,8 +400,9 @@ def create_phrase_set(
400400
on the ``request`` instance; if ``request`` is provided, this
401401
should not be set.
402402
phrase_set_id (str):
403-
The ID to use for the phrase set, which will become the
404-
final component of the phrase set's resource name.
403+
Required. The ID to use for the phrase set, which will
404+
become the final component of the phrase set's resource
405+
name.
405406
406407
This value should be 4-63 characters, and valid
407408
characters are /[a-z][0-9]-/.
@@ -797,8 +798,9 @@ def create_custom_class(
797798
on the ``request`` instance; if ``request`` is provided, this
798799
should not be set.
799800
custom_class_id (str):
800-
The ID to use for the custom class, which will become
801-
the final component of the custom class' resource name.
801+
Required. The ID to use for the custom class, which will
802+
become the final component of the custom class' resource
803+
name.
802804
803805
This value should be 4-63 characters, and valid
804806
characters are /[a-z][0-9]-/.

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/async_client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from google.api_core import operation # type: ignore
3939
from google.api_core import operation_async # type: ignore
4040
from google.cloud.speech_v1p1beta1.types import cloud_speech
41+
from google.protobuf import duration_pb2 # type: ignore
4142
from google.rpc import status_pb2 # type: ignore
4243
from .transports.base import SpeechTransport, DEFAULT_CLIENT_INFO
4344
from .transports.grpc_asyncio import SpeechGrpcAsyncIOTransport

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/client.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
from google.api_core import operation # type: ignore
4444
from google.api_core import operation_async # type: ignore
4545
from google.cloud.speech_v1p1beta1.types import cloud_speech
46+
from google.protobuf import duration_pb2 # type: ignore
4647
from google.rpc import status_pb2 # type: ignore
4748
from .transports.base import SpeechTransport, DEFAULT_CLIENT_INFO
4849
from .transports.grpc import SpeechGrpcTransport

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,11 +647,17 @@ class RecognizeResponse(proto.Message):
647647
results (Sequence[google.cloud.speech_v1p1beta1.types.SpeechRecognitionResult]):
648648
Sequential list of transcription results
649649
corresponding to sequential portions of audio.
650+
total_billed_time (google.protobuf.duration_pb2.Duration):
651+
When available, billed audio seconds for the
652+
corresponding request.
650653
"""
651654

652655
results = proto.RepeatedField(
653656
proto.MESSAGE, number=2, message="SpeechRecognitionResult",
654657
)
658+
total_billed_time = proto.Field(
659+
proto.MESSAGE, number=3, message=duration_pb2.Duration,
660+
)
655661

656662

657663
class LongRunningRecognizeResponse(proto.Message):
@@ -666,6 +672,9 @@ class LongRunningRecognizeResponse(proto.Message):
666672
results (Sequence[google.cloud.speech_v1p1beta1.types.SpeechRecognitionResult]):
667673
Sequential list of transcription results
668674
corresponding to sequential portions of audio.
675+
total_billed_time (google.protobuf.duration_pb2.Duration):
676+
When available, billed audio seconds for the
677+
corresponding request.
669678
output_config (google.cloud.speech_v1p1beta1.types.TranscriptOutputConfig):
670679
Original output config if present in the
671680
request.
@@ -677,6 +686,9 @@ class LongRunningRecognizeResponse(proto.Message):
677686
results = proto.RepeatedField(
678687
proto.MESSAGE, number=2, message="SpeechRecognitionResult",
679688
)
689+
total_billed_time = proto.Field(
690+
proto.MESSAGE, number=3, message=duration_pb2.Duration,
691+
)
680692
output_config = proto.Field(
681693
proto.MESSAGE, number=6, message="TranscriptOutputConfig",
682694
)
@@ -785,6 +797,10 @@ class StreamingRecognizeResponse(proto.Message):
785797
``is_final=false`` results (the interim results).
786798
speech_event_type (google.cloud.speech_v1p1beta1.types.StreamingRecognizeResponse.SpeechEventType):
787799
Indicates the type of speech event.
800+
total_billed_time (google.protobuf.duration_pb2.Duration):
801+
When available, billed audio seconds for the
802+
stream. Set only if this is the last response in
803+
the stream.
788804
"""
789805

790806
class SpeechEventType(proto.Enum):
@@ -797,6 +813,9 @@ class SpeechEventType(proto.Enum):
797813
proto.MESSAGE, number=2, message="StreamingRecognitionResult",
798814
)
799815
speech_event_type = proto.Field(proto.ENUM, number=4, enum=SpeechEventType,)
816+
total_billed_time = proto.Field(
817+
proto.MESSAGE, number=5, message=duration_pb2.Duration,
818+
)
800819

801820

802821
class StreamingRecognitionResult(proto.Message):

packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,9 @@ class CreatePhraseSetRequest(proto.Message):
4646
created. Format:
4747
{api_version}/projects/{project}/locations/{location}/phraseSets
4848
phrase_set_id (str):
49-
The ID to use for the phrase set, which will become the
50-
final component of the phrase set's resource name.
49+
Required. The ID to use for the phrase set, which will
50+
become the final component of the phrase set's resource
51+
name.
5152
5253
This value should be 4-63 characters, and valid characters
5354
are /[a-z][0-9]-/.
@@ -157,8 +158,9 @@ class CreateCustomClassRequest(proto.Message):
157158
be created. Format:
158159
{api_version}/projects/{project}/locations/{location}/customClasses
159160
custom_class_id (str):
160-
The ID to use for the custom class, which will become the
161-
final component of the custom class' resource name.
161+
Required. The ID to use for the custom class, which will
162+
become the final component of the custom class' resource
163+
name.
162164
163165
This value should be 4-63 characters, and valid characters
164166
are /[a-z][0-9]-/.

packages/google-cloud-python-speech/scripts/fixup_speech_v1p1beta1_keywords.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def partition(
3939
class speechCallTransformer(cst.CSTTransformer):
4040
CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata')
4141
METHOD_TO_PARAMS: Dict[str, Tuple[str]] = {
42-
'create_custom_class': ('parent', 'custom_class', 'custom_class_id', ),
43-
'create_phrase_set': ('parent', 'phrase_set', 'phrase_set_id', ),
42+
'create_custom_class': ('parent', 'custom_class_id', 'custom_class', ),
43+
'create_phrase_set': ('parent', 'phrase_set_id', 'phrase_set', ),
4444
'delete_custom_class': ('name', ),
4545
'delete_phrase_set': ('name', ),
4646
'get_custom_class': ('name', ),

packages/google-cloud-python-speech/tests/unit/gapic/speech_v1p1beta1/test_speech.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
from google.cloud.speech_v1p1beta1.types import resource
4545
from google.longrunning import operations_pb2
4646
from google.oauth2 import service_account
47+
from google.protobuf import duration_pb2 # type: ignore
4748
from google.protobuf import wrappers_pb2 # type: ignore
4849
from google.rpc import status_pb2 # type: ignore
4950
import google.auth

0 commit comments

Comments
 (0)
0