diff --git a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py index 7c17db7341d3..1a1f60c417a2 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/async_client.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py index 72e7945dcf77..5b70526ddb92 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/adaptation/client.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/async_client.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/async_client.py index 2a463476f35f..2ee05a776c17 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/async_client.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/client.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/client.py index 7d95d47a24c5..cd50d07a3e5e 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/services/speech/client.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech.py index 1bf91ab6a877..ee34302349bd 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py b/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py index d9bd5ea8606d..578fc0bbd656 100644 --- a/packages/google-cloud-python-speech/google/cloud/speech_v1p1beta1/types/cloud_speech_adaptation.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/scripts/fixup_speech_v1p1beta1_keywords.py b/packages/google-cloud-python-speech/scripts/fixup_speech_v1p1beta1_keywords.py index 4701246eedbd..745c5c1b23d1 100644 --- a/packages/google-cloud-python-speech/scripts/fixup_speech_v1p1beta1_keywords.py +++ b/packages/google-cloud-python-speech/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/packages/google-cloud-python-speech/tests/unit/gapic/speech_v1p1beta1/test_speech.py b/packages/google-cloud-python-speech/tests/unit/gapic/speech_v1p1beta1/test_speech.py index 0d16d470d3bb..37de474fed0b 100644 --- a/packages/google-cloud-python-speech/tests/unit/gapic/speech_v1p1beta1/test_speech.py +++ b/packages/google-cloud-python-speech/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