diff --git a/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py b/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py index 7c17db73..1a1f60c4 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py @@ -193,8 +193,9 @@ async def create_phrase_set( on the ``request`` instance; if ``request`` is provided, this should not be set. phrase_set_id (:class:`str`): - The ID to use for the phrase set, which will become the - final component of the phrase set's resource name. + Required. The ID to use for the phrase set, which will + become the final component of the phrase set's resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. @@ -590,8 +591,9 @@ async def create_custom_class( on the ``request`` instance; if ``request`` is provided, this should not be set. custom_class_id (:class:`str`): - The ID to use for the custom class, which will become - the final component of the custom class' resource name. + Required. The ID to use for the custom class, which will + become the final component of the custom class' resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. diff --git a/google/cloud/speech_v1p1beta1/services/adaptation/client.py b/google/cloud/speech_v1p1beta1/services/adaptation/client.py index 72e7945d..5b70526d 100644 --- a/google/cloud/speech_v1p1beta1/services/adaptation/client.py +++ b/google/cloud/speech_v1p1beta1/services/adaptation/client.py @@ -400,8 +400,9 @@ def create_phrase_set( on the ``request`` instance; if ``request`` is provided, this should not be set. phrase_set_id (str): - The ID to use for the phrase set, which will become the - final component of the phrase set's resource name. + Required. The ID to use for the phrase set, which will + become the final component of the phrase set's resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. @@ -797,8 +798,9 @@ def create_custom_class( on the ``request`` instance; if ``request`` is provided, this should not be set. custom_class_id (str): - The ID to use for the custom class, which will become - the final component of the custom class' resource name. + Required. The ID to use for the custom class, which will + become the final component of the custom class' resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. diff --git a/google/cloud/speech_v1p1beta1/services/speech/async_client.py b/google/cloud/speech_v1p1beta1/services/speech/async_client.py index 2a463476..2ee05a77 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/async_client.py +++ b/google/cloud/speech_v1p1beta1/services/speech/async_client.py @@ -38,6 +38,7 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore from google.cloud.speech_v1p1beta1.types import cloud_speech +from google.protobuf import duration_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore from .transports.base import SpeechTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import SpeechGrpcAsyncIOTransport diff --git a/google/cloud/speech_v1p1beta1/services/speech/client.py b/google/cloud/speech_v1p1beta1/services/speech/client.py index 7d95d47a..cd50d07a 100644 --- a/google/cloud/speech_v1p1beta1/services/speech/client.py +++ b/google/cloud/speech_v1p1beta1/services/speech/client.py @@ -43,6 +43,7 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore from google.cloud.speech_v1p1beta1.types import cloud_speech +from google.protobuf import duration_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore from .transports.base import SpeechTransport, DEFAULT_CLIENT_INFO from .transports.grpc import SpeechGrpcTransport diff --git a/google/cloud/speech_v1p1beta1/types/cloud_speech.py b/google/cloud/speech_v1p1beta1/types/cloud_speech.py index 1bf91ab6..ee343023 100644 --- a/google/cloud/speech_v1p1beta1/types/cloud_speech.py +++ b/google/cloud/speech_v1p1beta1/types/cloud_speech.py @@ -647,11 +647,17 @@ class RecognizeResponse(proto.Message): results (Sequence[google.cloud.speech_v1p1beta1.types.SpeechRecognitionResult]): Sequential list of transcription results corresponding to sequential portions of audio. + total_billed_time (google.protobuf.duration_pb2.Duration): + When available, billed audio seconds for the + corresponding request. """ results = proto.RepeatedField( proto.MESSAGE, number=2, message="SpeechRecognitionResult", ) + total_billed_time = proto.Field( + proto.MESSAGE, number=3, message=duration_pb2.Duration, + ) class LongRunningRecognizeResponse(proto.Message): @@ -666,6 +672,9 @@ class LongRunningRecognizeResponse(proto.Message): results (Sequence[google.cloud.speech_v1p1beta1.types.SpeechRecognitionResult]): Sequential list of transcription results corresponding to sequential portions of audio. + total_billed_time (google.protobuf.duration_pb2.Duration): + When available, billed audio seconds for the + corresponding request. output_config (google.cloud.speech_v1p1beta1.types.TranscriptOutputConfig): Original output config if present in the request. @@ -677,6 +686,9 @@ class LongRunningRecognizeResponse(proto.Message): results = proto.RepeatedField( proto.MESSAGE, number=2, message="SpeechRecognitionResult", ) + total_billed_time = proto.Field( + proto.MESSAGE, number=3, message=duration_pb2.Duration, + ) output_config = proto.Field( proto.MESSAGE, number=6, message="TranscriptOutputConfig", ) @@ -785,6 +797,10 @@ class StreamingRecognizeResponse(proto.Message): ``is_final=false`` results (the interim results). speech_event_type (google.cloud.speech_v1p1beta1.types.StreamingRecognizeResponse.SpeechEventType): Indicates the type of speech event. + total_billed_time (google.protobuf.duration_pb2.Duration): + When available, billed audio seconds for the + stream. Set only if this is the last response in + the stream. """ class SpeechEventType(proto.Enum): @@ -797,6 +813,9 @@ class SpeechEventType(proto.Enum): proto.MESSAGE, number=2, message="StreamingRecognitionResult", ) speech_event_type = proto.Field(proto.ENUM, number=4, enum=SpeechEventType,) + total_billed_time = proto.Field( + proto.MESSAGE, number=5, message=duration_pb2.Duration, + ) class StreamingRecognitionResult(proto.Message): diff --git a/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py b/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py index d9bd5ea8..578fc0bb 100644 --- a/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py +++ b/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py @@ -46,8 +46,9 @@ class CreatePhraseSetRequest(proto.Message): created. Format: {api_version}/projects/{project}/locations/{location}/phraseSets phrase_set_id (str): - The ID to use for the phrase set, which will become the - final component of the phrase set's resource name. + Required. The ID to use for the phrase set, which will + become the final component of the phrase set's resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. @@ -157,8 +158,9 @@ class CreateCustomClassRequest(proto.Message): be created. Format: {api_version}/projects/{project}/locations/{location}/customClasses custom_class_id (str): - The ID to use for the custom class, which will become the - final component of the custom class' resource name. + Required. The ID to use for the custom class, which will + become the final component of the custom class' resource + name. This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/. diff --git a/scripts/fixup_speech_v1p1beta1_keywords.py b/scripts/fixup_speech_v1p1beta1_keywords.py index 4701246e..745c5c1b 100644 --- a/scripts/fixup_speech_v1p1beta1_keywords.py +++ b/scripts/fixup_speech_v1p1beta1_keywords.py @@ -39,8 +39,8 @@ def partition( class speechCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'create_custom_class': ('parent', 'custom_class', 'custom_class_id', ), - 'create_phrase_set': ('parent', 'phrase_set', 'phrase_set_id', ), + 'create_custom_class': ('parent', 'custom_class_id', 'custom_class', ), + 'create_phrase_set': ('parent', 'phrase_set_id', 'phrase_set', ), 'delete_custom_class': ('name', ), 'delete_phrase_set': ('name', ), 'get_custom_class': ('name', ), diff --git a/tests/unit/gapic/speech_v1p1beta1/test_speech.py b/tests/unit/gapic/speech_v1p1beta1/test_speech.py index 0d16d470..37de474f 100644 --- a/tests/unit/gapic/speech_v1p1beta1/test_speech.py +++ b/tests/unit/gapic/speech_v1p1beta1/test_speech.py @@ -44,6 +44,7 @@ from google.cloud.speech_v1p1beta1.types import resource from google.longrunning import operations_pb2 from google.oauth2 import service_account +from google.protobuf import duration_pb2 # type: ignore from google.protobuf import wrappers_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore import google.auth