diff --git a/speech/generated_samples/snippet_metadata_speech_v2.json b/speech/generated_samples/snippet_metadata_speech_v2.json new file mode 100644 index 000000000000..cd0f56ae8397 --- /dev/null +++ b/speech/generated_samples/snippet_metadata_speech_v2.json @@ -0,0 +1,3845 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.speech.v2", + "version": "v2" + } + ], + "language": "PYTHON", + "name": "google-cloud-speech" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.batch_recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "BatchRecognize" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.BatchRecognizeRequest" + }, + { + "name": "recognizer", + "type": "str" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.RecognitionConfig" + }, + { + "name": "config_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "files", + "type": "Sequence[google.cloud.speech_v2.types.BatchRecognizeFileMetadata]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "batch_recognize" + }, + "description": "Sample for BatchRecognize", + "file": "speech_v2_generated_speech_batch_recognize_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_BatchRecognize_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_batch_recognize_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.batch_recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.BatchRecognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "BatchRecognize" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.BatchRecognizeRequest" + }, + { + "name": "recognizer", + "type": "str" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.RecognitionConfig" + }, + { + "name": "config_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "files", + "type": "Sequence[google.cloud.speech_v2.types.BatchRecognizeFileMetadata]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "batch_recognize" + }, + "description": "Sample for BatchRecognize", + "file": "speech_v2_generated_speech_batch_recognize_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_BatchRecognize_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_batch_recognize_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.create_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreateCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreateCustomClassRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "custom_class", + "type": "google.cloud.speech_v2.types.CustomClass" + }, + { + "name": "custom_class_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_custom_class" + }, + "description": "Sample for CreateCustomClass", + "file": "speech_v2_generated_speech_create_custom_class_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreateCustomClass_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_custom_class_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.create_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreateCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreateCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreateCustomClassRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "custom_class", + "type": "google.cloud.speech_v2.types.CustomClass" + }, + { + "name": "custom_class_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_custom_class" + }, + "description": "Sample for CreateCustomClass", + "file": "speech_v2_generated_speech_create_custom_class_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreateCustomClass_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_custom_class_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.create_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreatePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreatePhraseSetRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "phrase_set", + "type": "google.cloud.speech_v2.types.PhraseSet" + }, + { + "name": "phrase_set_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_phrase_set" + }, + "description": "Sample for CreatePhraseSet", + "file": "speech_v2_generated_speech_create_phrase_set_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreatePhraseSet_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_phrase_set_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.create_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreatePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreatePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreatePhraseSetRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "phrase_set", + "type": "google.cloud.speech_v2.types.PhraseSet" + }, + { + "name": "phrase_set_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_phrase_set" + }, + "description": "Sample for CreatePhraseSet", + "file": "speech_v2_generated_speech_create_phrase_set_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreatePhraseSet_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_phrase_set_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.create_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreateRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreateRecognizerRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "recognizer", + "type": "google.cloud.speech_v2.types.Recognizer" + }, + { + "name": "recognizer_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_recognizer" + }, + "description": "Sample for CreateRecognizer", + "file": "speech_v2_generated_speech_create_recognizer_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreateRecognizer_async", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_recognizer_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.create_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.CreateRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "CreateRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.CreateRecognizerRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "recognizer", + "type": "google.cloud.speech_v2.types.Recognizer" + }, + { + "name": "recognizer_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_recognizer" + }, + "description": "Sample for CreateRecognizer", + "file": "speech_v2_generated_speech_create_recognizer_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_CreateRecognizer_sync", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_create_recognizer_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.delete_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeleteCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeleteCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_custom_class" + }, + "description": "Sample for DeleteCustomClass", + "file": "speech_v2_generated_speech_delete_custom_class_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeleteCustomClass_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_custom_class_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.delete_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeleteCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeleteCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeleteCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_custom_class" + }, + "description": "Sample for DeleteCustomClass", + "file": "speech_v2_generated_speech_delete_custom_class_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeleteCustomClass_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_custom_class_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.delete_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeletePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeletePhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_phrase_set" + }, + "description": "Sample for DeletePhraseSet", + "file": "speech_v2_generated_speech_delete_phrase_set_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeletePhraseSet_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_phrase_set_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.delete_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeletePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeletePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeletePhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_phrase_set" + }, + "description": "Sample for DeletePhraseSet", + "file": "speech_v2_generated_speech_delete_phrase_set_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeletePhraseSet_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_phrase_set_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.delete_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeleteRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeleteRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "delete_recognizer" + }, + "description": "Sample for DeleteRecognizer", + "file": "speech_v2_generated_speech_delete_recognizer_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeleteRecognizer_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_recognizer_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.delete_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.DeleteRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "DeleteRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.DeleteRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "delete_recognizer" + }, + "description": "Sample for DeleteRecognizer", + "file": "speech_v2_generated_speech_delete_recognizer_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_DeleteRecognizer_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_delete_recognizer_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.get_config", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetConfig" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Config", + "shortName": "get_config" + }, + "description": "Sample for GetConfig", + "file": "speech_v2_generated_speech_get_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetConfig_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_config_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.get_config", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetConfig", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetConfig" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Config", + "shortName": "get_config" + }, + "description": "Sample for GetConfig", + "file": "speech_v2_generated_speech_get_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetConfig_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_config_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.get_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.CustomClass", + "shortName": "get_custom_class" + }, + "description": "Sample for GetCustomClass", + "file": "speech_v2_generated_speech_get_custom_class_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetCustomClass_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_custom_class_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.get_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.CustomClass", + "shortName": "get_custom_class" + }, + "description": "Sample for GetCustomClass", + "file": "speech_v2_generated_speech_get_custom_class_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetCustomClass_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_custom_class_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.get_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetPhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetPhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.PhraseSet", + "shortName": "get_phrase_set" + }, + "description": "Sample for GetPhraseSet", + "file": "speech_v2_generated_speech_get_phrase_set_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetPhraseSet_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_phrase_set_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.get_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetPhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetPhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetPhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.PhraseSet", + "shortName": "get_phrase_set" + }, + "description": "Sample for GetPhraseSet", + "file": "speech_v2_generated_speech_get_phrase_set_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetPhraseSet_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_phrase_set_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.get_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Recognizer", + "shortName": "get_recognizer" + }, + "description": "Sample for GetRecognizer", + "file": "speech_v2_generated_speech_get_recognizer_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetRecognizer_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_recognizer_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.get_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.GetRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "GetRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.GetRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Recognizer", + "shortName": "get_recognizer" + }, + "description": "Sample for GetRecognizer", + "file": "speech_v2_generated_speech_get_recognizer_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_GetRecognizer_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_get_recognizer_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.list_custom_classes", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListCustomClasses" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListCustomClassesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListCustomClassesAsyncPager", + "shortName": "list_custom_classes" + }, + "description": "Sample for ListCustomClasses", + "file": "speech_v2_generated_speech_list_custom_classes_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListCustomClasses_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_custom_classes_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.list_custom_classes", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListCustomClasses", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListCustomClasses" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListCustomClassesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListCustomClassesPager", + "shortName": "list_custom_classes" + }, + "description": "Sample for ListCustomClasses", + "file": "speech_v2_generated_speech_list_custom_classes_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListCustomClasses_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_custom_classes_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.list_phrase_sets", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListPhraseSets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListPhraseSetsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListPhraseSetsAsyncPager", + "shortName": "list_phrase_sets" + }, + "description": "Sample for ListPhraseSets", + "file": "speech_v2_generated_speech_list_phrase_sets_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListPhraseSets_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_phrase_sets_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.list_phrase_sets", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListPhraseSets", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListPhraseSets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListPhraseSetsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListPhraseSetsPager", + "shortName": "list_phrase_sets" + }, + "description": "Sample for ListPhraseSets", + "file": "speech_v2_generated_speech_list_phrase_sets_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListPhraseSets_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_phrase_sets_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.list_recognizers", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListRecognizers" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListRecognizersRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListRecognizersAsyncPager", + "shortName": "list_recognizers" + }, + "description": "Sample for ListRecognizers", + "file": "speech_v2_generated_speech_list_recognizers_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListRecognizers_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_recognizers_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.list_recognizers", + "method": { + "fullName": "google.cloud.speech.v2.Speech.ListRecognizers", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "ListRecognizers" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.ListRecognizersRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.services.speech.pagers.ListRecognizersPager", + "shortName": "list_recognizers" + }, + "description": "Sample for ListRecognizers", + "file": "speech_v2_generated_speech_list_recognizers_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_ListRecognizers_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_list_recognizers_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "Recognize" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.RecognizeRequest" + }, + { + "name": "recognizer", + "type": "str" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.RecognitionConfig" + }, + { + "name": "config_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "content", + "type": "bytes" + }, + { + "name": "uri", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.RecognizeResponse", + "shortName": "recognize" + }, + "description": "Sample for Recognize", + "file": "speech_v2_generated_speech_recognize_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_Recognize_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_recognize_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.Recognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "Recognize" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.RecognizeRequest" + }, + { + "name": "recognizer", + "type": "str" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.RecognitionConfig" + }, + { + "name": "config_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "content", + "type": "bytes" + }, + { + "name": "uri", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.RecognizeResponse", + "shortName": "recognize" + }, + "description": "Sample for Recognize", + "file": "speech_v2_generated_speech_recognize_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_Recognize_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_recognize_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.streaming_recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "StreamingRecognize" + }, + "parameters": [ + { + "name": "requests", + "type": "Iterator[google.cloud.speech_v2.types.StreamingRecognizeRequest]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "Iterable[google.cloud.speech_v2.types.StreamingRecognizeResponse]", + "shortName": "streaming_recognize" + }, + "description": "Sample for StreamingRecognize", + "file": "speech_v2_generated_speech_streaming_recognize_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_StreamingRecognize_async", + "segments": [ + { + "end": 62, + "start": 27, + "type": "FULL" + }, + { + "end": 62, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 55, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 58, + "start": 56, + "type": "REQUEST_EXECUTION" + }, + { + "end": 63, + "start": 59, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_streaming_recognize_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.streaming_recognize", + "method": { + "fullName": "google.cloud.speech.v2.Speech.StreamingRecognize", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "StreamingRecognize" + }, + "parameters": [ + { + "name": "requests", + "type": "Iterator[google.cloud.speech_v2.types.StreamingRecognizeRequest]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "Iterable[google.cloud.speech_v2.types.StreamingRecognizeResponse]", + "shortName": "streaming_recognize" + }, + "description": "Sample for StreamingRecognize", + "file": "speech_v2_generated_speech_streaming_recognize_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_StreamingRecognize_sync", + "segments": [ + { + "end": 62, + "start": 27, + "type": "FULL" + }, + { + "end": 62, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 55, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 58, + "start": 56, + "type": "REQUEST_EXECUTION" + }, + { + "end": 63, + "start": 59, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_streaming_recognize_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.undelete_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeleteCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeleteCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "undelete_custom_class" + }, + "description": "Sample for UndeleteCustomClass", + "file": "speech_v2_generated_speech_undelete_custom_class_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeleteCustomClass_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_custom_class_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.undelete_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeleteCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeleteCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeleteCustomClassRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "undelete_custom_class" + }, + "description": "Sample for UndeleteCustomClass", + "file": "speech_v2_generated_speech_undelete_custom_class_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeleteCustomClass_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_custom_class_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.undelete_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeletePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeletePhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "undelete_phrase_set" + }, + "description": "Sample for UndeletePhraseSet", + "file": "speech_v2_generated_speech_undelete_phrase_set_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeletePhraseSet_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_phrase_set_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.undelete_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeletePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeletePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeletePhraseSetRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "undelete_phrase_set" + }, + "description": "Sample for UndeletePhraseSet", + "file": "speech_v2_generated_speech_undelete_phrase_set_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeletePhraseSet_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_phrase_set_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.undelete_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeleteRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeleteRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "undelete_recognizer" + }, + "description": "Sample for UndeleteRecognizer", + "file": "speech_v2_generated_speech_undelete_recognizer_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeleteRecognizer_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_recognizer_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.undelete_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UndeleteRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UndeleteRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UndeleteRecognizerRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "undelete_recognizer" + }, + "description": "Sample for UndeleteRecognizer", + "file": "speech_v2_generated_speech_undelete_recognizer_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UndeleteRecognizer_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_undelete_recognizer_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.update_config", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateConfig" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateConfigRequest" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.Config" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Config", + "shortName": "update_config" + }, + "description": "Sample for UpdateConfig", + "file": "speech_v2_generated_speech_update_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateConfig_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_config_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.update_config", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateConfig", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateConfig" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateConfigRequest" + }, + { + "name": "config", + "type": "google.cloud.speech_v2.types.Config" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.speech_v2.types.Config", + "shortName": "update_config" + }, + "description": "Sample for UpdateConfig", + "file": "speech_v2_generated_speech_update_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateConfig_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 47, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "start": 48, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_config_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.update_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateCustomClassRequest" + }, + { + "name": "custom_class", + "type": "google.cloud.speech_v2.types.CustomClass" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_custom_class" + }, + "description": "Sample for UpdateCustomClass", + "file": "speech_v2_generated_speech_update_custom_class_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateCustomClass_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_custom_class_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.update_custom_class", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateCustomClass", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateCustomClass" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateCustomClassRequest" + }, + { + "name": "custom_class", + "type": "google.cloud.speech_v2.types.CustomClass" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_custom_class" + }, + "description": "Sample for UpdateCustomClass", + "file": "speech_v2_generated_speech_update_custom_class_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateCustomClass_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_custom_class_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.update_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdatePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdatePhraseSetRequest" + }, + { + "name": "phrase_set", + "type": "google.cloud.speech_v2.types.PhraseSet" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_phrase_set" + }, + "description": "Sample for UpdatePhraseSet", + "file": "speech_v2_generated_speech_update_phrase_set_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdatePhraseSet_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_phrase_set_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.update_phrase_set", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdatePhraseSet", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdatePhraseSet" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdatePhraseSetRequest" + }, + { + "name": "phrase_set", + "type": "google.cloud.speech_v2.types.PhraseSet" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_phrase_set" + }, + "description": "Sample for UpdatePhraseSet", + "file": "speech_v2_generated_speech_update_phrase_set_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdatePhraseSet_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_phrase_set_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.speech_v2.SpeechAsyncClient", + "shortName": "SpeechAsyncClient" + }, + "fullName": "google.cloud.speech_v2.SpeechAsyncClient.update_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateRecognizerRequest" + }, + { + "name": "recognizer", + "type": "google.cloud.speech_v2.types.Recognizer" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_recognizer" + }, + "description": "Sample for UpdateRecognizer", + "file": "speech_v2_generated_speech_update_recognizer_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateRecognizer_async", + "segments": [ + { + "end": 59, + "start": 27, + "type": "FULL" + }, + { + "end": 59, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 56, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 60, + "start": 57, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_recognizer_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.speech_v2.SpeechClient", + "shortName": "SpeechClient" + }, + "fullName": "google.cloud.speech_v2.SpeechClient.update_recognizer", + "method": { + "fullName": "google.cloud.speech.v2.Speech.UpdateRecognizer", + "service": { + "fullName": "google.cloud.speech.v2.Speech", + "shortName": "Speech" + }, + "shortName": "UpdateRecognizer" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.speech_v2.types.UpdateRecognizerRequest" + }, + { + "name": "recognizer", + "type": "google.cloud.speech_v2.types.Recognizer" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_recognizer" + }, + "description": "Sample for UpdateRecognizer", + "file": "speech_v2_generated_speech_update_recognizer_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "speech_v2_generated_Speech_UpdateRecognizer_sync", + "segments": [ + { + "end": 59, + "start": 27, + "type": "FULL" + }, + { + "end": 59, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 49, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 56, + "start": 50, + "type": "REQUEST_EXECUTION" + }, + { + "end": 60, + "start": 57, + "type": "RESPONSE_HANDLING" + } + ], + "title": "speech_v2_generated_speech_update_recognizer_sync.py" + } + ] +} diff --git a/speech/generated_samples/speech_v2_generated_speech_batch_recognize_async.py b/speech/generated_samples/speech_v2_generated_speech_batch_recognize_async.py new file mode 100644 index 000000000000..64de219fe419 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_batch_recognize_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRecognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_BatchRecognize_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_batch_recognize(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.BatchRecognizeRequest( + recognizer="recognizer_value", + ) + + # Make the request + operation = client.batch_recognize(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_BatchRecognize_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_batch_recognize_sync.py b/speech/generated_samples/speech_v2_generated_speech_batch_recognize_sync.py new file mode 100644 index 000000000000..f306ea7af090 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_batch_recognize_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for BatchRecognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_BatchRecognize_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_batch_recognize(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.BatchRecognizeRequest( + recognizer="recognizer_value", + ) + + # Make the request + operation = client.batch_recognize(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_BatchRecognize_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_custom_class_async.py b/speech/generated_samples/speech_v2_generated_speech_create_custom_class_async.py new file mode 100644 index 000000000000..cad6b2f12694 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_custom_class_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreateCustomClass_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_create_custom_class(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.CreateCustomClassRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreateCustomClass_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_custom_class_sync.py b/speech/generated_samples/speech_v2_generated_speech_create_custom_class_sync.py new file mode 100644 index 000000000000..3001c42053d3 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_custom_class_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreateCustomClass_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_create_custom_class(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.CreateCustomClassRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreateCustomClass_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_async.py b/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_async.py new file mode 100644 index 000000000000..d2932bee3778 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreatePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreatePhraseSet_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_create_phrase_set(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.CreatePhraseSetRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreatePhraseSet_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_sync.py b/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_sync.py new file mode 100644 index 000000000000..c311d648c15f --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_phrase_set_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreatePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreatePhraseSet_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_create_phrase_set(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.CreatePhraseSetRequest( + parent="parent_value", + ) + + # Make the request + operation = client.create_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreatePhraseSet_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_recognizer_async.py b/speech/generated_samples/speech_v2_generated_speech_create_recognizer_async.py new file mode 100644 index 000000000000..eb62638eb3a9 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_recognizer_async.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreateRecognizer_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_create_recognizer(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + recognizer = speech_v2.Recognizer() + recognizer.model = "model_value" + recognizer.language_codes = ['language_codes_value1', 'language_codes_value2'] + + request = speech_v2.CreateRecognizerRequest( + recognizer=recognizer, + parent="parent_value", + ) + + # Make the request + operation = client.create_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreateRecognizer_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_create_recognizer_sync.py b/speech/generated_samples/speech_v2_generated_speech_create_recognizer_sync.py new file mode 100644 index 000000000000..af0ffdc76996 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_create_recognizer_sync.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_CreateRecognizer_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_create_recognizer(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + recognizer = speech_v2.Recognizer() + recognizer.model = "model_value" + recognizer.language_codes = ['language_codes_value1', 'language_codes_value2'] + + request = speech_v2.CreateRecognizerRequest( + recognizer=recognizer, + parent="parent_value", + ) + + # Make the request + operation = client.create_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_CreateRecognizer_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_async.py b/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_async.py new file mode 100644 index 000000000000..64dce73c81da --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeleteCustomClass_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_delete_custom_class(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.DeleteCustomClassRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeleteCustomClass_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_sync.py b/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_sync.py new file mode 100644 index 000000000000..e6a15dd450c8 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_custom_class_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeleteCustomClass_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_delete_custom_class(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.DeleteCustomClassRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeleteCustomClass_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_async.py b/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_async.py new file mode 100644 index 000000000000..d5f1c64bfd9a --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeletePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeletePhraseSet_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_delete_phrase_set(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.DeletePhraseSetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeletePhraseSet_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_sync.py b/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_sync.py new file mode 100644 index 000000000000..cc874b06330c --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_phrase_set_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeletePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeletePhraseSet_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_delete_phrase_set(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.DeletePhraseSetRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeletePhraseSet_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_async.py b/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_async.py new file mode 100644 index 000000000000..8de3bedd71bb --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeleteRecognizer_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_delete_recognizer(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.DeleteRecognizerRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeleteRecognizer_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_sync.py b/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_sync.py new file mode 100644 index 000000000000..72e49f256e4e --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_delete_recognizer_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_DeleteRecognizer_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_delete_recognizer(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.DeleteRecognizerRequest( + name="name_value", + ) + + # Make the request + operation = client.delete_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_DeleteRecognizer_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_config_async.py b/speech/generated_samples/speech_v2_generated_speech_get_config_async.py new file mode 100644 index 000000000000..0f430b8c62c8 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_config_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetConfig_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_get_config(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.GetConfigRequest( + name="name_value", + ) + + # Make the request + response = await client.get_config(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetConfig_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_config_sync.py b/speech/generated_samples/speech_v2_generated_speech_get_config_sync.py new file mode 100644 index 000000000000..802dfae519ca --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_config_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetConfig_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_get_config(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.GetConfigRequest( + name="name_value", + ) + + # Make the request + response = client.get_config(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetConfig_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_custom_class_async.py b/speech/generated_samples/speech_v2_generated_speech_get_custom_class_async.py new file mode 100644 index 000000000000..c82070aec09d --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_custom_class_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetCustomClass_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_get_custom_class(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.GetCustomClassRequest( + name="name_value", + ) + + # Make the request + response = await client.get_custom_class(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetCustomClass_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_custom_class_sync.py b/speech/generated_samples/speech_v2_generated_speech_get_custom_class_sync.py new file mode 100644 index 000000000000..121b9eaeb918 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_custom_class_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetCustomClass_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_get_custom_class(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.GetCustomClassRequest( + name="name_value", + ) + + # Make the request + response = client.get_custom_class(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetCustomClass_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_async.py b/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_async.py new file mode 100644 index 000000000000..e5f861fe8a6b --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetPhraseSet_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_get_phrase_set(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.GetPhraseSetRequest( + name="name_value", + ) + + # Make the request + response = await client.get_phrase_set(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetPhraseSet_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_sync.py b/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_sync.py new file mode 100644 index 000000000000..b02f3c23de02 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_phrase_set_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetPhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetPhraseSet_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_get_phrase_set(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.GetPhraseSetRequest( + name="name_value", + ) + + # Make the request + response = client.get_phrase_set(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetPhraseSet_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_recognizer_async.py b/speech/generated_samples/speech_v2_generated_speech_get_recognizer_async.py new file mode 100644 index 000000000000..733bffb82e46 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_recognizer_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetRecognizer_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_get_recognizer(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.GetRecognizerRequest( + name="name_value", + ) + + # Make the request + response = await client.get_recognizer(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetRecognizer_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_get_recognizer_sync.py b/speech/generated_samples/speech_v2_generated_speech_get_recognizer_sync.py new file mode 100644 index 000000000000..d7ecb25460df --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_get_recognizer_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_GetRecognizer_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_get_recognizer(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.GetRecognizerRequest( + name="name_value", + ) + + # Make the request + response = client.get_recognizer(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_GetRecognizer_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_async.py b/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_async.py new file mode 100644 index 000000000000..9ff98b68a27d --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCustomClasses +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListCustomClasses_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_list_custom_classes(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.ListCustomClassesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_custom_classes(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListCustomClasses_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_sync.py b/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_sync.py new file mode 100644 index 000000000000..9c95e926a4c7 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_custom_classes_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCustomClasses +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListCustomClasses_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_list_custom_classes(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.ListCustomClassesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_custom_classes(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListCustomClasses_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_async.py b/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_async.py new file mode 100644 index 000000000000..da27848f2168 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPhraseSets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListPhraseSets_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_list_phrase_sets(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.ListPhraseSetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_phrase_sets(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListPhraseSets_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_sync.py b/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_sync.py new file mode 100644 index 000000000000..306eb5b5368e --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_phrase_sets_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPhraseSets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListPhraseSets_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_list_phrase_sets(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.ListPhraseSetsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_phrase_sets(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListPhraseSets_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_recognizers_async.py b/speech/generated_samples/speech_v2_generated_speech_list_recognizers_async.py new file mode 100644 index 000000000000..c645fbe093ed --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_recognizers_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListRecognizers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListRecognizers_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_list_recognizers(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.ListRecognizersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_recognizers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListRecognizers_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_list_recognizers_sync.py b/speech/generated_samples/speech_v2_generated_speech_list_recognizers_sync.py new file mode 100644 index 000000000000..ad1460e5f7a4 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_list_recognizers_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListRecognizers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_ListRecognizers_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_list_recognizers(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.ListRecognizersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_recognizers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END speech_v2_generated_Speech_ListRecognizers_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_recognize_async.py b/speech/generated_samples/speech_v2_generated_speech_recognize_async.py new file mode 100644 index 000000000000..440fcf82acac --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_recognize_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Recognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_Recognize_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_recognize(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.RecognizeRequest( + content=b'content_blob', + recognizer="recognizer_value", + ) + + # Make the request + response = await client.recognize(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_Recognize_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_recognize_sync.py b/speech/generated_samples/speech_v2_generated_speech_recognize_sync.py new file mode 100644 index 000000000000..aae737216478 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_recognize_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for Recognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_Recognize_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_recognize(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.RecognizeRequest( + content=b'content_blob', + recognizer="recognizer_value", + ) + + # Make the request + response = client.recognize(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_Recognize_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_async.py b/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_async.py new file mode 100644 index 000000000000..46598611112f --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_async.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingRecognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_StreamingRecognize_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_streaming_recognize(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.StreamingRecognizeRequest( + recognizer="recognizer_value", + ) + + # This method expects an iterator which contains + # 'speech_v2.StreamingRecognizeRequest' 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 = await client.streaming_recognize(requests=request_generator()) + + # Handle the response + async for response in stream: + print(response) + +# [END speech_v2_generated_Speech_StreamingRecognize_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_sync.py b/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_sync.py new file mode 100644 index 000000000000..057843eec944 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_streaming_recognize_sync.py @@ -0,0 +1,63 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StreamingRecognize +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_StreamingRecognize_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_streaming_recognize(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.StreamingRecognizeRequest( + recognizer="recognizer_value", + ) + + # This method expects an iterator which contains + # 'speech_v2.StreamingRecognizeRequest' 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_recognize(requests=request_generator()) + + # Handle the response + for response in stream: + print(response) + +# [END speech_v2_generated_Speech_StreamingRecognize_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_async.py b/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_async.py new file mode 100644 index 000000000000..2ae43d7f72d3 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeleteCustomClass_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_undelete_custom_class(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UndeleteCustomClassRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeleteCustomClass_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_sync.py b/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_sync.py new file mode 100644 index 000000000000..0ef956125c5c --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_custom_class_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeleteCustomClass_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_undelete_custom_class(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UndeleteCustomClassRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeleteCustomClass_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_async.py b/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_async.py new file mode 100644 index 000000000000..77808995b1c8 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeletePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeletePhraseSet_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_undelete_phrase_set(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UndeletePhraseSetRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeletePhraseSet_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_sync.py b/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_sync.py new file mode 100644 index 000000000000..594399fcb771 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_phrase_set_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeletePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeletePhraseSet_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_undelete_phrase_set(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UndeletePhraseSetRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeletePhraseSet_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_async.py b/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_async.py new file mode 100644 index 000000000000..eb58be11bd8f --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeleteRecognizer_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_undelete_recognizer(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UndeleteRecognizerRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeleteRecognizer_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_sync.py b/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_sync.py new file mode 100644 index 000000000000..f4a3137249ea --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_undelete_recognizer_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UndeleteRecognizer_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_undelete_recognizer(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UndeleteRecognizerRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UndeleteRecognizer_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_config_async.py b/speech/generated_samples/speech_v2_generated_speech_update_config_async.py new file mode 100644 index 000000000000..28fb331fb7a7 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_config_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateConfig_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_update_config(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UpdateConfigRequest( + ) + + # Make the request + response = await client.update_config(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateConfig_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_config_sync.py b/speech/generated_samples/speech_v2_generated_speech_update_config_sync.py new file mode 100644 index 000000000000..930c59c40996 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_config_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateConfig +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateConfig_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_update_config(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UpdateConfigRequest( + ) + + # Make the request + response = client.update_config(request=request) + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateConfig_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_custom_class_async.py b/speech/generated_samples/speech_v2_generated_speech_update_custom_class_async.py new file mode 100644 index 000000000000..959038979403 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_custom_class_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateCustomClass_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_update_custom_class(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UpdateCustomClassRequest( + ) + + # Make the request + operation = client.update_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateCustomClass_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_custom_class_sync.py b/speech/generated_samples/speech_v2_generated_speech_update_custom_class_sync.py new file mode 100644 index 000000000000..f877fb6c3526 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_custom_class_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCustomClass +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateCustomClass_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_update_custom_class(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UpdateCustomClassRequest( + ) + + # Make the request + operation = client.update_custom_class(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateCustomClass_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_async.py b/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_async.py new file mode 100644 index 000000000000..02ee5d96efc0 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdatePhraseSet_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_update_phrase_set(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + request = speech_v2.UpdatePhraseSetRequest( + ) + + # Make the request + operation = client.update_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdatePhraseSet_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_sync.py b/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_sync.py new file mode 100644 index 000000000000..b65577aeb837 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_phrase_set_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdatePhraseSet +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdatePhraseSet_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_update_phrase_set(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + request = speech_v2.UpdatePhraseSetRequest( + ) + + # Make the request + operation = client.update_phrase_set(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdatePhraseSet_sync] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_recognizer_async.py b/speech/generated_samples/speech_v2_generated_speech_update_recognizer_async.py new file mode 100644 index 000000000000..d29f724c271f --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_recognizer_async.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateRecognizer_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +async def sample_update_recognizer(): + # Create a client + client = speech_v2.SpeechAsyncClient() + + # Initialize request argument(s) + recognizer = speech_v2.Recognizer() + recognizer.model = "model_value" + recognizer.language_codes = ['language_codes_value1', 'language_codes_value2'] + + request = speech_v2.UpdateRecognizerRequest( + recognizer=recognizer, + ) + + # Make the request + operation = client.update_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateRecognizer_async] diff --git a/speech/generated_samples/speech_v2_generated_speech_update_recognizer_sync.py b/speech/generated_samples/speech_v2_generated_speech_update_recognizer_sync.py new file mode 100644 index 000000000000..2c38e4fc9a60 --- /dev/null +++ b/speech/generated_samples/speech_v2_generated_speech_update_recognizer_sync.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateRecognizer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-speech + + +# [START speech_v2_generated_Speech_UpdateRecognizer_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud import speech_v2 + + +def sample_update_recognizer(): + # Create a client + client = speech_v2.SpeechClient() + + # Initialize request argument(s) + recognizer = speech_v2.Recognizer() + recognizer.model = "model_value" + recognizer.language_codes = ['language_codes_value1', 'language_codes_value2'] + + request = speech_v2.UpdateRecognizerRequest( + recognizer=recognizer, + ) + + # Make the request + operation = client.update_recognizer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END speech_v2_generated_Speech_UpdateRecognizer_sync]